I'm trying to use the quadratic equation (QE) to factor a degree 2 polynomial into the format: $(x + a)^2$, where a is any real number.
This works great for equations like:
(1) $x^2 + 2x + 1$
The QE gives roots $x = \{-1, -1\}$, and $(x + 1)^2 = x^2 + 2x + 1$.
This approach fails for other polynomials such as:
(2) $9x^2 + 36x + 36$
The roots found with the QE are $x = \{-2, -2\}$. But $(x + 2)^2 \ne 9x + 36x + 36$.
9 is the GCF from the coefficients of (2), so (2) can be rewritten as:
$9 \times (x^2 + 4x + 4)$
and by using the QE on the second term, this equals:
$9 \times (x + 2)^2$. And $9 \times (x + 2)^2 = 9x + 36x + 36$ (2), so this seems to be a better approach.
So my question is: must the input to QF be a polynomial that has coefficients with GCF = $1$, for the result to give roots that can be used to reconstruct the original function?
Look at the expansion $$(x+a)^2=x^2+2ax+a^2.$$ Notice that the coefficient of $x^2$ is always $1$. Thus, if a quadratic polynomial can be written in this form, it must have a leading coefficient of $1$. In general, if you have a quadratic polynomial with leading coefficient $c$ and it has a double root at $-a$, then the polynomial can be written as $c(x+a)^2$. So, you don't want to be looking at the GCF, but rather at the leading coefficient. (Although these will be equal in any polynomial with positive leading coefficient and a double root)
More generally, if you have a polynomial $P(x)$ of degree $d$ with leading coefficient $c$ and roots (enumerated with multiplicity) $r_1,\,r_2,\ldots,r_d$, one gets $$P(x)=c(x-r_1)(x-r_2)\cdots(x-r_d).$$ That is, the leading coefficient can always be pulled out of the factorized form. (Note that this doesn't work if you don't have $d$ roots - if you're working in the real numbers and not the complex numbers, some polynomials can't be factored)