# Factoring a hard polynomial

This might seem like a basic question but I want a systematic way to factor the following polynomial:

$$n^4+6n^3+11n^2+6n+1.$$

I know the answer but I am having a difficult time factoring this polynomial properly. (It should be $(n^2 + 3n + 1)^2$). Thank you and have a great day!

-
You may be interested to compare Wikipedia's article with the Answers below to match up the techniques described in that article. – hardmath Feb 21 '14 at 13:18

In general there's no easy way. But there are a lot of tricks you can use, and sometimes they work.

For this problem, the rational root theorem tells us that if there is a rational root, it must be $\pm 1$. Evidently it isn't either of these, so there are no rational roots, and therefore no factors of the form $n-q$.

So we are looking for two second-degree factors: $$n^4+6n^3+11n^2+6n+1 = (an^2+bn+c)(pn^2+qn+r)$$

But we can see from the coefficient of 1 on the $n^4$ term that $a=p=1$. From the constant term of 1 we have either $c=r=1$ or $c=r=-1$, so it's really

$$n^4+6n^3+11n^2+6n+1 = (n^2+bn\pm1)(n^2+qn\pm1).$$

Equating the coefficients of the $n^3$ terms on each side, we see that $b+q=6$.

Equating the coefficients of the $n^2$ terms on each side, we see that either $bq+2=11$ (if we take the $\pm$ signs to be $+$) or that $bq-2 = 11$ (if the $\pm$ signs are $-$).

The equations $b+q=6$ and $bq-2 = 11$ certainly have no solution in integers, since one of $b$ or $q$ must be 13. So we try the other pair of equations, $b+q=6$ and $bq+2 = 11$. Here the solution $b=q=3$ is obvious, and we are done, except to check the answer. We must do this, because we have completely ignored the coefficient of the $n$ term.

-
+1, good analysis. – Rustyn Feb 20 '14 at 21:42
Great solution! Thank you very much @MJD :) – InsigMath Feb 20 '14 at 21:47
You are welcome. I am glad you are pleased. – MJD Feb 20 '14 at 21:47
It is fair to take $a=p=1$, but then it doesn't seem fair to assume $c=r=1$. It works this time. If we are factoring over the integers, we can get $c=r=\pm1$ – Ross Millikan Feb 20 '14 at 21:50
@Ross Thank you for pointing this out. – MJD Feb 20 '14 at 22:01

I was thinking along the same lines as TZakrevskiy but with a slight twist. Once you've become convinced that $P(n)=n^4+6n^3+11n^2+6n+1$ is the square of a quadratic (because its values for small $n$ are all squares), try computing

$$P(10)=10000+6000+1100+60+1=17161$$

and then take its square root:

$$\sqrt{17161}=131=1\cdot10^2+3\cdot10+1$$

which suggests the (correct) factorization

$$P(n)=(n^2+3n+1)^2$$

If you want to be extra sure, look at

$$\sqrt{100^4+6\cdot100^3+11\cdot100^2+6\cdot100+1}=10301$$

-
+1 as I've never seen this kind of approach used for factorisation before. – Keith Feb 21 '14 at 2:30
+1, this is so brilliant! – Silviu Burcea Feb 21 '14 at 4:51

Exploit the symmetry of the palindromic polynomial to factorise as follows,

\begin{align*} n^4 + 6n^3 + 11n^2 + 6n + 1 &= n^2\left( n^2 + \frac{1}{n^2} + 6n + \frac{6}{n} + 11 \right)\\ &= n^2\left( (n + 1/n)^2 + 6(n + 1/n) + 9 \vphantom{\frac{1}{n^2}} \right)\\ &= n^2\left( n + 1/n + 3 \right)^2\\ &= \left( n^2 + 3n + 1 \right)^2,\\ \end{align*}

having essentially substituted $k = n + \frac{1}{n}$ and used $k^2 - 2 = n^2 + \frac{1}{n^2}$.

-

There's another approach: check that for, say $n=\pm 1,\, 0,\,\pm 2$ your polynomial is a perfect square:$$\begin{cases}25,&n=1\\1,&n=-1\\1,&n=0\\1,&n=-2\\121,&n=2.\end{cases}$$ Therefore, in five points a polynomial of fourth degree is a perfect square - you can hope to find a polynomial of the second degree that satisfies $$\begin{cases}\pm 5,&n=1\\\pm 1,&n=-1\\\pm 1,&n=0\\\pm 1,&n=-2\\\pm 11,&n=2\end{cases}.$$

This is an overdetermined system, but, lickily, it has a solution: wlog, we take the candidate as $n^2+2bn+c$ (because of the coefficient at $n^4$). The value in $n=-1$ gives $1-2b+c = \pm 1$, and in $n=0$ $c=\pm 1$. By checking $4$ solutions of the obtained $4$ linear systems we can eliminate all but one by testing against remaining points $n$: we obtain $c=1$, $b=3/2$. Finally we check that indeed $(n^2+3n+1)^2=n^4+6n^3+11n^2+6n+1$.

-

Just to add an alternative: From an algorithmic point of view (i.e., to write a program that performs factorization without any intelligence guiding the process), one of the fastest things to check and therefore typically the first step is squarefree factorization, by taking gcds of the polynomial and its derivative(s).

$$\begin{eqnarray*} f&=&n^4+6n^3+11n^2+6n+1\\ f'&=& 4n^3+18n^2+22+6\\ \gcd(f,f')&=& n^2+3n+1 \end{eqnarray*}$$

Of course, working by hand and with a human brain behind it, the cost analysis may be different from that for a computer and computing gcds may not be as attractive as it is for machines.

-
Right, in this case the GCD of the polynomial and its formal derivative gives the complete irreducible factorization. More generally it identifies any repeated factors quickly. – hardmath Feb 21 '14 at 13:10

we can reorganize the terms of $n^4+6n^3+11n^2+6n+1$ like $$(n^4+2n^2+1)+(6n^3+6n)+9n^2$$ $$(n^2+1)^2+6n(n^2+1)+(3n)^2=(n^2+3n+1)^2$$ then we are done

-