I have a polynomial equation that arose from a problem I was solving. The equation is as follows:
$$-x^6+x^5+2x^4-2x^3+x^2+2x-1=0 .$$
I need to find $x$, and specifically there should be a real value where $\sqrt3<x<\sqrt{2+\sqrt2}$, in accordance to the problem I am solving. I know that it would be possible for me to find approximations of the roots of the equation, but I would prefer to know the exact value of this specific root (i.e. with the answer as a surd, with nested surds if required). I am unable to do this as I do not know any method of solving polynomials of degree $> 4$.
If this cannot be done, could you tell me an approximate decimal value of $x$, or at least check that a solution exists within the range I have given (it is possible that I made an error earlier in my algebra).
$\endgroup$ 115 Answers
$\begingroup$The Rational Root Test shows that the only possible rational solutions are $\pm 1$. Substituting gives that $x = -1$ is one (but $x = 1$ is not), so polynomial long division gives $p(x) = -(x + 1) q(x)$ for some quintic $q$. Substituting $x = -1$ gives that $-1$ is not a root of $q$, so if $q$ factors over $\Bbb Q$, it does so into an irreducible quadratic and an irreducible cubic. One can find such a factorization without too much effort (this is made easier by the fact that the leading and constant coefficients are both $1$): We get $$p(x) = -(x + 1)\underbrace{(x^2 - x + 1)(x^3 - x^2 - 2 x + 1)}_{q(x)} .$$ The discriminant of the quadratic is $-3 < 0$, so the real root you've identified must be a factor of the cubic; since the cubic has no rational roots, one needs to use Cardano's Formula or the equivalent to extract it.
$\endgroup$ 2 $\begingroup$Using a complicated computer algebra system (Mathematica 10.4), we can get all the roots to this equation as radicals. Two roots are complex and the rest are all real (surprisingly).
Module[{roots}, roots = Solve[-x^6 + x^5 + 2 x^4 - 2 x^3 + x^2 + 2 x - 1 == 0, x]; Transpose[{ N[x /. roots], FullSimplify[Element[x, Reals] /. roots], x /. roots }]
] // TableForm- There are two complex roots at $\frac{1}{2} \pm \mathrm{i}\sqrt{3}$.
- There is a real root at $-1$.
- The other three are complicated and real: \begin{align} 1.80194\dots{} &= \frac{1}{3} \left(1+\frac{7^{2/3}}{\sqrt[3]{\frac{1}{2} \left(-1+3 \mathrm{i} \sqrt{3}\right)}}+\sqrt[3]{\frac{7}{2} \left(-1+3 \mathrm{i} \sqrt{3}\right)}\right), \\ -1.24698\dots{} &= \frac{1}{3}-\frac{7^{2/3} \left(1+\mathrm{i} \sqrt{3}\right)}{3\ 2^{2/3} \sqrt[3]{-1+3 \mathrm{i} \sqrt{3}}}-\frac{1}{6} \left(1-\mathrm{i} \sqrt{3}\right) \sqrt[3]{\frac{7}{2} \left(-1+3 \mathrm{i} \sqrt{3}\right)}, \\ 0.445042\dots{} &= \frac{1}{3}-\frac{7^{2/3} \left(1-\mathrm{i} \sqrt{3}\right)}{3\ 2^{2/3} \sqrt[3]{-1+3 \mathrm{i} \sqrt{3}}}-\frac{1}{6} \left(1+\mathrm{i} \sqrt{3}\right) \sqrt[3]{\frac{7}{2} \left(-1+3 \mathrm{i} \sqrt{3}\right)} \text{.} \end{align}
Conveniently, the first one is in the interval you require.
These three complicated roots are the roots of the same polynomial @Travis gets.
Looking at the Galois group structure, I believe we cannot dispense with complex numbers in these expressions.
$\endgroup$ 5 $\begingroup$Solving this equation with free CAS Maxima:
If you use the trigonometric solution for three real roots, the solutions of $$-x^3+x^2+2 x-1=0$$ are given by$$x_k=\frac{1}{3}+\frac{2\sqrt{7}}{3} \cos \left(\frac{2 \pi k}{3}-\frac{1}{3} \cos ^{-1}\left(-\frac{1}{2 \sqrt{7}}\right)\right) \qquad \text{with}\qquad k=0,1,2$$The root you look for is $x_0$ which can also write$$x_0=\frac{1}{3} \left(1+2 \sqrt{7} \cos \left(\frac{1}{3} \sec ^{-1}\left(-2 \sqrt{7}\right)\right)\right)\approx 1.80194$$
$\endgroup$ $\begingroup$In some cases, such polynomials can only be 'solved' by numerical approximations, and Newton's method is one Historically famous method. The LaGuerre and the Muller method are also well-known. But I have recently completed a project to design a custom method, which resulted in my writing actual C++ code. I would be willing to share my code with the community, by linking to one blog posting:
Link to a descriptive blog posting
This could save the O.P. the trouble, of turning Newton's Method into an actual implementation.
Fortunately however, I see that the example has effectively been factorized by the CAS mentioned in other answers, into the product between 2 cubics, one of which would be:
$$(x^{3} + 1)$$
I am inferring this, because the very algorithm which I wrote and just recommended, shows this as the solution-set:
dirk@Klystron:~$ poly_solve -1 1 2 -2 1 2 -1
-1 + 0I
0.44504186791263 + 0I
0.5 + 0.86602540378444I
0.5 + -0.86602540378444I
-1.2469796037175 + 0I
1.8019377358048 + 0I
dirk@Klystron:~$ The two conjugate, complex roots form a subset to the solution set, with the (-1), to form:
$${x}\in{{(-1)}^{\frac{1}{3}}}$$$$x^{3}=-1$$$$(x^{3}+1)=0$$
There are certain cases in which an Algebraically exact answer can be found, such as this polynomial, without using the general solution. And this can be fortunate, because while a cubic still has a general solution, a polynomial of the 6th degree does not.
I should also observe, that the following expression:
$$(x + 1)(x^2 - x + 1)$$
Equally expands to:
$$(x^3 + 1)$$
Dirk
$\endgroup$ 0