0% found this document useful (0 votes)
34 views8 pages

ICTCM21 Proceedings Aslam Villanueva

The document discusses solving cubic equations in three cases: (1) when there is one real solution, (2) when there are two equal real solutions, and (3) when there are three distinct real solutions. It presents the formulas for solving cubics, including Cardano's formula and definitions of discriminants. Examples are provided and solved step-by-step of cubics with one real solution, two complex solutions, and three distinct real solutions. The examples are also solved using Excel.

Uploaded by

Emco Miller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views8 pages

ICTCM21 Proceedings Aslam Villanueva

The document discusses solving cubic equations in three cases: (1) when there is one real solution, (2) when there are two equal real solutions, and (3) when there are three distinct real solutions. It presents the formulas for solving cubics, including Cardano's formula and definitions of discriminants. Examples are provided and solved step-by-step of cubics with one real solution, two complex solutions, and three distinct real solutions. The examples are also solved using Excel.

Uploaded by

Emco Miller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SOLVING CUBIC EQUATIONS BY EXCEL

Nadeem Aslam
Mathematics Department
Florida International University
11200 SW 8th Street
Miami, FL 33199
aslamn@fiu.edu

Jay Villanueva
Mathematics Department
Miami Dade College
11011 SW 104th Street
Miami, FL 33176
jvillanu@mdc.edu

(Abstract) There is a formula to solve a general cubic equation. Here, we will


solve examples of cubics: When there is one real solution, when there are two
equal real solutions, and when there are three distinct real solutions. We will
program in Excel, the solutions of cubics for all three cases.

We all know the solution to a quadratic equation, 𝑎𝑥 ! + 𝑏𝑥 + 𝑐 = 0:


$%±√%! $()*
𝑥",! = !)
.
The quantity ∆ = 𝑏 ! − 4𝑎𝑐 is known as the discriminant:
−, both roots complex;
∆ = 0, one real root;
+, both roots real and unequal.

There is a similar description to the solutions of a cubic equation,


(1) 𝑎𝑥 + + 𝑏𝑥 ! + 𝑐𝑥 + 𝑑 = 0,
published by Cardano (Ars Magna, 1545). We derive Cardano’s equation.
%
Define 𝑥 = 𝑦 − + , with 𝑎 = 1. Eq. (1) becomes
(2) 𝑦 + + 𝑝𝑦 + 𝑞 = 0,
called the reduced equation,
%! %* !%"
where 𝑝= 𝑐− +
and 𝑞=𝑑− +
+ !,
.
The discriminant of the cubic is defined as
△= (𝑥" − 𝑥! )! (𝑥" − 𝑥+ )! (𝑥! − 𝑥+ )! ,
where 𝑥" , 𝑥! , 𝑥+ are the roots of Eq. (1). This is also given by
△= −4𝑝+ − 27𝑞! ,
where 𝑝 and q are given in Eq. (2), where
−, two roots complex;
∆ = 0, two equal roots;
+, all roots real and distinct.

Start with the complex cube root of unity:


" √+
𝜔 = − ! + ! 𝑖,
which is one complex root of 𝑧 + − 1 = 0.
-"
Let 𝑦 = 𝑧 − 𝑝⁄3𝑧, then 𝑧 + − !,. " + 𝑞 = 0, which can be rewritten as
- +
(3) (𝑧 + )! + 𝑞(𝑧 + ) − @ A = 0
+
a quadratic in 𝑧 + . The roots are
/ - + / !
𝑧",! + = − ! ± D@+A + @!A .
Choose the two solutions as: 𝑧" + 𝑧! + = −(𝑝⁄3)+ , or 𝑧" 𝑧! = − 𝑝⁄3, i.e., 𝑧! =
− 𝑝⁄3𝑧" , then the other cube roots are 𝜔𝑧" , 𝜔! 𝑧" , 𝜔𝑧! . And 𝑦" = 𝑧" −
𝑝⁄3𝑧" = 𝑧" + 𝑧! , 𝑦! = 𝜔𝑧" + 𝜔! 𝑧! , 𝑦+ = 𝜔! 𝑧" + 𝜔𝑧! are the roots of Eq. (2).
As a check, we can use the identities 𝜔+ = 1 and 1 + 𝜔 + 𝜔! = 0.
We can also verify
𝑦" + 𝑦! + 𝑦+ = 0,
𝑦" 𝑦! + 𝑦! 𝑦+ + 𝑦+ 𝑦" = 𝑝,
𝑦" 𝑦! 𝑦+ = −𝑞.

Case (i): Two equal roots.


-" /!
Here, 𝛥 = 0. Then !, + (
= 0 ⇒ 𝑧" = 𝑧! . Thus
" /
(4) 𝑦" = 𝑧" + 𝑧! = 2D− ! = "J−4𝑞. And
" "
𝑦! = −𝑧" = J𝑞⁄2, 𝑦+ = J𝑞⁄2 = 𝑦! .

Case (ii): Two complex roots.


-" /! -" /!
Here, 𝛥 < 0. Then !,
+ (
> 0 and D!, + (
is a real number. Then

" + ! " + !
$/ - / $/ - /
𝑧" = P ! + D@+A + @!A , 𝑧! = P ! − D@+A + @!A ,

And 𝑦" = 𝑧" + 𝑧! ,


" "
(5) 𝑦! = − ! (𝑧" + 𝑧! ) + i ! (𝑧" − 𝑧! )√3,
" "
𝑦+ = − ! (𝑧" + 𝑧! ) − i ! (𝑧" − 𝑧! )√3.

Case (iii): All real roots.


-" /! -" /!
Here, 𝛥 > 0. Then !,
+ (
< 0 and D!, + (
is not a real number. From Eq.
(5), then 𝑧" and 𝑧! are cube roots of complex numbers and it is not easy to do. So,
to avoid doing this, we use another approach, by trigonometry.
We can easily show that cos 3𝜃 = 4𝑐𝑜𝑠 + 𝜃 − 3𝑐𝑜𝑠𝜃, so that 𝑧 = cos 𝜃 is a root of
the equation 4𝑧 + − 3𝑧 = 𝑘 if cos 3𝜃 = 𝑘, i.e., 𝜃 = (𝑎𝑟𝑐𝑐𝑜𝑠𝑘)/3. In this case
cos(𝜃 + 2𝜋/3) and cos(𝜃 + 4𝜋/3) are also solutions, provided |𝑘| ≤ 1. In the
reduced Eq. (2), use
𝑦 = 2J−𝑝⁄3 𝑧.
+
Then, we get back 4𝑧 − 3𝑧 = 𝑘, with
$/ + +⁄!
𝑘= D− @+A = $/ @ + A .
! - ! $-
And the roots are given by,
" $/ + +/!
𝜃 = + 𝑎𝑟𝑐𝑐𝑜𝑠 ^ ! @$-A _,
$- !34
(6) 𝑦2 = 2D + 𝑐𝑜𝑠 @𝜃 + +
A, 𝑛 = 0, 1, 2.

Examples:

Example 1: Two equal real roots.


To find the roots of the cubic: 𝑥 + − 7𝑥 ! + 15𝑥 − 9 = 0.
We can check that the discriminant △= −4𝑝+ − 27𝑞! = 0
%! %* !%"
From Eq. (2) 𝑝 = 𝑐 − +
and 𝑞=𝑑− +
+ !,
( "5 ( "5
Here, the reduced Eq. (2) is 𝑦 + − + 𝑦 + !, = 0, with 𝑝 = − + , 𝑞 = !,.
⇒ △= 0.
( !
Using Eq. (4), the roots are: 𝑦" = − +, 𝑦! = 𝑦+ = +, and
𝑥" = 1, 𝑥! = 𝑥+ = 3.

Example 1 Solution using Excel


cubic equation inputs
a 1
b -7
c 15
d -9
From the reduced equation
p -1.33
q 0.59
Discriminant delta
Del 0
Therefore, roots are equal
y1 -1.33
y2 0.67
y3 0.67
x1 1
x2 3
x3 3

Example 2: Two complex roots


To find the roots of the cubic: 𝑥 + − 𝑥 ! + 𝑥 − 1 = 0.
! !6
From Eq. (2) 𝑝 = + and 𝑞 = − !,.
(75
We can check that the discriminant △= −4𝑝+ − 27𝑞! = − !,
< 0.
! ! ! !6
Here, the reduced Eq. is 𝑦 + + + 𝑦 + 7 = 0, with 𝑝 = + , 𝑞 = − !,.
! " "
Using Eq. (4), the roots are: 𝑦" = +, 𝑦! = − + + 𝑖, 𝑦+ = − + − 𝑖, and
𝑥" = 1, 𝑥! = 𝑖, 𝑥+ = −𝑖.

Example 2 Solution using Excel


cubic equation inputs
a 1
b -1
c 1
d -1
From the reduced equation
p 0.67
q -0.74
Discriminant delta
Del -16
Therefore, one real root and two complex roots.
c2 0.333333333333333
s 0.384900179
z1 0.910683603
z2 -0.244016936
y1 -0.333333333
y 1
y2 -0.333333333333333 + i
y3 -0.333333333333333 - i
x1 1
x2 i
x3 -i

Example 3: Three distinct real roots


To find the roots of the cubic: 𝑥 + − 𝑥 ! − 32𝑥 + 60 = 0.
𝑎 = 1, 𝑏 = −1, 𝑐 = −32, 𝑑 = 60.
7, "++6
From Eq. (2), 𝑝 = − + and 𝑞 = !, .
We can check that the discriminant △= −4𝑝+ − 27𝑞! = 69696 > 0.
7, "++6 7, "++6
Here, the reduced Eq. is 𝑦 + − + 𝑦 + !, = 0, with 𝑝 = − + , 𝑞 = !, .
/ + +⁄!
Here, 𝑘 = − ! @$-A = −0.696088, and |𝑘| ≤ 1.
" $/ + +/!
Then, 𝜃 = + 𝑎𝑟𝑐𝑐𝑜𝑠 ^ ! @$-A _ = 0.780243 𝑟𝑎𝑑.
$- $-
Using Eq. (6), the roots are: 𝑦6 = 2D + 𝑐𝑜𝑠𝜃=4.666667, 𝑦" = 2D + cos @𝜃 +
!4 $- (4
+
A = −6.3333333, 𝑦! = 2D + cos @𝜃 + +
A=1.666667, and
𝑥6 = 5, 𝑥" = −6, 𝑥! = 2.

Example 3 Solution using Excel


cubic equation inputs
a 1
b -1
c -32
d 60

From the reduced equation


p -32.33
q 49.26

Discriminant delta
Del 69696

Therefore, three distinct real roots


k -0.696087835
t 0.780243433
y1 4.666666667
y2 -6.333333333
y3 1.666666667

x1 5

x2 -6

x3 2

Example 4: Two complex roots


To find the roots of the cubic: 𝑥 + − 4𝑥 ! + 13𝑥 = 0.
!+ "!896
From Eq. (2) 𝑝 = + and 𝑞 = 777 .
We can check that the discriminant △= −4𝑝+ − 27𝑞! = −6084 < 0.
!+ "!896 !+ "!896
The reduced Eq. is 𝑦 + − + 𝑦 + 777 = 0, with 𝑝 = − + , 𝑞 = 777 .
( ! !
Using Eq. (4), the roots are: 𝑦" = − +, 𝑦! = + + 3𝑖, 𝑦+ = + − 3𝑖, and
𝑥" = 0, 𝑥! = 2 + 3𝑖, 𝑥+ = 2 − 3𝑖.

Example 5: Three distinct real roots


To find the roots of the cubic: 4𝑥 + + 4𝑥 ! − 𝑥 − 1 = 0.
" "
Which can be re-written as 𝑥 + + 𝑥 ! − ( 𝑥 − ( = 0.
1 1
𝑎 = 1, 𝑏 = 1, 𝑐 = − , 𝑑 = − .
4 4
, 8
From Eq. (2), 𝑝 = − "! and 𝑞 = − 8(.
7
We can check that the discriminant △= −4𝑝+ − 27𝑞! = "5 > 0.
, "" , 8
Here, the reduced Eq. is 𝑦 + − "! 𝑦 − 8( = 0, with 𝑝 = − "! , 𝑞 = − 8(.
/ + +⁄!
Here, 𝑘 = − ! @$-A = 0.539949, and |𝑘| ≤ 1.
" $/ + +/!
Then, 𝜃 = + 𝑎𝑟𝑐𝑐𝑜𝑠 ^ ! @$-A _ = 0.333473 𝑟𝑎𝑑.
$- $-
Using Eq. (6), the roots are: 𝑦6 = 2D + 𝑐𝑜𝑠𝜃=0.833333, 𝑦" = 2D + cos @𝜃 +
!4 $- (4
+
A = −0.666667, 𝑦! = 2D + cos @𝜃 + +
A= −0.166667, and
" "
𝑥6 = ! , 𝑥" = −1, 𝑥! = − !.

Conclusions:
A cubic is a polynomial equation with real coefficients of the form:
(1) 𝑎𝑥 + + 𝑏𝑥 ! + 𝑐𝑥 + 𝑑 = 0, 𝑎, 𝑏, 𝑐 𝑑 are real.
%
There is a solution when we transform the equation by 𝑥 = 𝑦 − +) and we get a
reduced form:
%! %* !%"
(2) 𝑦 + + 𝑝𝑦 + 𝑞 = 0, where 𝑝 = 𝑐 − + , 𝑞 = 𝑑 − +
+ !,
.
And we get Cardan’s solutions for three cases.
Defining the discriminant △= −4𝑝+ − 27𝑞! , we have:
(i) △< 0, there are two complex roots;
" + ! " + !
$/ - / $/ - /
𝑧" = P ! + D@+A + @!A , 𝑧! = P ! − D@+A + @!A ,

And 𝑦" = 𝑧" + 𝑧! ,


" "
𝑦! = − ! (𝑧" + 𝑧! ) + i ! (𝑧" − 𝑧! )√3,
" "
𝑦+ = − ! (𝑧" + 𝑧! ) − i ! (𝑧" − 𝑧! )√3.
(ii) △= 0, two equal roots;
" /
𝑦" = 𝑧" + 𝑧! = 2 D− ! = "J−4𝑞. And
" "
𝑦! = −𝑧" = J𝑞⁄2, 𝑦+ = J𝑞⁄2 = 𝑦! .
(iii) △> 0, there are three distinct roots given by;
" $/ + +/!
𝜃 = + 𝑎𝑟𝑐𝑐𝑜𝑠 ^ ! @$-A _,
$- !34
𝑦2 = 2D + 𝑐𝑜𝑠 @𝜃 + +
A, 𝑛 = 0, 1, 2.
We have programmed the solutions to a cubic equation in Excel and given examples
to illustrate them. We find that any cubic equation can now be solved very readily
using Excel.
We can see from the formulae of the roots that the computations involve square
roots inside cube roots, and oftentimes imaginary numbers are involved. This might
explain why the cubic formula is not as popular as the quadratic formula.
But with an algorithm as Cardan’s formulae, written in Excel, any cubic equation
can now be solved fast. In fact, from the formula itself, we can tell at once whether
the roots are all distinct real, two are equal, or two are complex, even before we get
the actual roots.

References:
• Beachy, J & Blair, W, 1996. Abstract Algebra. Il: Waveland Press Inc.
• Cox, D, 2004. Galois Theory. NJ: John Wiley & Sons.
• Rotman, J, 2000. A First Course in Abstract Algebra. NJ: Prentice Hall.
• Stewart, J, Redline, L & Watson, S, 2004. College Algebra. Ca:
Brooks/Cole-Thomson Learning.
• Sullivan, M, 2012. Algebra and Trigonometry. Ma: Prentice Hall.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy