# Solving a 6th degree polynomial equation

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).

• Best approximation method would be to use Newtons method with initial guess in your range since you can't solve a degree 6 polynomial with radicals Apr 29 '16 at 16:53
• @Dan You can solve some sextic polynomials in radicals, and this is such an example. Apr 29 '16 at 16:53
• You can factor out $(x+1)$, and split the rest into an irreducible quadratic and a cubic. For the cubic, there are formulas, and one of the roots of the cubic is what you seek. Apr 29 '16 at 16:54
• Right I should say in general next time Apr 29 '16 at 16:54
• This one can be factorized into two cubics by pure observation. Notice the left half of the coefficients looks like the right half, we have \begin{align} & -x^6+x^5+2x^4-2x^3+x^2+2x-1\\= & (-x^6+x^5+2x^4-x^3)+(-x^3+x^2+2x-1) \\= & (x^3+1)(-x^3+x^2+2x-1)\end{align} Apr 29 '16 at 17:16

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.

• thank you for your help. I would not have been able to factorise this equation. what method do you use to factorise the quintic into the quadratic and cubic? Apr 29 '16 at 17:06
• I used a CAS, but this can really be done by hand: Since the leading and tailing terms of the quintic are both $1$, any factorization over $\Bbb Q$ must have the form $(x^2 + A x \pm 1)(x^3 + B x^2 + Cx \pm 1)$ (taking the same choice for $\pm$ in both instances). Expanding and comparing coefficients with the quintic gives a system of equations in $A, B, C$. For example, comparing the coefficients of $x^4$ gives $A + C = 2$, which immediately reduces the system to two variables. Comparing the other few coefficients quickly leads to values for those. Apr 29 '16 at 17:12

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{\frac{1}{2} \left(-1+3 \mathrm{i} \sqrt{3}\right)}}+\sqrt{\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{-1+3 \mathrm{i} \sqrt{3}}}-\frac{1}{6} \left(1-\mathrm{i} \sqrt{3}\right) \sqrt{\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{-1+3 \mathrm{i} \sqrt{3}}}-\frac{1}{6} \left(1+\mathrm{i} \sqrt{3}\right) \sqrt{\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.

• Does Mathematica directly output these surd expressions? Apr 30 '16 at 0:46
• @FaheemMitha : Yes. It also translates them to TeX and hence (essentially) to MathJax. I tend to modify them a bit -- for instance $\mathrm{i}$ is a constant and should be upright, just like $1$ and $2$. Apr 30 '16 at 7:40
• Hi Eric. Ok. Well, that's pretty impressive. Apr 30 '16 at 7:47
• thank you for posting an answer with the result as a radical, which is what I needed. The problem, by the way, was to find the short diagonal (connecting the far vertices of two adjacent edges) of a regular heptagon with side length 1, without using trigonometry. The way I solved it was by using a system of 5 simultaneous equations, which resulted in this sextic. There may have been a more simple solution, and if you find one I would be very grateful. Apr 30 '16 at 7:51
• @stanleydodds : It's $\sqrt{\frac{1+\frac{1}{2} i \left(e^{-\frac{i \pi }{14}}-e^{\frac{\mathrm{i} \pi }{14}}\right)}{1-\frac{1}{2} i \left(e^{-\frac{3 i \pi }{14}}-e^{\frac{3 \mathrm{i} \pi }{14}}\right)}}$. I just got this from the $7^\text{th}$ roots of $1$ expressed as $\mathrm{e}^{2\pi \mathrm{i} k/7}$ as $k$ ranges from $0$ to $6$. Apr 30 '16 at 8:02

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$$

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