An Efficient Algorithm For Computing The Roots of General Quadratic Cubic and Quartic Equations PDF
An Efficient Algorithm For Computing The Roots of General Quadratic Cubic and Quartic Equations PDF
Reference
[1] Krause E. Taxicab geometry. New York (NY): Dover Publications; 1986.
1. Introduction
An emphasis is given to the general quadratic equation, its solution and applications in most
of the algebra textbooks. On the other hand, the solutions to the general cubic and quartic
equations are not covered. As a consequence, the general cubic and quartic equations are
almost never taught in a classroom as a part of a lecture. The aim of our paper is to present
an efficient algorithm so that the students are able to study and compare the required steps
for the quadratic, cubic and quartic equations in order to arrive at their respective solutions.
One way to conduct this is to compute the roots of the general quadratic equation with
the algorithm, then to modify and extend it to calculate the roots of the general cubic and
quartic equations.
1096
Classroom Notes
The solution to the general cubic equation is due to Cardano (1539), who used complex
numbers to solve the roots.[1] Cardanos student Lodovico Ferrara discovered a method
of solving the general quartic equation. While Cardanos method is cited in the literature,
it is not suitable for teaching. The formula for the roots of the cubic equation is quite
complicated and the roots do not always lead to the desired results.[2] The solution of
the general quartic equation from Ferraras method has the same complexity in terms of
teaching.[2, 3] Recent articles have demonstrated alternative methods to determine the
roots of the cubic equation.[4, 5, 6, 7] To date, a systematic approach or algorithm is not
available in order to popularize the solution to the general cubic and quartic equations
among students. We propose a general algorithm in the next section, which can be easily
taught to solve for the roots of the general quadratic equation and then in subsequent
sections the algorithm is modified to calculate the roots of cubic and quartic equations.
(1)
STEP 1: Substituting
x = u
in Equation (1) yields u2
a12
4
a1
2
(2)
1 2
a 4a0 .
2 1
(3)
STEP 2: If a12 4a0 > 0, then u = 12 a12 4a0 from Equation (3). Using Equation (2),
x =
1 2
a1
a 4a0
2
2 1
(4)
a1
2
(5)
is the root of Equation (1). We observe that the two roots are identical and that the left-hand
side of Equation (1) becomes a perfect square.
i
a1
4a0 a12 .
2
2
(6)
Remark: The proposed algorithm above is applicable in calculating the roots of the wellknown quadratic equation ax 2 + bx + c = 0 with a = 0, and is left as an exercise for
the readers.
3. The proposed algorithm: cubic case
Consider the general cubic equation given by a3 x 3 + a2 x 2 + a1 x + a0 = 0 with a3 = 0.
Without loss of generality, we provide below the steps of the proposed algorithm for
x 3 + a2 x 2 + a1 x + a0 = 0.
(7)
STEP 1: Substituting
x = u
a2
3
(8)
(9)
2a23
27
a1 a2
3
+ a0 and A1 = a1
a22
3
(10)
are real.
1098
Classroom Notes
apply synthetic or long division in order to obtain the quadratic equation. This allows us to
arrive at the remaining two roots by using the appropriate steps of Section 2.
13
A0
4A31
1
2
2 A0 + 27
and use
STEP 5: If A0 = 0 and A1 = 0, then calculate c0 =
2
any of the three values for c0 in steps 6 or 7. Proceed to step 6 if c0 is real. Otherwise, go to
step 7 if c0 is complex. We note that c0 becomes complex when the term under the square
root sign of c0 is negative.
A1
and then obtain the real root x using Equation (8). We
STEP 6: Calculate u = c0 3c
0
then apply synthetic or long division to arrive at the quadratic equation, from which we
calculate the other two roots by using the required steps of Section 2.
1
STEP 7: Since c0 is a complex number of the form c0 = [m i n] 3 from step 5, the
cube root of c0 requires the calculation of and r.
(1) Note m = r cos and n = r sin implies = tan1 mn and m = r cos yields
r = cosm .
1
(2) c0 = r 3 cos 3 + i sin 3 using and r from (1). This implies
2
1
+ r 3 sin2 3 = r 3 and then proceed to step 6. We observe that
13
m2 + n2 .
an equivalent expression for c0 =
c0 =
2
r 3 cos2
(11)
STEP 1: Substituting
x = u
a3
4
(12)
(13)
(14)
1
a a2
16 2 3
3 4
a ,
256 3
A1 = a1 12 a2 a3 + 18 a33 and A2 = a2
(15)
(16)
if s, t and can be obtained from Equation (15). Equating the like coefficients for the
variables of Equation (15) yields the following equations;
A2 + 2 A1
2
A2 + 2 + A1
t =
2
z3 + 2A2 z2 + A22 4A0 z A21 = 0,
s =
(17)
(18)
(19)
where z = 2 .
For further reading, the readers are directed to [8].
STEP 5: Substitute z = y
2A2
3
where B0 =
and B1 =
(20)
A22 12A0
.
3
13
3
4B
B
1
0
1
c0 =
B02 +
2
2
27
(21)
2A2
3
1100
Classroom Notes
STEP 9: Calculate s =
STEP 10: Calculate t =
A2 + 2
2
A1
A2 + +
2
2
A1
2 4s
2
2 4t
2
STEP 13:Finally, use x = u a43 of step 1 to obtain the solutions x1 , x2 , x3 and x4 from
the values of u from steps 11 and 12, respectively.
Remark: In general, the principal root value of c0 works towards the solutions of step 13
and it is recommended that the solutions are verified using Equation (11).
5. Illustrations
In this section, we provide various examples of the quadratic, cubic and quartic equations
in the Sections 5.15.3, respectively.
i 3
,
2
3
2
i 3
2
and x =
3
2
i 3
.
2
+
= 1. We then calculate u = c0 3c
= 1 3(1)
= 2 using
2
2
27
0
step 6. From step 1, we arrive at the root x = u a32 = 2. By applying synthetic or long
division, we obtain x 2 + 2x + 1 = 0. From step 3 of Section 2, we arrive at the identical
roots of x = 1.
Example 5: Consider x 3 7x 6 = 0, where a0 = 6, a1 = 7 and a2 = 0.
We note that A0 = 6 = 0 and A1 = 7 = 0 using step 1. Substituting the values
1
of A0 and A1 in step 5, we arrive at c0 = [3 1.92449i] 3 . To calculate the cube root
of c0 , we follow step 7(1) to obtain = tan1 (0.641496666) = 32.68 and r = 3.5642.
1
1
Then, step 7(2) yields c0 = r 3 cos 3 + i sin 3 = (3.5642) 3 cos 32.68
=
+ i sin 32.68
3
3
1
3.
Using
Equation
(8)
of
step
1,
we
obtain
x
=
3
u = c0 3c
3
0
2
Applying synthetic or long division yields x + 3 x + 2 = 0, from which we arrive at the
two roots x = 1 and x = 2 , using step 2 of Section 2.
5.3. Illustrations (quartic case)
In this section, we apply the steps of the proposed algorithm for quartic case of Section 4
and provide some examples in order to compute the roots of the general quartic equation.
Example 1: Consider the quartic equation x 4 + x 3 7x 2 x + 6 = 0, where a0 =
6, a1 = 1, a2 = 7 and a3 = 1. We note that A0 = 5.8008 = 0, A1 = 2.625 = 0 and
A2 = 7.375 = 0 using step 1. Using step 5, B0 = 91.2593 and B1 = 41.3333. From
step 6,
c0 =
13
91.2593 1
4 (41.3333)
(91.2593)2 +
= 3.6667 0.57735i.
2
2
27
3
Next in step 7, using any one of the values of c0 , we obtain y = 7.3333 and z = 12.25,
respectively. Taking the positive value of = 3.5 (the negative value of also works)
from step 8, we get s =
A2 + 2
2
A1
7.375+(3.5)2 2.625
3.5
2
= 2.0625 and t =
A2 + 2 +
2
A1
1102
Classroom Notes
7.375+(3.5)2 + 2.625
3.5
= 2.8125 from steps 9 and 10, respectively. Step 11 yields the two
2
of u1 = 0.75 and u2 = 2.25 while step 12 provides the remaining two values u3 =
values
2.75
and u4 = 1.25. Finally, we arrive at the solutions x1 = 1, x2 = 2, x3 = 3 and x4 = 1
given in step 13 from the values of u1 , u2 , u3 and u4 of step 12.
91.2593
2
1
2
(91.2593)2 +
4(41.3333)3
27
13
then provides y = 3.0604 and z = 1.0604, respectively, using any one of the values
of c0 . We can take the positive or the negative value of . We choose = 1.0298
from step 8 and obtain s =
3
3+(1.0298)2 + 1.0298
= 3.4868
2
ues of u1 = 0.51489 +
A2 + 2
2
A1
3
3+(1.0298)2 1.0298
2
= 0.57358 and t =
A2 + 2 +
2
A1
from steps 9 and 10, respectively. Step 11 provides the two val0.55541i and u2 = 0.51489 0.55541i, while step 12 yields
the remaining two values u3 = 0.51489 + 1.7949i and u4 = 0.51489 1.7949i. In
step 13, we obtain the solutions x1 = 0.51489 + 0.55541i, x2 = 0.51489 0.55541i,
x3 = 0.51489 + 1.7949i and x4 0.51489 1.7949i from the values of u1 , u2 , u3 and
u4 .
91.2593
2
1
2
(91.2593) +
2
4(41.3333)3
27
13
= 1.0327 1.7887i.
6. Conclusions
This paper demonstrated an efficient algorithm to calculate the roots of the general quadratic,
cubic and quartic equations. More importantly, this algorithm gives the understanding of
how the roots are exposed systematically. Our proposed algorithm is simple and effective
for the purpose of classroom teaching. This algorithm would allow the students to work
comfortably with limited supervision or even independently to solve problems in a course
assignment or project.
Acknowledgements
The authors are grateful to the referee for the suggestions made on the earlier version of the paper.
1. Introduction
Various mean value theorems are important tools in mathematical analysis. It is worth
mentioning the pioneering contributions of Fermat, Rolle, Lagrange, Cauchy, Taylor and
others. The famous mean value theorem of Lagrange was stated as follows.
Theorem A (Lagranges Theorem): Let f(x) be a real continuous function on [a, b] and
differentiable on (a, b). Then there exists a point c (a, b) such that,
f (c) =
f (b) f (a)
.
ba
When f (a) = f (b), then the mean value theorem of Lagrange reduces to Rolles theorem,
which is another important result in mathematical analysis. The mean value theorem of
Lagrange has been generalized by many authors. In 1958, a variation of the mean value theorem of Lagrange was given by Flett, [1] and it was later extended in [24] and generalized
in [510].