# How can one find the factorization $a^4 + 2a^3 + 3a^2 + 2a + 1 = (a^2 + a + 1)^2$ from scratch?

I want to prove $a^4 + 2a^3 + 3a^2 + 2a + 1$ always be perfect square for $a \in \mathbb{N}$. Using GeoGebra I found $a^4 + 2a^3 + 3a ² + 2a + 1 = (a^2 + a + 1)^2$ which is trivial to verify.

Since this equation has no real roots, it's not so easy to decompose it through division by $a-a_0$ where $a_0$ is a root. I don't want to use complex numbers if possible. How do find this factorization from scratch / without using a computer?

• Do you want to find the square root of a polynomial it it exists or do you want to factor an arbitrary polynomial? – miracle173 Aug 21 '16 at 21:05
• If you find a way of proving $\sqrt{a^4 + 2a^3 + 3a^2 + 2a + 1} \in \mathbb{N}$ without calculating the concrete factorization, it's fine. – user362873 Aug 21 '16 at 21:11
• How can the sqare root of a polynomial of degree 4 be an integer? – miracle173 Aug 21 '16 at 21:16
• You're right, it should be $\sqrt{a^4 + 2a^3 + 3a^2 + 2a + 1} \in \mathbb{N}, \forall a \in \mathbb{N}$ – user362873 Aug 21 '16 at 21:23
• You can always set up the system of equations for the coefficients and then solve the system. – Carl Mummert Aug 21 '16 at 21:29

Standard Solution:

Let $a^4+2a^3+3a^2+2a+1=(ba^2+ca+d)^2$ where $b,c,d \in \mathbb{R}$

Observe that

$$(ba^2+ca+d)^2=b^2a^4+2bca^3+(2bd+c^2)a^2+2cda+d^2$$

Comparing coefficient of like terms, we get

$$b^2=1 \Rightarrow b=\pm 1$$

$$bc=1 \Rightarrow c=\pm 1$$

$$\pm2d+1=3 \Rightarrow d=\pm 1$$

Thus, $$a^4+2a^3+3a^2+2a+1=[\pm(a^2+a+1)]^2$$

Note: Although it appears that this method assumes that the quartic must be the square of a polynomials, but if you end up getting no answer, it means you arrived at a contradiction and the equation is not the square of a polynomial. Moreover, the if there are 2 answers, they are additive inverses of each other.

Alternate Solution:

Let $f(a)=a^4+2a^3+3a^2+2a+1$

Observe that $f(0)=1$ and that the coefficients follow this pattern: $1,2,3,2,1$

Dividing $f(a)$ by $a^2$ to get

$$g(a)=\frac{f(a)}{a^2}=a^2+2a+3+\frac{2}{a}+\frac{1}{a^2}=\left(a+\frac{1}{a}\right)^2+2\left(a+\frac{1}{a}\right)+1$$

Substitute $t=a+\dfrac{1}{a}$ to get $t^2+2t+1=(t+1)^2$

Now, back-substitute to get

$$f(a)=a^2 \cdot \left(a+\frac{1}{a}+1\right)^2=(a^2+a+1)^2$$

But since $x^2=(-x)^2$, we get

$$\color{blue}{\boxed{\color{red}{a^4+2a^3+3a^2+2a+1=[\pm (a^2+a+1)]^2}}}$$

• (This assumes the polynomial is the square of a quadratic.) – arctic tern Aug 21 '16 at 21:01
• Magic. Too much magic. – Starfall Aug 21 '16 at 21:25
• Why was this downvoted? – Dragonemperor42 Aug 21 '16 at 21:25
• How do you achieve $a^2 + 2a + 3 + \frac{2}{a} + \frac{1}{a^2} = \left(a + \frac{1}{a}\right)^2 + 2\left(a + \frac{1}{a}\right) + 1$ ? Writing the terms of the right site in expanded form, it will get me to $a^2 + 2a + 1 + \frac{2}{a} + \frac{1}{a^2}$, a contradiction. – user362873 Aug 21 '16 at 21:51

The coefficients $1,2,3,2,1$ are suggestive of the following:

$$\begin{array}{c} & 1a^4 & + & 2a^3 & + & 3a^2 & + & 2a & + & 1 \\ \hline = & a^4 & + & a^3 & + & a^2 \\ & & + & a^3 & + & a^2 & + & a \\ & & & & + & a^2 & + & a & + & 1 \end{array}$$

$$\begin{array}{l} = & a^2(a^2+a+1)+a(a^2+a+1)+1(a^2+a+1) \\ = & (a^2+a+1)^2. \end{array}$$

• It may work in this case, but what about rational coefficients? – user362873 Aug 21 '16 at 20:55
• @Ovi It's a combination of "factoring by grouping" and having familiarity with powers of $11$. For instance, try cubing $11$ and you will see how numbers combine systematically. Although this is more directly analogous to squaring $111$. Anyway, this is what I would have answered even if OP did not give the complete factorization in the question. Even popular meme websites with lay people have noticed $$111111111^2=12345678987654321.$$ – arctic tern Aug 21 '16 at 20:59
• @user362873 There are less simple but still computer-free answers to the general case for fourth-degree polynomials. If the rational roots theorem fails to detect a linear factor but the polynomial is indeed reducible, it is a product of quadratic polynomials. One may "depress" the next-to-highest degree term and make it a monic polynomial with an affine change-of-variables, write $$f(x)=(x^2+sx+t)(x^2+ux+v),$$ and then solve with Descartes' or Euler's method as described on Wikipedia's article for "quartic function." – arctic tern Aug 21 '16 at 21:07

Kronecker's polynomial factorization method may be used here. Let $$f(x) = x^4 + 2x^3 + 3x^2 + 2x + 1$$ and let $g(x) = x^2 + bx + c$ be an irreducible quadratic dividing $f(x)$ in $\mathbf Z[x]$ (such a quadratic must exist if the polynomial is reducible, since there are no rational roots). We observe that $f(0) = f(-1) = 1$, and since $g$ divides $f$ in $\mathbf Z[x]$, it follows that $g(0), g(-1)$ divide $f(0), f(-1)$ respectively. Therefore, there are four cases we must check for $(c, b)$:

$$(1, 1),\, (1, 3),\, (-1, 1),\, (-1, -1)$$

Testing the first candidate, we find that $x^2 + x + 1$ is indeed a divisor, and the result of the division algorithm is that $f(x) = (x^2 + x + 1)^2$. Thus, we don't even need to check the other cases, and we are done.

The strategy is that we can always reduce the factorization problem over a factorial ring into checking finitely many cases, and with clever choices we can cut down the number of cases considerably. Here, there were four cases to check, and performing four divisions isn't very time consuming. If none of these cases worked, we would have concluded that our original polynomial $f(x)$ was irreducible in $\mathbf Q[x]$.

if you suspect your polynomial factors and that this includes some repeat factor, take the gcd of the original polynomial and its derivative. You don't need to know calculus to find the formal derivative of a polynomial. You had $$f = a^4 + 2 a^3 + 3 a^2 + 2 a + 1,$$ $$f' = 4 a^3 + 6 a^2 + 6 a + 2.$$ $$4f - a f' = 2 a^3 + 6 a^2 + 6a+4,$$ so $\gcd_{\mathbb Q}(f, f') = \gcd_{\mathbb Q}(f', 2 a^3 + 6 a^2 + 6a+4),$ where we are allowed to move constant integer factors where we like, or divide out, the gcd is defined over the rationals anyway. Want $$\gcd_{\mathbb Q}( 2 a^3 + 3 a^2 + 3 a + 1, 2 a^3 + 6 a^2 + 6a + 4) =$$ $$\gcd_{\mathbb Q}( 2 a^3 + 6 a^2 + 6a + 4, 3 a^2 + 3 a + 3) =$$ $$\gcd_{\mathbb Q}( a^3 + 3 a^2 + 3a + 2, a^2 + a + 1) = a^2 + a + 1$$ because $$(a^2 + a + 1)(a+2) = a^3 + 3 a^2 + 3a + 2.$$

That does it, $(a^2 + a + 1)^2$ divides your original polynomial. It has the same degree, so the multiplier is a constant rational, which must actually be $1.$

Here is an example I made: $$g = x^6 + 15 x^5 + 102 x^4 + 395 x^3 + 918 x^2 + 1215 x + 729$$ $$g' = 6 x^5 + 75 x^4 + 408 x^3 + 1185 x^2 + 1836 x + 1215.$$ First get rid of $x^6,$ $$6g - x g' = 15 x^5 + 204 x^4 + 1185 x^3 + 3672 x^2 + 6075 x + 4374$$ $$5 g' - 2 (6g - x g') = -33x^4 - 330x^3 - 1419x^2 - 2970x - 2673$$ $$\gcd_{\mathbb Q}(15 x^5 + 204 x^4 + 1185 x^3 + 3672 x^2 + 6075 x + 4374 , 33x^4 + 330x^3 + 1419x^2 + 2970x + 2673 ) =$$ $$\gcd_{\mathbb Q}( 33x^4 + 330x^3 + 1419x^2 + 2970x + 2673, 594 x^4 + 5940 x^3 + 25542 x^2 + 53460 x + 48114 ) = 33x^4 + 330x^3 + 1419x^2 + 2970x + 2673$$ with quotient exactly $18$ This gcd has a constant factor $33,$ divide out and we get $$x^4 + 10 x^3 + 43x^2 + 90x + 81.$$ We know that this divides the original, but clearly its square does not, so something else is going on....

Well, might as well find the quotient, $$g / (x^4 + 10 x^3 + 43x^2 + 90x + 81) = x^2 + 5 x + 9.$$ What happens next is that $$x^4 + 10 x^3 + 43x^2 + 90x + 81 = (x^2 + 5 x + 9)^2$$ and $$x^6 + 15 x^5 + 102 x^4 + 395 x^3 + 918 x^2 + 1215 x + 729 = (x^2 + 5 x + 9)^3$$ Afterthought: once it became clear that the repeated factor idea was not simply giving a squared factor, the sensible thing would have been to take the gcd of the original polynomial with its second derivative.

In this particular case you may multiply by $(a-1)^2$ to obtain $a^6-2a^3+1=(a^3-1)^2=(a-1)^2(a^2+a+1)^2$ but you are perhaps asking for a more general method?

Yes, I know you want to avoid using complex numbers and computers but still it may simplify life, because you calculate the complex roots, they come in complex pairs $u\pm iv$ and then $((a-u)^2 + v^2)$ is a factor. But you probably knew this.

One may notice that $p(x)=x^4+2x^3+3x^2+2x+1$ is a palyndromic polynomial, hence $\frac{p(x)}{x^2}$ is a polynomial in $z=x+\frac{1}{x}$:

$$\frac{p(x)}{x^2} = \left(x^2+\frac{1}{x^2}\right)+2z+3 = (z^2-2)+2z+3 = z^2+2z+1 = \color{red}{(z+1)^2}$$ so: $$p(x) = x^2\left(x+\frac{1}{x}+1\right)^2 = \color{red}{(1+x+x^2)^2}.$$

• +1 for this special problem (it seems that the OP is interested only in this one) this is the simplest way you can do it by hand. – miracle173 Aug 21 '16 at 22:07