Solving the QuarticDate: 05/27/98 at 23:10:32 From: Brian C. Subject: Solving quartic equations directly Do you have any pointers to a page that shows how to solve Quartic equations directly? I didn't have much trouble with the Cubic equations, and I'm hoping to be able to use it to add Quartic Splines to my realtime raytracer (computationally, as for 3rd/2nd degree, direct methods should be faster than doing Newton Raphson right?). Brian Cowan Date: 05/28/98 at 13:40:13 From: Doctor Rob Subject: Re: Solving quartic equations directly For a full discussion of quartic equations, see the Dr. Math FAQ: http://mathforum.org/dr.math/faq/faq.cubic.equations.html I like this method to solve quartic equations. Divide by the leading coefficient, to make it of the form: x^4 + a*x^3 + b*x^2 + c*x + d = 0 Substitute x = y - a/4, expand and simplify, to get: y^4 + e*y^2 + f*y + g = 0 where: e = b - 3*a^2/8 f = c + a^3/8 - a*b/2 g = d - 3*a^4/256 + a^2*b/16 - a*c/4 This must factor into two quadratics with real coefficients, since any complex roots must occur in conjugate pairs. Write: y^4 + e*y^2 + f*y + g = (y^2 + h*y + j)*(y^2 - h*y + g/j) Without loss of generality, we can assume h > 0 (otherwise swap the two factors). Then, equating coefficients of y^2 and y: e = g/j + j - h^2 f = h*(g/j - j) so: g/j + j = e + h^2 g/j - j = f/h Adding and subtracting these two equations: 2*g/j = e + h^2 + f/h 2*j = e + h^2 - f/h Multiplying these together: 4*g = e^2 + 2*e*h^2 + h^4 - f^2/h^2 Rearranging: h^6 + 2*e*h^4 + (e^2-4*g)*h^2 - f^2 = 0 This is a cubic equation in h^2, with known coefficients, since we know e, f, and g. We can use the solution of the cubic equation to find a positive real value of h^2, whose existence is guaranteed by Descartes' Rule of Signs, and then take its positive square root. This value of h will give a value of j from 2*j = e - h^2 - f/h. Once you know h and j, you know the quadratic factors of the quartic in y. Once you have factored the quartic into two quadratics, finishing the finding of the roots is simple, using the Quadratic Formula. Once the roots y are found, the corresponding x's are gotten from x = y - a/4. EXAMPLE 1: Find the roots of x^4 + 6*x^3 - 5*x^2 - 10*x - 3 = 0. Set x = y - 3/2, substitute and expand: y^4 + (-37/2)*y^2 + 32*y + (-231/16) e = -37/2, f = 32, g = -231/16 h^6 + (-13)*h^4 + 46*h^2 - 1 = 0 Solving this cubic in h^2, we find the only real root is: h^2 = [13-cbrt(31*[31-3*sqrt(93)]/2)-cbrt(31*[31+3*sqrt(93)]/2)]/3 and h is the positive square root of this quantity. Approximately: h^2 = 0.0218741248 h = 0.1478990357 j = (e + h^2 - f/h)/2 j = 0.1416217140 The exact expressions for j and g/j are too complicated for me to want to write down explicitly. Then the approximate factorization is: (y^2 + 0.1478990357*y + 0.1416217140) * (y^2 - 0.1478990357*y - 6.6197475893) or: (x^2 + 3.1468990357*x + 2.6134702676)* (x^2 + 2.8521009643x - 4.5915961433) From here the rest is easy: x = -4, x = 1.1478990357, and x = -1.5739495179 +/- 0.3689894075*i are the four approximate roots of the original equation. Incidentally, the exact expression for the irrational real root is: x = [-4+cbrt(4*[47-3*sqrt(93)])+cbrt(4*[47+3*sqrt(93)])]/6 EXAMPLE 2: Find the roots of x^4 + 6*x^3 + 7*x^2 - 7*x - 12 = 0. Set x = y - 3/2, substitute and expand. y^4 + (-13/2)*y^2 + (-1)*y + (-15/16) e = -13/2, f = -1, g = -15/16 h^6 + (-37)*h^4 + 400*h^2 - 1024 = 0 Solving this cubic in h^2, we find: h^2 = 16, h^2 = (21 + sqrt[185])/2, h^2 = (21 - sqrt[185])/2. We only need one of these, so we pick h^2 = 16, so: h = 4 j = (e + h^2 - f/h)/2 j = -21/4 and one factorization is: (y^2 + 4*y - 21/4) * (y^2 - 4*y + 11/4) or: (x^2 + 7*x + 3) * (x^2 - x - 1) From here the rest is easy, and: x = (-7 +- sqrt[37])/2, x = (1 +- sqrt[5])/2, are the four roots of the original equation. -Doctor Rob, The Math Forum http://mathforum.org/dr.math/ Date: 07/22/99 at 12:24:38 From: Dan Collins Subject: Quartics Hi - Compliments on the Web site, I've found it to be of use to me recently. Near the beginning of the above answer, when substituting to produce a "reduced quartic," there's a degenerate case when (f = 0). If this occurs, the quartic has nicely reduced itself to a quadratic in (y^2) which can be easily solved by the quadratic formula (followed by simple factoring, solving each factor for 2 roots, and then re-substituting for all four solutions). However, the rest of the solution shown is then inappropriate - most clearly when the whole thing reduces to (y^4), at which point the only solution to the associated cubic is (h^2 = 0), despite the necessity of a "positive real value of h^2" thereafter (i.e., you have to take the square root and divide by it near the end). Realizing this actually abbreviates the process in a few ways; in particular, after we pass the degenerate case and have to solve the associated cubic, it looks as if the first solution of the cubic formula at http://mathforum.org/dr.math/faq/faq.cubic.equations.html always suffices for (h^2) - that is, there's no need to generate all three solutions to the associated cubic. Thanks for your attention, Daniel R. Collins (M.A. Mathematics University of Maine 1995) |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/