Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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!

share|cite|improve this question
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
up vote 30 down vote accepted

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.

share|cite|improve this answer
+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


and then take its square root:


which suggests the (correct) factorization


If you want to be extra sure, look at


share|cite|improve this answer
+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}$.

share|cite|improve this answer

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 $.

share|cite|improve this answer

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.

share|cite|improve this answer
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

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.