I am using the quadratic formula to turn $ax^2 + bx +c$ into $a(x-x_1)(x-x_2)$. However, I am having difficulty finding a mathematical way to distribute the $a$ into $(x-x_1)$ and $(x-x_2)$ like $(a_1x-a_1x_1)(a_2x-a_2x_2)$ in such as to satisfy $a=a_1\times a_2$, $a_1\in\mathbb{W}$, $a_2\in\mathbb{W}$, $x_{int}a_1\in\mathbb{W}$, and $x_{int}a_2\in\mathbb{W}$ only if possible. I am attempting to do this using only basic math (i.e. addition, subtraction, multiplication, division, exponentiation (including roots), modulo, unary negative, and unary positive (absolute value)), minimal if/then statements, GCF, GCD, and the ability to turn a decimal into a (potentially "improper") fraction and get the numerator and the denominator. For a very simple example, I would want to turn this:
$$f(x) = 12\times(x + \frac{5}2)\times(x + \frac{1}3)$$
Into this:
$$f(x) = (4\times{x} + 10)\times(3\times{x} + 1)$$
Yes, I can easily do the simple example above in my head. But, the actual numbers I am dealing with are much much bigger. Thus, I need a mathematical way to punch it into a calculator and calculate it.
So far, I have made not much progress in my attempts to devise a way to distribute $A$. So, how would I go about distributing A to meet all of the criteria if the criteria are attainable? Any any all constructive advice/criticism is welcome.