What is the Problem with Calculating Roots of a Quartic Equation?

  • Thread starter Thread starter scottlangendy
  • Start date Start date
  • Tags Tags
    Roots
AI Thread Summary
Calculating roots of quartic equations using Ferrari's method can lead to inaccuracies, especially when the equation has only two real roots. The discussion highlights a specific example where the computed roots differ significantly from the actual roots found through graphing and other calculators. Users suggest that precision issues may arise due to the significant digits in the coefficients, recommending the use of extended precision in calculations. Alternatives like Sturm sequences and Newton's method are proposed for more robust solutions. The need for a dynamic and accurate programmatic approach to calculate roots for any quartic equation is emphasized.
scottlangendy
Messages
2
Reaction score
0
Hey guys,

I've been working on this computer application, and ended up needing to compute the roots of a quartic equation. So I implemented Ferrari's method and the results for the most part are working, however I've come across a few exceptions where I'm getting incorrect results.

For example if I try and calculate the roots for this equation:

y = 0.9604000000000001x^4 - 5.997600000000001x^3 + 13.951750054511718x^2 - 14.326264455924333x + 5.474214401412618

It returns the following roots:
1.7820304835380467 + 0i
1.34041662585388 + 0i
1.3404185025061823 + 0i
1.7820323472855648 + 0i

When I graph the equation with a graphing calculator, I find that these are actually incorrect, and the real roots are actually closer to 1.2 and 2.9 (approximately).

The results its returning aren't totally random, they actually seem to be the results of the equations first derivative.

I tried out a bunch of root calculators online (I presume they are using the same method) and they returned the same results, so I'm pretty certain I've implemented the formula correcting.

This only seems to happen when the quartic has only two real roots, so I'm under the impression that I'm ignoring some sort of special case!

Can anyone offer me any insight as to why this is happening?
 
Mathematics news on Phys.org
I am not at all an expert on quadratic functions, but i will just input what mathematica (you could also check this at wolfram alpha) has given as a result: x=1.20784 or x=1.56122-0.165428 i or x=1.56122+0.165428 i or x=1.9146 , which if then we use the plot we can see that the intersects are marked on the graph, which looks like the two end results (1.207 and 1.9146).
Hope that helps :)
 

Attachments

  • MSP6219b0ed30a007362h0000614daadb11dih517.gif
    MSP6219b0ed30a007362h0000614daadb11dih517.gif
    3.4 KB · Views: 574
Last edited:
The issue isn't so much as finding the roots for a specific quartic equation, its that I need to be able to dynamically calculate it programatically, for any quartic equation . Like I said I'm using Ferrari's solution http://en.wikipedia.org/wiki/Quartic_function#Ferrari.27s_solution. But I'm under the impression that I need to take into account some sort of special case, to get rid of the incorrect roots that I'm calculating in certain cases.
 
Many years ago I had to design a computer program involving solving a fourth degree equation. I found that they are serious precision related problems using Ferrari's method. I ended up using Sturm sequence and Newton's method (for real roots). This is much more robust.
 
scottlangendy said:
y = 0.9604000000000001x^4 - 5.997600000000001x^3 + 13.951750054511718x^2 - 14.326264455924333x + 5.474214401412618

Along the lines of mathman's comment, I noticed your stated problem had 16 significant digits for the coefficients. If that number of significant digits is important, then precision/roundoff might hurt you. I entered the numbers into Excel and it truncated the numbers (a handheld calculator would be worse).

You might try using extended precision with your program if you can.
 
hi
please help me with this problem from my earthquake engineering subject in determining eigenvalues
[K]-w2[M]=0

where:
K=[ 654.7 -327.35 0 0
-327.35 654.7 -327.35 0
0 -327.35 654.7 -327.35
0 0 -327.35 327.35]

and

M = [1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1]

then solve for w2

note : K - stiffness in matrix
M - mass in matrix also
 
Back
Top