How to simplify a polynomial expression? Let's say I have a polynomial expression as:

$2 - 3x + x^3 $

How do I simplify the above expression to:

$(1 - x)^2(2 + x)$

 A: By computing the roots (if possible). If the roots of a monic polynomial $p(x)$ of degree $n$ are $r_1,\ldots,r_n$, then $p(x)=(x-r_1)\ldots(x-r_n)$.
In your case, you only have two roots, $1$ and $-2$. So, compute $\frac{x^3-3x+2}{(x-1)(x+2)}$.
A: First, try to find a zero of the polynomial. You can directly check that $1$ is a zero. Then use polynomial division to get
$$
x^3-3x+2=(x-1)(x^2+x-2).
$$
For the quadratic polynomial you can use a formula to get the zeros $1$ and $-2$. Hence, you get
$$
x^2+x-2=(x-1)(x+2).
$$
Finally,
$$
x^3-3x+2=(x-1)(x-1)(x+2)=(x-1)^2(x+2).
$$
A: In this case where you know the ending expression, you can add-and-subtract in such a way that forces terms of the final expression to appear. For example, to force $2+x$ to appear, we have:
\begin{align*}
2-3x+x^3&=2+\color{red}{x}-\color{red}{x}-3x+x^3\\
&=2+x-4x+x^3\\
&=2+x-4x-\color{red}{2x^2}+\color{red}{2x^2}+x^3\\
&=(2+x)-2x(2+x)+x^2(2+x)\\
&=(2+x)(1-2x+x^2).
\end{align*}
Each time $\color{red}{\text{add}}$-and-$\color{red}{\text{subtract}}$ happens, it does so in a way to induce $x+2$ to happen. Now you can do the same to $1-2x+x^2$ to make $1-x$ appear:
$$
1-2x+x^2=1-\color{red}{x}+\color{red}{x}-2x+x^2=1-x-x+x^2=(1-x)-x(1-x)=\ldots
$$
How does one know $2+x$ is a factor of $2-3x+x^3$? In general, $px+q$ with $p\neq 0$ is factor of a polynomial $P(x)$ iff $-\frac{q}{p}$ is a root of $P(x)$. And to find such $p$ and $q$, you can refer to the Rational root theorem.
