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

  • Thread starter scottlangendy
  • Start date
  • Tags
    Roots
In summary, the conversation is about a person working on a computer application to compute the roots of a quartic equation using Ferrari's method. However, they have encountered some exceptions where incorrect results are returned for certain equations. They have tried using other online root calculators and have found similar results. The person is seeking insight on why this is happening and mentions the need to take into account special cases. Another person suggests using Sturm sequence and Newton's method for better precision. The conversation then shifts to a different topic about determining eigenvalues for an earthquake engineering problem using matrices.
  • #1
scottlangendy
2
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
  • #2
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: [tex] x=1.20784 [/tex] or [tex] x=1.56122-0.165428 i [/tex] or [tex] x=1.56122+0.165428 i[/tex] or [tex] x=1.9146 [/tex] , 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: 541
Last edited:
  • #3
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 
  • #7
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
 

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

1. What is a quartic equation?

A quartic equation is a polynomial equation of degree four, meaning the highest power of the variable is four. It is written in the form ax^4 + bx^3 + cx^2 + dx + e = 0, where a, b, c, d, and e are constants.

2. How do you find the roots of a quartic equation?

The roots of a quartic equation can be found by using the quadratic formula, which gives two solutions, and then using the cubic formula to find the remaining two solutions. Alternatively, the quartic equation can be factored into two quadratic equations and the roots can be found using the quadratic formula.

3. Can a quartic equation have complex roots?

Yes, a quartic equation can have complex roots. In fact, a quartic equation can have up to four complex roots.

4. What is the relationship between the coefficients and roots of a quartic equation?

The coefficients of a quartic equation determine the behavior of the graph and the number of real and complex roots. For example, if the coefficient of the x^4 term is positive, the graph will have a "U" shape and the equation will have either four real roots or two real and two complex roots.

5. How are quartic equations used in real life?

Quartic equations have many real-life applications, including in physics, engineering, and economics. They can be used to model projectile motion, determine the maximum profit in a business, or calculate the trajectory of a satellite. Additionally, quartic equations are used in computer graphics to create smooth curves and surfaces.

Similar threads

Replies
4
Views
1K
Replies
13
Views
3K
Replies
1
Views
983
Replies
2
Views
1K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
18
Views
4K
Back
Top