# Factoring $x^7+3x^6+9x^5+27x^4+81x^3+243x^2+729x+2187$

Question: How would you factor$$P(x)=x^7+3x^6+9x^5+27x^4+81x^3+243x^2+729x+2187$$

I thought for a while and realized that the coefficients are in powers of $3$, so $x=-3$ is a factor. Taking that factor out, we see that the septic is equal to$$P=(x+3)(x^2+9)(x^4+81)$$I'm wondering, however, if there is a quicker way to factor it because the original method was pretty tedious.

• Don't overlook the quartic, which can be factored further even though it has no roots. Dec 26, 2017 at 8:27
• @YoungFrog You mean $\left(x^2+3x\sqrt2+9\right)\left(x^2-3x\sqrt2+9\right)$? Dec 26, 2017 at 16:52
• yes that is it. Dec 26, 2017 at 19:43

$$\frac{P(x)}{3^7}=\sum_{k=0}^7\left(\frac{x}{3}\right)^k=\frac{\left(\frac{x}{3}\right)^8-1}{\frac{x}{3}-1}$$

For the sake of an alternative, less clever approach: pretending to not notice the pattern of increasing powers of $3$, the root $x=-3$ can also be found by brute force using the rational root theorem. Quite obviously, the polynomial has no positive roots, so it's enough to try the negative divisors of $2187=3^7$, which finds $-3$ pretty quickly.

Then, dividing by the factor of $x+3$ using (for example) polynomial long division gives:

$$P(x)=(x+3)(x^6 + 9 x^4 + 81 x^2 + 729)$$

The sextic that remains to be factored is a cubic in $y=x^2$:

$$Q(y) = y^3+9y^2+81y+729$$

Using the rational root theorem again, $y=-9$ is a root, then dividing by $y+9$ gives:

$$Q(y) = (y+9)(y^2+81)$$

So in the end $P(x)=(x+3)Q(x^2)=(x+3)(x^2+9)(x^4+81)\,$.

• +1 But isn't this the original approach from the OP?
– Ant
Dec 26, 2017 at 9:51
• @Ant Don't think it's the same. The OP wrote: I thought for a while and realized that the coefficients are in powers of 3, so x=−3 is a factor. It is not entirely clear how the so x=−3 is a factor step followed, but anyway the approach in my answer could be used to factor $\,x^7 + 2 x^6 + 4 x^5 + 8 x^4 + 5 x^3 + 10 x^2 + 20 x + 40$ $=(x+2)(x^2+4)(x^4+5)\,$ for example, where the coefficients are not in powers of any one number.
– dxiv
Dec 26, 2017 at 18:18

$$P(X)=x^7+3x^6+3^2x^5+3^3x^4+3^4x^3+3^5x^2+3^6x+3^7=\frac{x^8-3^8}{x-3}\\=\frac{(x^4-3^4)(x^4+3^4)}{x-3}=\frac{(x^2-3^2)(x^2+3^2)(x^4+3^4)}{x-3}=\frac{(x-3)(x+3)(x^2+3^2)(x^4+3^4)}{x-3}$$

• @XanderHenderson ty, fixed Dec 26, 2017 at 5:22

It is known that $$a^n-b^n=(a-b)(a^{n-1}+a^{n-2}b+\ldots+ab^{n-2}+b^{n-1}).$$ Here $n=8$, $a=x$, $b=3$ and we obtain $x^8-3^8$, which is easy to factorize.