CUBIC AND QUARTIC FORMULAS James T. Smith San Francisco State University Quadratic formula You ve met the uadratic formula in algebra courses: the solution of the uadratic euation ax + bx + c = 0 with secified real coefficients a /= 0, b, and c is b b ac x =. a You can derive the formula as follows. First, divide the uadratic by a to get the euivalent euation b c x + x + = 0. a a Now substitute x = y + d. You ll choose d later so that the resulting euation is easy to solve. Making the substitution, you get b c ( y + d) + ( y + d) + = 0. a a Work this out, ignoring some details that won t be necessary: b y + dy + d y + constants = 0 a b y + d y + constants = 0. a If the y coefficient were zero, you could move the constants to the other side and solve for y by taking the suare root. Thus you can find y easily if you let d = b/(a). Do that and work out the details: the last euation dislayed above becomes b c y + = 0 a a 01-08-5 1:5
Page CUBIC & QUARTIC FORMULAS b ac y =. a The uantity D = b ac is called the discriminant of the uadratic: you can write y = ± D /(a). Finally, the desired solution is b D x = d + y = ± a a the Quadratic Formula. If D < 0 then you can write x in comlex form: b D x = d + y = ± i. a a Cubic formula It s ossible to imitate this rocess to derive a formula for solving a cubic euation ax + bx + cx + d = 0 with secified real coefficients a /= 0, b, c, and d. First, divide the cubic by a to get the euivalent euation b c d x + x + x + = 0. a a a Next, make a substitution x = y + e, and choose e so that the resulting euation is easier to solve. Exerience with the uadratic euation suggests that you might be able to make one term of the cubic disaear, so that the resulting euation is like one of these: y + fy + g = 0 y + y + = 0. Exerimentation would show that you can reach the form on the left, but it doesn t lead anywhere. However, you can also get the one on the right, and it does hel. In fact, if you let e = b/(a) that is, substitute x = y b/(a) then you get, after considerable algebraic labor, the euation where y + y + = 0, b c b bc d = + = +. a a 7a a a
CUBIC & QUARTIC FORMULAS Page You ve now reduced the roblem of solving the original cubic to one of solving y + y + = 0 and setting x = y b/(a). After centuries exerience, mathematicians found a trick to solve this simler cubic. Set y = z /(z) and consider the resulting euation. After considerable algebraic labor, it comes out to z 6 + z = 0. 7 This euation is uadratic in z. You can find z where z = ± D, D = +. 7 by using the uadratic formula: This D is called the discriminant of the cubic euation. Taking the cube root, you get D Together with the euations b y = z x = y z a. this is called the cubic formula: it shows you how to comute the solution x of the original cubic euation. Actually, the euation for z gives three comlex cube roots for each of the + and signs, hence six different formulas for z. But when you substitute these in the euation for y, at most three different y values will result, and the last euation will thus give at most three distince roots x. Look at the cubic formula in more detail. When D $ 0, you can select one of the two real suare roots ± D, then find three cube roots z = z 0, z 1, and z of / ± D as follows. Let z 0 be the real cube root, then z 1 = z 0 and z = z 0, where and are the two comlex cube roots of 1: 1 1 = + i = i. You can use simle algebra of comlex numbers to find the corresonding values y and x.
Page CUBIC & QUARTIC FORMULAS If you get z = 0 in this rocess, then (/) = D, hence = 0. In that case, you re just solving the euation y + = 0, which has one root y = 0 if = 0, and three roots y = a otherwise. In the former case, D = = = 0. If D = 0 but /= 0, then two of the y values coincide, and the euation has distinct single and double real roots. The situation is more interesting when D < 0, for then you have to find the cube roots z of the comlex number A = + D i. In this case, 0 > D = +, 7 so < 0. Next, *A* = + D = D = 7 *A* =. Now you can write A = *A*cis, where Re A cos = = =. A D is imaginary, and Given coefficients a to d, you can comute and from the revious euations, calculate cos, then determine. Now let r = A =, so that De Moivre s formula yields the three values where z = A = rcis, =, + 10E, + 0E.
CUBIC & QUARTIC FORMULAS Page 5 The details of the final calculation of y and x are interesting, too. You ll get y = z = rcis z r cis = rcis (cis) 1 = rcis cis( ) r r = r[cos + i sin] [cos( ) + i sin( )] r But = r cos + r i sin. r r r + = + = 0, r hence all three y values are real! You have y = r cos r for the three values of R given earlier. In this case, where D < 0, you ve found the real roots of a real cubic euation through use of comlex numbers and trigonometry. It s now known that some such detour through the comlex numbers is necessary to find a formula for these roots! Examle cubics 1. To solve ax + bx + cx + d = 0 with a,b,c,d =,,,1 follow the derivation of the cubic formula, setting b x = y = y a b c = + = a a 1 5 16
Page 6 CUBIC & QUARTIC FORMULAS b bc d = + = 7a a a 5 y = z = z z 8z b 1 x = y = y a 5 D = + =. 7 56 5 Since D > 0, there are one real and two conjugate comlex roots. Comute the real root as follows: 5 0 6 0.19060 z = D =.. 576 0.5650 Both z values give the same value of 5 y = z. 0.558 8z 1 x = y. 0.6058. Substituting this x value in the left-hand side of the original euation yields a value of about 1 10 6 accetable accuracy. The comlex roots are comuted from the other two cube roots: 1 z. 0.190680. 0.095115 ± 0.16508i i 5 y = z. 0.1779 ± 0.687i 8z x = y 1. 0.0708 ± 0.687i. Substituting these x values in the left-hand side of the original euation yields values with norms of about 10 i accetable accuracy.. To solve y + y + = 0 with, =,1 follow the derivation of the cubic formula, to get
CUBIC & QUARTIC FORMULAS Page 7 5 D = + =. 7 108 Since D < 0, there are three real roots, determined as follows: cos =. 0.91856. 156.716E =, + 10E, + 0E. 5.9E, 17.9E, 9.9E r = = y = r cos. 1.00000, 1.6180, 0.6180 r The first value of y suggests that y = 1 is an exact root of the cubic. That s easy to verify: in fact, y y + 1 = ( y 1)( y + y 1). The roots of the right-hand factor are ( 1 ± comuted y values. 5 )/, which agree with the other two Quartic formula Why sto with cubics? Why not aly the same method to a uartic euation ax + bx + cx + dx + e = 0 with real coefficients a /= 0, b, c, d, and e? First divide the uartic by a to obtain the euivalent euation b c d e x + x + x + x + = 0. a a a a
Page 8 CUBIC & QUARTIC FORMULAS The substitutions x = y b/(a) and x = y b/(a) worked for the uadratic and cubic; try x = y b/(a) for the uartic. After a lot of algebra, you ll get an euation of the form y + y + y + r = 0 for certain values,, and r that you can comute from the original coefficients. Not long after the trick was discovered that led to the solution of the cubic, mathematicians discovered one that leads to the solution of this uartic. Write it as y = y y r. Now maniulate this euation, using a value z that will be determined later: y + y z + z = y y r + y z + z ( y + z ) = (z )y y + (z r). Later, you ll determine z so that the right-hand side of this last euation is ( fy + g) for some articular values f and g. Then you ll have ( y + z ) = ( fy + g) y + z = ±( fy + g) y fy( z g) 0, or y fy( z g) 0. Once z then f and g are found, you can solve for y by using the uadratic formula on the last air of euations. Thus you have to find z, f, and g so that (z )y y + (z r) = ( fy + g). Consider the euations formed by setting each side of this eual to zero. The right-hand euation (fy + g) = 0 would have just one root y = g/f; thus the left-hand euation (z )y y + (z r) = 0 would have just one root also. But you can solve this euation for y by using the uadratic formula, and for that formula to yield just one root its discriminant must be zero. That is, you can find z, f, and g just when (z )(z r) = 0 8z 6 + z + 8rz + ( r) = 0 w z 8w w 8 rw( r ) 0.
CUBIC & QUARTIC FORMULAS Page 9 With sufficient labor, you can solve the last euation by using the cubic formula, getting at most three solutions w = w 0, w 1, and w. For each j, the euation (w j )y y + (w j r) = 0 has a single root y =. ( w ) Therefore, where j (w j )y y + (w j r) = (w j ) y ( wj ) = y w = ( fy + g) j, wj f = w j g =. f With these three values of f and g, solve the two uadratic euations y fy( z g) 0 y fy( z g) 0 for y. This yields as many as twelve ossible y formulas, but at most four can have distinct values. Finally, calculate the roots x = y b/(a). Examle uartic To solve ax + bx + cx + dx + e = 0 with a,b,c,d,e =,,,,, follow the uartic formula, dividing by a and setting b 1 x = y = y, a to get the euation y + y + y + r = 0, where = 15/8, = 5/8, and r = /56. Next, solve the euation 8w w 8rw + (r ) = 0 by the cubic formula, obtaining three solutions w 0. 0.91851 w 1. 0.00985 + 1.0880i w = w 1.
Page 10 CUBIC & QUARTIC FORMULAS With j = 0 comute f = w j, g =, f solve y fy + (w j g) = 0 for two values y = y 0 and y 1, and set x k = y k b/(a) for k = 0,1 to get x 0. 1.798, x 1. 1.875. Next, solve y + fy + (w j + g) = 0 for two values y = y and y, and set x k = y k b/(a) for k =, to get x. 0.787 + 0.89i, x = x. With j = 1, this rocess yields the same four roots x. Substituting these x values back in the original uartic euation yields values with norm less than 10 10 accetable accuracy. Like the cubic examles considered earlier, these roots can be exressed exactly with radicals and trigonometric functions. However, their exressions would be so comlicated that checking and using them would be imractical. History In 1505 Sciione de Ferro (165 156), Professor of Mathematics at Bologna, discovered a method for solving certain cubic euations, but didn t ublicize it beyond his students, referring to use it secretly to establish himself as a roblem solver. In 155 one of the students, Antonio Maria Fior, challenged Nicolo Fontano of Brescia, nicknamed Tartaglia (stammerer), and the latter discovered the same method. Tartaglia was a self-taught mathematics teacher who had already written the first serious treatise on ballistics, and would later translate Euclid into Italian. He was ressured to reveal the secret by Geronimo Cardano (1501 1575), a famous and infamous rofessor of mathematics, medicine, and roguery at Pavia and other North Italian universitites. On romise of secrecy, Tartaglia showed him the method. But Cardano set to work elaborating it, and soon his student Lodovico Ferrari had extended it to solve uartics. Cardano ublished both in his Ars magna in 155. This is one of several of his treatises tyical of the time: encycloedias of everything, from occult descritions of demons to natural history to theoretical mathematics. Tartaglia became involved with Cardano and Ferrari in a ublic riority disute, and faded from the scene. Cardano became famous for studies of syhilis and tyhus, and for an autobiograhy (of a rogue and scoundrel). He wrote one of the first books on robability, ublished osthumously. Cardano was imrisoned in 1570 for the heresy of casting Christ s horoscoe; but the Poe rethought the matter, released him, then hired him as aal astrologer!
CUBIC & QUARTIC FORMULAS Page 11 The Italians were handicaed by their lack of notation for variables. This was rovided by François Viète (150 160), a olitician and lawyer from Brittany involved with the Huguenot cause. He ursued mathematics as a hobby, esecially while out of office, and ublished rivately a number of treatises in which he used an algebraic symbolism similar to ours. The treatment of cubic and uartic euations given here is essentially his. The modern theory of roots of olynomials in general was not develoed until the middle 1600s by Descartes and others. The first comlete treatment of cubic and uartic euations was given by Euler in 17. During the 1600s and 1700s, mathematicians regarded extension of these methods to uintic and higher euations as a major oen roblem, but met with no success. Not until 1800 did Gauss rove that every olynomial has at least one comlex root, and not until about 180 did Galois, Abel, and others show that roots of uintic and higher degree euations could not, in general, be found by the familiar methods involving algebraic oerations and extraction of roots. Exercises Find all roots of each of the following cubics. Verify each real root by substituting it for x and calculating the left hand side of the euation. 1. x 6x 6 = 0. x 6x = 0. x 6x + = 0. x + x x 1 = 0 Acknowledgement Thanks to Singaore student Jessica Ng for finding two serious tyograhical errors in the revious version of this note.
Page 1 CUBIC & QUARTIC FORMULAS Solutions 1. To solve x + x + = 0 with = = 6, set x = y = z /(z) = z + /z. The euation then becomes 8 z + 6 = 0 z z 6 6z + 8 = 0 (z )(z ) = 0, hence z = or z =. Select z = (it makes no difference which alternative you ick). Then z = z 0, z 1, or z, where z 0 = z 1 = z 1 z = z 0, and x = x 0, x 1, or x, where x 0 = z 0 + = + 6..87 z 0 x 1 = z 1 + = z 0 + 1 = z 0 + z1 z0 i 1 z0 i 1 = 0 0 = + i z z0 z z i x0 6 0. 1.66 0.861i x = x 1. 1.66 + 0.861i.. To solve x 6x = 0, set x = y ( 6)/(@) = y + /. The euation becomes y (/) y /7 = 0. Now set y = z + (/)/(z) = z + (/9)z, and the euation becomes z + (6/79)z /7 = 0, i.e. 79z 6 918z + 6 = 0. By the uadratic formula, z = /7 or /7. Take the former it makes no difference which. Then z = z 0, z 1, or z, where z 0 = z 1 = z 1 z = z 0, and x = x j = y j + /, y 0 = z 0 + = 9z 0 1 5
CUBIC & QUARTIC FORMULAS Page 1 Thus y 1 = z 0 + 1 = y 0 + 9z0 y = y 1. x 0..190 x 1. 0.075 0.5578i x. 0.075 + 0.5578i. 1 5 6 i. To solve x + x + = 0, where = 6 and =, set x = z /(z) = z + /z. The euation becomes 8 z + + = 0 z z 6 + z + 8 = 0 z = 1 ± 7 i = rcis r = 1 7 = 1 cos = = r = 0, 0 +, or 0 + 0 = cos 1. 1.916 z = r cis = cis x = z + = cis + z cis = cis + cis = cos..61805,.6016777, or 0.9877.. To solve x + x x 1 = 0, set x = y a. The euation becomes y (7/)y 7/7 = 0. Now set y = z + 7/(9z), and the euation becomes
Page 1 CUBIC & QUARTIC FORMULAS 7 z + = 0 79z 7 7 z 6 z + = 0 7 79 7 1 z = 5 5 i 7 r = 7 r = 7 cos = 1 = rcis = 0, 0 +, or 0 + 7 0 = cos 1. 1.8067 1 z = 7 r cis = cis 7 7 7 y = z + = cis + 9z 7cis 7 7 7 = cis + cis = cos 1 x = y. 1.6979, 1.801969, or 0.505.