# How to factor $1 - 3x + x^2 + x^3$?

By inspection, I can see that one of the roots is $$1$$.

So we can write

$$1 - 3x + x^2 + x^3 = (x - 1)f_2(x)$$

where $$f_n(x)$$ is an n-th order polynomial. I haven't used long division for polynomials in ages, but I feel like that might be overcomplicating things and there might be an easier way to determine $$f_2(x)$$. Is there an obvious approach to getting $$f_2(x)$$ here?

I tried some guess and checking to obtain it. I know that the quadratic term in $$f_2(x)$$ must have a coefficient of $$1$$, since the coefficient of $$x^3$$ is $$1$$. So $$f_2(x) = x^2 + f_{1}(x)$$. Now $$f_{1}(x)$$ is some affine equation. I know that $$f_{1}(x)$$ must have the constant $$-1$$ since we have a constant $$1$$ in the cubic and $$(x-1)$$, so we know that $$f_2(x) = x^2 - 1 + f_a(n-1)$$, where $$f_a(x)$$ is some linear equation that goes through the origin.

Now I checked $$(x-1)(x^2 - 1) = x^3 - x^2 - x + 1$$. When we compare this with the original cubic, we see that we're off by $$2x^2 - 2x$$. So this prompted me to use $$f_a(x) = 2x$$. So we have

$$f_2(x) = x^2 + 2x - 1$$ and this checks out.

This procedure that I used was just kind of just guess and checking.

• You wrote the letter $n$ a lot where you should have been writing $x$. Also, you mean $f(x-1)$ is an affine function, not "equation." And no, $f(x-1)$ is just as quadratic as $f(x)$ is. – runway44 Sep 10 at 4:40
• @runway44 I'm really just using $n$ here to represent the order of the polynomial. I probably should've just used it as a subscript. – David Sep 10 at 4:41
• en.wikipedia.org/wiki/Synthetic_division – copper.hat Sep 10 at 4:42

Set $$x=0$$ in $$1 - 3x + x^2 + x^3 = (x - 1)(x^2+ax+b)$$ and you get $$b=-1$$.
Taking the derivative on both sides, you have $$-3+2x+3x^2=(x-1)(2x+a)+x^2+ax-1.$$ Set $$x=0$$ in the above equation and you get $$a=2$$.
One method to factor it is to check whether it can be separated into several parts that have a common factor. In this case, we can separate $$x^3+x^2-3x+1$$ into $$x^3-x$$ and $$x^2-2x+1$$. Since $$x^3-x=x(x^2-1)=x(x-1)(x+1)$$ and $$x^2-2x+1=(x-1)^2$$, the 2 parts have a common factor of $$(x-1)$$ and can be factored out. Thus, $$x^3+x^2-3x+1=x^3-x+x^2-2x+1=x(x-1)(x+1)+(x-1)^2=(x-1)(x(x+1)+(x-1))=(x-1)(x^2+2x-1)$$.