<s>[INST] How to find the number of real roots for a polynomial? How can you find of real roots for $P(x) = x^4 - 4x^3 + 4x^2 - 10$?
Using the Descartes' rule of signs:
The polynomial $P(x) = x^4 - 4x^3 + 4x^2 - 10$ has three sign changes between the first, second, third and fourth terms (the sequence of pairs of successive signs is +, −, +, -), therefore it has exactly three positive roots.
The polynomial $P(-x) = x^4 + 4x^3 + 4x^2 - 10$ has one sign change between the third and fourth terms (the sequence of pairs of successive signs is +++, -), therefore it has exactly one negative root.
Finally, summing up, the polynomial $P(x) = x^4 + 4x^3 + 4x^2 - 10$ has four real roots.
However, the actual answer is two real roots. How can you find this answer and what is wrong with my implementation of the Descartes' rule of signs?
 [/INST] Let $\>x=t+1\>$ then
$$
\\P(x)=P(t+1)=(t+1)^4-4(t+1)^3+4(t+1)^2-10=
\\=(t^4+4t^3+6t^2+4t+1)-(4t^3+12t^2+12t+4)+(4t^2+8t+4)-10=
\\=t^4-2t^2-9
\\P(t+1)=0=>t^4-2t^2-9=0=>
$$
if $\>x\>$ is real then $\>t\>$ is real =>
$$
\\t^2=\dfrac{2+\sqrt{40}}{2}=1+\sqrt{10}
$$
Answer $\>x=1+\sqrt{1+\sqrt{10}}\>$ or $\>x=1-\sqrt{1+\sqrt{10}}\>$
</s>