# Need help solving $x^4-3x^3-11x^2+3x+10=0$

Solve $x^4-3x^3-11x^2+3x+10=0$

I have tried to solve this equation using 'general formula from roots' from https://en.wikipedia.org/wiki/Quartic_function.

$$ax^4+bx^3+cx^2+dx+e=0$$

$$x_{1,2}=-\frac b{4a}-S \pm 0.5\sqrt{-4S^2-2P+ \frac q S}$$

$$x_{3,4}=-\frac b{4a} + S \pm 0.5\sqrt{-4S^2-2P-\frac q S}$$

$$p=\frac{8ac-3b^2}{8a^2}$$

$$q= \frac{b^3-4abc+8a^2d}{8a^3}$$

$$S=0.5\sqrt{-\frac{2p} 3 + \frac{Q+\Delta_0} Q}{3a}$$

$$Q=\left(\Delta_1+\sqrt{\Delta_1^2-4\Delta_0^3} \cdot 0.5\right)^{1/3}$$

$$\Delta_0=c^2-3bd+12ae$$

$$\Delta_1=2c^3-9bcd+27eb^2+27ad^2-72ace$$

Those formula does not work. I ended up with complex roots.

Please help me to use those formulas to solve quartic equation. Any help will be very much appreciated.

• Please format using MathJax. It makes reading your question much easier. :) Here is a tutorial: meta.math.stackexchange.com/questions/5020/… – M47145 May 22 '16 at 23:18
• Always start by checking rational roots:). – user175968 May 22 '16 at 23:35
• You say one of the solutions of $x^4-3x^3-11x^2+3x+10=0$ is $2$. Let's try it: $$\overbrace{2^4 -3\cdot2^3 - 11\cdot2^2 + 3\cdot2 + 10} = 16 - 24 - 44 + 6 + 10 = -36 \ne 0.$$ – Michael Hardy May 22 '16 at 23:36
• If you want the roots to be $1$, $2$, $3$, and $4$ then you should have $$(x-1)(x-2)(x-3)(x-4).$$Expanding this, I get $$x^4 -10x^3 + 35x^2 - 50x + 24.$$I checked this by substitution of all four numbers, as in my comment above, and in each case the sum $\text{is }0$. $\qquad$ – Michael Hardy May 22 '16 at 23:42

I coded up the formula in the Wikipedia page and got the right results. Perhaps you made a mistake in your program. The intermediate values, using Wikipedia's variable names, are:

$p = -14.375$

$q = -16.875$

$\Delta_0 = 268$

$\Delta_1 = 7040$

$\sqrt{\Delta_1^2 - 4\Delta_0^3} = 5237.721642i$

$Q^3 = 3520 + 2618.860821i$

$Q = 16 + 3.464102i$

$S = 2.25$

$x = \{ -1, -2, 5, 1 \}$

Of course, in complex numbers there are three possible cube roots for $Q^3$. I tried all three and it gave the same roots $x_n$ in a different order .. surprising but pleasing :)

Taking the other square root in the above list results in $Q$ being conjugated, and $S$ stays the same.

• you are right. I was wrong solving complex numbers. – sam May 23 '16 at 21:49
• What language did you write the code for solving four degree equation? – sam Jun 15 '16 at 21:54
• @SadiaF I used C (which has native complex number handling) – M.M Jun 15 '16 at 21:59
• Thanks for your reply @M.M. I am trying to write code using FORTRAN and facing problem while dealing with complex number! If possible, I really like to check you C code. – sam Jun 15 '16 at 22:12

One can check that $1$ and $-1$ are both roots of this polynomial. After factoring out $x-1$ and $x+1$, you're left with a quadratic polynomial.

As a general rule, the rational root theorem is a good place to start for questions like these.

• I want to use the general equation of the roots for quartic function/formulas directly. – sam May 22 '16 at 23:26
• May I ask why? It's nice to know that a quartic formula exists, but in practice it seems better to make an educated guess, or use Newton's method. – carmichael561 May 22 '16 at 23:32
• it's much easier if I can use the direct formula to my FORTRAN program to find the roots. – sam May 22 '16 at 23:34
• Do you think the equation of Q (please check the wiki link) is wrong? If I replace the square root with cubic root, I get my roots correctly. – sam May 22 '16 at 23:40
• I don't know. If you really want to use the quartic formula, I guess you could work through the derivation outlined on the Wikipedia page and see what you get. – carmichael561 May 22 '16 at 23:45

We have

$$x^4-3x^3-11x^2+3x+10$$

Using rational root test:

$$(x-1)(x^3-2x^2-13x-10)$$

And rational root test again:

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

$$(x-1)(x+1)(x-5)(x+2)$$
Thus, roots are $x=\pm1,\; x=-2,\; x=5$.
$$x^4 - 3x^3 - 11x^2 + 3x + 10 = 0$$ $$x^4 - 3x^3 - 10x^2 - x^2 + 3x + 10 = 0$$ $$x^2(x^2 - 3x - 10) - (x^2 - 3x - 10) = 0$$ $$(x^2 - 1)(x^2 - 3x - 10) = 0$$ $$(x - 1)(x + 1)(x - 5)(x + 2) = 0$$ $$x = \{1,-1,5,2\}$$