28
Mathematics Standard Level Internal Assessment SOLVING POLYNOMIAL EQUATIONS OF 1st , 2nd and 3rd DEGREE Name: Nikitas Manolis Candidate Number: ****** School: Ionios School Greece School Number: ******

Polynomial Equations - Cardano v9

Embed Size (px)

DESCRIPTION

IB SL Maths Internal Assesment

Citation preview

Page 1: Polynomial Equations - Cardano v9

Mathematics Standard LevelInternal Assessment

SOLVING POLYNOMIAL EQUATIONS OF 1st , 2nd and 3rd DEGREE

Name: Nikitas Manolis

Candidate Number: ******School: Ionios School Greece

School Number: ******

Page 2: Polynomial Equations - Cardano v9

Table of Contents

1 INTRODUCTION....................................................................................................1

2 Cardano's Method....................................................................................................3

3 Cardano’s Extended solution for complete solution of the Cubic equation.......63.1 Discriminants...............................................................................................................7

4 Iterations.................................................................................................................13

5 CONCLUSION.......................................................................................................15

6 Appendix A : Excel VBA code written to solve the cubic equation x3+ax2+bx+c=0................................................................................................................16

6.1 Function Cardan1(aa As Double, bb As Double, cc As Double) As Variant.......166.2 Function Cardan2(aaa As Double, bbb As Double, ccc As Double) As Variant. 166.3 Function Cardan3(aaaa As Double, bbbb As Double, cccc As Double) As Variant

17

7 Bibliography...........................................................................................................19

Candidate Number: ********

Page 3: Polynomial Equations - Cardano v9

1 INTRODUCTION At the early days of high school I was impressed to see that solutions to problems could be found by solving linear equations of the form ax+b=0 where a and b Є ℝ.. One such easy problem was the calculation of the time it takes to travel a distance S=100km when travelling at a speed of V=120 km/h

We have S=Vt This can be rearranged so Vt-S=0. Therefore:

t= SV

=100120

h=0.83h

This indeed looks simple now but at the time it was a revelation.

I then started my IB course and suddenly I learned how to solve quadratic equations. I also learned that both of these equations are polynomial equations of 1st and 2nd degree. The question that stacked in my mind was how polynomial equations of higher degree are solved.

In this work I aim to find out how the cubic equation of the form Zx3+Ax2+Bx+C=0 is solved.

But let us start with the definition of the polynomial and the polynomial equation.

Any expression of the form

P(x )=∑i=0

n

a i xi

is called a polynomial of variable x and degree n.

If the polynomial is set to zero i.e. P(x) = 0 then we have the so called polynomial equation.

The number n defines the degree of the polynomial or the degree of the polynomial equation respectively.

Since the 1st degree polynomial equation was described above let us now look at the 2nd degree equation which takes the form:

ax2 + bx + c = 0 where a, b and c Є ℝ and a ≠ 0.(1)We know from the IB mathematics syllabus topic 2.7 that this equation can be solved generically using the Discriminant.Discriminant is defined as:

Candidate Number: 00****** 1

Where a0, a1, … an Є ℝ and i Є ℕ

Page 4: Polynomial Equations - Cardano v9

Δ = b2 – 4ac(2)If the roots of the equation is x1 and x2 then,

x1 , x2=−b±√Δ

2a=−b±√b2−4ac

2a(3)

From the above it is derived that if 1. Δ>0 the equation has two real distinct solutions2. Δ=0 the equation has one double real distinct solution.3. Δ<0 the equation has two complex solutions and no real solution.

From the above I can see that this way of solving 2nd degree polynomial equations is so powerful, that not only it solves any 2nd degree polynomial equations, but the existence of the discriminant gives information of how many solutions or roots the equation has and whether these are real or complex numbers.

But when was the first time that the quadratic questions or indeed higher degree polynomial equations were solved? From the research I did I found out that there is is a very lengthy history in the solutions of polynomial equations.

The Babylonians were the first that appeared to be in a position to solve some of the forms of quadratic equations1 around 1800 BC. The solution formula for solving the quadratic equations was also mentioned in the Bakshali Manuscript2 written in India between 200 BC and 300 AD.

The quadratic equations were also solved by the ancient Greeks using geometric constructions3. They also had methods applicable to cubic equations involving points of intersection of conics.

In 1545 a doctor and mathematician called Cardano in his book “Ars Magna”4 published the solution formula for solving the cubic equations (3rd degree). Although it appears that the solution was in fact the work of Scipione del Ferro and Nicolo Tartaglia, the solution took the name of the Cardano who was the first to publish it.

In his book Ars Magna, Cardano also published the work of his student Lodovico Ferrari, with a solution formula for the quartic equations (4th degree).

In the next part of this report, I will present the Cardano’s method, analyze its strengths and limitations and present ways of overcoming these limitations. An alternative solution method of the 3rd degree equation, based on iterations, will also be presented.1

21 Babylonian Mathematics : http://en.wikipedia.org/wiki/Babylonian_mathematics The Bakhshali manuscript : http://www-history.mcs.st-and.ac.uk/Projects/Pearce/Chapters/Ch6.html 3 Solutions of Polynomial equations by Donald Rideout, Memorial University of Newfaundland : http://math2.uncc.edu/~hbreiter/m6105/polynms.pdf4 The Story of Mathematics. 16TH CENTURY MATHEMATICS - TARTAGLIA, CARDANO & FERRARI : http://www.storyofmathematics.com/16th_tartaglia.html

Candidate Number: 00****** 2

Page 5: Polynomial Equations - Cardano v9

2 Cardano's Method

If we divide the equation Zx3+Ax2+Bx+C=0 with Z where Z≠0, we end up with the general form of the cubic equation as follows:

x3 + ax2 + bx + c = 0 where a, b, c and d Є ℝ (4)After substituting x= y−

a3

equation (4) becomes.

( y−a3 )3

+a( y−a3 )2

+b ( y−a3 )+c

¿ y3−3 y2 a3+( a3 )

3

+a¿

¿ y3+( a2

3−2a2

3+b) y+(−a3

27+ a

3

9−ab

3+c)

¿ y3+(−a2

3+b) y+( 2a3

27−ab

3+c )=0 (5)

By substituting p=(−a2

3+b)∧q=( 2a3

27−ab

3+c) , (5) becomes:

y3 + py + q = 0 (6)

By substituting y=u+v, equation (6) becomes:

(u+v )3+ p (u+v )+q

¿u3+3u2 v+3uv2+v3+ pu+ pv+q (7)

After carrying out the calculations (7) becomes:

u3 + v3 + q +(u+v)(3uv + p) = 0 (8)

In order for equation (7) to be valid the following must be also valid.

3uv + p = 0 and u3 + v3 = -q.

In this way, we obtain the system with equations (9) and (10) below.

u3 + v3 = -q (9)

Candidate Number: 00****** 3

Page 6: Polynomial Equations - Cardano v9

u3 v3=−p3

27 (10)

 Since this system specifies both the sum and product of u3 and v3, we can define a quadratic equation with roots u3 and v3. This equation will be:

t 2+qt− p3

27=0 Where t Є ℝ . (11)

As Cardano did not know complex numbers, he supposed that the roots of this equation were real. This meant that his method was looking only for real solutions. In order for this to be true the following had to be true.Δ≥0 Hence:

q2−4−p3

27=q2+4

p3

27≥0 (12)

This meant that equation (11) has the following distinct solutions t1 and t2:

t 1,2=−q±√q2+ 4 p3

272

=−q2±√ q2

4+ p

3

27

where t1 and t2 Є ℝ (13) Therefore since t1 = u3 and t2 = v3 we have: u3=−q

2+√ q2

4+ p

3

27 u=3√−q

2+√ q2

4+ p

3

27

v3=−q2

−√ q2

4+ p

3

27 v=3√−q

2−√ q2

4+ p

3

27

where u and v Є ℝ.Since we have set y=v+u we have:y=

3√−q2

+√ q2

4+ p

3

27+

3√−q2

−√ q2

4+ p

3

27 where y Є ℝ.

and since x= y−a3

we have:x=

3√−q2

+√ q2

4+ p

3

27+

3√−q2

−√ q2

4+ p

3

27−a

3 where x Є ℝ.

The above formula is known as the Cardano formula.Candidate Number: 00****** 4

Page 7: Polynomial Equations - Cardano v9

As we can see providing Δ≥0 the Cardano method gives us one solution and no solution if Δ<0. Cardano realised5 that he had not solved the cubic polynomial fully when he was examining the equation x3-15x-4=0 and he realised that one of the roots was 4.

His method could not find this solution as t 1,2=2±√−121 which he could not solve.

Indeed another Italian Mathematician called Bombelli6 in 1560 solved this equation.

By applying the Cardano formula Bombelli came up with :

x= 3√2+√−121+ 3√2−√−121

Then by assuming that 3√2+√−121=2+b√−1 and cubing both sides he calculated that b=1.

In the same way he proved that 3√−2+√−121=2−√−1 .

In this way he came up with the solutionx=2+√−1+2−√−1=4.

It was indeed the solution of the above equation that led7 to the definition of complex numbers.

In 1799 Gauss proved the fundamental theorem of Algebra8 which states that any polynomial of degree grater or equal to 1 has at least 1 root which can be either real or complex. The consequence of this theorem was the proof that every polynomial of n degree has n roots if we allowed multiple roots to be counted distinctly.

Having now the knowledge of complex numbers and the understanding of the above fundamental theorem of Algebra, we know that the cubic equation has in fact three solutions with some of them real and some of them complex. In the following part of this report, I will aim to locate the additional solutions not found by the Cardano method.

3 Cardano’s Extended solution for complete solution of the Cubic

equation

Since u3 = t1 we get the following equation.5 Geometric Solutions of Quadratic and Cubic Equations by David W. Henderson

Department of Mathematics, Cornell University Ithaca, NY, 4853-7901, USA http://www.math.cornell.edu/~dwh/papers/geomsolu/geomsolu.html.

6 Geometric Solutions of Quadratic and Cubic Equations by David W. Henderson7 Geometric Solutions of Quadratic and Cubic Equations by David W. Henderson8 Solutions of Polynomial Equations Donald Rideout, Memorial University of Newfoundland http://math2.uncc.edu/~hbreiter/m6105/polynms.pdf

Candidate Number: 00****** 5

Page 8: Polynomial Equations - Cardano v9

u3−t1=(u− 3√t 1) (u2+u 3√ t1+( 3√t 1)2 )=0 (14)Therefore:

(u−3√ t1 )=0 (15) and (u2+u 3√t 1+( 3√t 1)2 )=0 (16)Cardano’s solution was based on the solution of equation 15 where he found u1 and v1.

But if (u2+u 3√t 1+( 3√t 1)2 )=0 we have two additional solutions of u as follows.

u2,3=− 3√t 1±√ ( 3√ t1 )2

−4 ( 3√ t1 )2

2=

−3√ t12± i

3√ t1 √3

2=

3√t 12

(−1±i √3 )

Which are complex numbers.

In the same way:

V 2,3=− 3√t 2±√ ( 3√ t2 )2

−4 ( 3√ t2 )2

2=

−3√ t22± i

3√ t2 √3

2=

3√t 22

(−1±i√3 )

Hence:

u2=3√ t12

(−1+ i√3 )

u3=3√ t 12

(−1−i √3 )

v2=3√t 22

(−1+i √3 )

v3=3√t 22

(−1−i √3 )

Since y=u+v and we have three u and three v we end up with 9 possible pairs u and v the sum of which could be y. These pairs are summarised on table 1.

3.1 Discriminants

If Δ>0 then we have the following possible solutions:

Candidate Number: 00****** 6

Page 9: Polynomial Equations - Cardano v9

Table 1 : Possible combinations of Un and Vn if Δ>0AA un vn un+vn un . vn

1 u1 v1

Real since both u1 and v1 are real(this is the Cardano Solution) Real since both u1 and v1 are real

2 u1 v2

Complex since u1 is Real and v1 is Complex

Complex since u1 is Real and v1 is Complex

3 u1 v3

Complex since u1 is Real and v3 is Complex

Complex since u1 is Real and v3 is Complex

4 u2 v1

Complex since v1 is Real and u2 is Complex

Complex since v1 is Real and u2 is Complex

5 u2 v2

Real or Complex. Calculations need to be made

6 u2 v3

Real or Complex. Calculations need to be made

7 u3 v1

Complex since v1 is Real and u3 is Complex

Complex since v1 is Real and u3 is Complex

8 u3 v2

Real or Complex. Calculations need to be made

9 u3 v3

Real or Complex. Calculations need to be made

In order for equation (10) above to be valid since p is real, un . vn must also be real. Therefore from the above pairs we discard the pairs 2, 3, 4 and 7 since they are complex.

We now have to do the calculations for pair 5, 6, 8 and 10 to find the ones that satisfy

un . vn Є ℝWe start with pair Nr 5.

Let us assume that 3√t 12

=m and 3√t 22

=n

u2 . v2=(−m+i .m√3 ) (−n+i .n√3 )=(mn−3mn )+ i√3 (−mn−mn )=−2mn−i .2mn√3

Which is complex as m≠0 and n≠0 .

For pair Nr 6.

u2 . v3=(−m+ℑ√3 ) (−n−i . n√3 )=(mn+3mn )+i √3 (mn−mn )=2mnn¿

Candidate Number: 00****** 7

Page 10: Polynomial Equations - Cardano v9

This is real, as both m and n are real.

In the same way the product of pair 9 is also complex and the product of pair 8 is real

Therefore since y=v+u and x= y−a3 we have the following additional solutions of x.x2=u2+v3−

a3=−m−n+ i√3 (m−n )−a

3

¿−3√t 12

−3√ t22

−a3+i √3( 3√ t 1

2−

3√ t22 ) (15)

x3=u3+v2−a3=

−3√t 12

−3√t 22

−a3−i√3( 3√ t1

2−

3√t 22 ) (16)

We therefore conclude that if Δ>0 we have one real solution that is given by the Cardano formula and two additional complex solutions.

If now Δ=0, then from the Cardano formula we get:

x1=3√−q

2+ 3√−q

2−a

3=2

3√−q2

−a3

(17)

and from equations 15 and 16 above

x2=x3=−3√−q2

−a3= 3√ q2−a

3Є ℝ. (18)

Hence from the above, if Δ=0, we have 3 real solutions and two of them are equal.

Candidate Number: 00****** 8

Page 11: Polynomial Equations - Cardano v9

Let us now investigate the condition Δ<0.

In this case the solution in (13) above becomes

t 1,2=−q2±i √−( q

2

4+p3

27 )=√−p3

33 (cosθ± isinθ) (19)

Where θ=arccos (−q2

√−p3

27) (18)

Using now De Moivre's9 formula we can calculate the 3 roots of t1 and t2 which are equal with y1, y2 and y3.

Hence for k=0, 1 and 2 we have:

y1,2,3=(t 1)13 =(√−p3

33 (cos (θ+2kπ )+isin(θ+2κπ)))13=¿

¿3√√−p3

33 ( cos (θ+2κπ )+isin (θ+2κπ ) )13=¿

¿√−p3 (cos ( θ+2κπ

3 )+isin( θ+2κπ3 )) (20)

y1=√−p3 (cos( θ3 )+ isin( θ3 ))

y2=√−p3 (cos( θ+2π

3 )+isin (θ+2π3 ))=¿ (21)

y3=√−p3 (cos( θ+4 π

3 )+isin (θ+4 π3 )) (22)

By using the (-) sign of equation (19) we get 3 more values of y which are:

9 http://en.wikipedia.org/wiki/De_Moivre's_formula

Candidate Number: 00****** 9

If Δ<0 then p has to be negative

Page 12: Polynomial Equations - Cardano v9

y4=√−p3 (cos ( θ3 )−isin( θ3 )) (23)

y5=√−p3 (cos( θ+2π

3 )−isin (θ+2π3 )) and (24)

y6=√−p3 (cos (θ+4 π

3 )−i 12 sin( θ+4 π3 )) (25)

Since x is the sum of the roots that come from t1 and t2 of equation (15) we get 9 pairs of y and hence 9 values of x. Out of these we keep the 3 real values, which are the following.

x1= y1+ y4=2√−p3co s (θ3 )−a3 (26)

x2= y2+ y5=2√−p3

cos( θ+2π3 )−a3 (27)

x3= y3+ y6=2√−p3

cos (θ+4 π3 )−a3 (28)

Hence we have concluded that if1. Δ>0 we have 1 real and 2 complex solutions2. Δ=0 we have 3 real solutions and at least 2 of them are equal3. Δ<0 we have 3 real solutions which are different to each other.

It is clear from the above work that although any 3rd degree polynomial equation can be solved using the initial Cardano method but extended with the todays knowledge of complex numbers, the solution is pretty cumbersome and complicated to do by hand. This gives high risk to mistakes in solving general 3rd degree equations by hand.

The solution however, as described above, suites perfectly for developing computer programs to solve the general 3rd degree polynomial equation.

After searching the internet for such a solution for Microsoft Excel I did not find any available. I was then tempted to make one myself. Indeed I developed such a programme on excel VBA10. I defined three functions which I called Cardano1(a,b,c), Cardano2(a,b,c) and Cardano3(a,b,c). These functions can be used on excel like any other inbuilt excel functions and give the 1st, 2nd and 3rd solutions respectively by selecting the different a,b,c in the equation x3 + ax2 + bx + c = 0.

If the solutions are real, the functions return the real number. If the solution is a complex number then an alphanumeric string is returned in the form of r+iz, where r is the real part and iz the imaginary part. In next page a list of the function results of a number of

10 The code is presented in Appendix A at the end of this report.

Candidate Number: 00****** 10

Page 13: Polynomial Equations - Cardano v9

such equations is presented together with validation of the results (ensure that the result becomes zero if the derived solutions are entered into the actual equation. .

Candidate Number: 00****** 11

Page 14: Polynomial Equations - Cardano v9

Table 2 : Examples of solutions of the equation x3+ax2+bx+c=0 using the Extended Cardano based developed Excel Functions CARDAN1(a;b;c) , CARDAN2(a;b;c) , CARDAN3(a;b;c)

a b c x1 x2

Real part of

X2Imaginary part of X2 x3

Real part of

X2Imaginary part of X2

-0.75 0.1875

-0.015625

0.250000 0.250000 0.25 0.00 0.250000 0.25 0.00

6 11 6

-1.00000

0 -1.000000 -1.00 0.00 -2.000000 -2.00 0.00

0 -15 -44.00000

0 4.000000 4.00 0.00 -0.267949 -0.27 0.00

3 3 1

-1.00000

0 -1.000000 -1.00 0.00 -1.000000 -1.00 0.00

3 3 -20.44225

0-1.7211247852 +

i 1.2490247665 -1.72 1.25-1.7211247852 - i

1.2490247665 -1.72 -1.25

2 10 -201.36880

8-1.6844040539 +

i 3.4313313502 -1.68 3.43-1.6844040539 - i

3.4313313502 -1.68 -3.43

1 0 -21.00000

0-1.0000000000 +

i 1.0000000000 -1.00 1.00-1.0000000000 - i

1.0000000000 -1.00 -1.00

-4 1 26

-2.00000

03.0000000000 + i

2.0000000000 3.00 2.003.0000000000 - i

2.0000000000 3.00 -2.00

-7 17 -153.00000

02.0000000000 + i

1.0000000000 2.00 1.002.0000000000 - i

1.0000000000 2.00 -1.00Validation of the solutions

-0.75 0.1875

-0.015625

0.000000

0.000000 0.000000

0.000000 0.000000

6 11 60.00000

00.00000

0 0.0000000.00000

0 0.000000

0 -15 -40.00000

00.00000

0 0.0000000.00000

0 0.000000

3 3 10.00000

00.00000

0 0.0000000.00000

0 0.000000

3 3 -20.00000

00.00000

0 0.0000000.00000

0 0.000000

Candidate Number: 00****** 12

Page 15: Polynomial Equations - Cardano v9

2 10 -200.00000

00.00000

0 0.0000000.00000

0 0.000000

1 0 -20.00000

00.00000

0 0.0000000.00000

0 0.000000

-4 1 260.00000

00.00000

0 0.0000000.00000

0 0.000000

-7 17 -150.00000

00.00000

0 0.0000000.00000

0 0.000000

Candidate Number: 00****** 13

Page 16: Polynomial Equations - Cardano v9

4 Iterations

If the Cardano based solution was not available then the only available alternative would be to solve the 3rd degree polynomial using one of the iteration methods. One such method is the Newton Raphson method. Defined as follows:

xn+1=xn−f (xn)f ' (xn)

Where f '( x) is the derivative of f (x). (28)

It is beyond the scope of this report to investigate the Newton Rapson method or any other iteration method. The general philosophy of the iteration methods is is to assume an initial value x1. Using then the iteration formula, in the case of Newton Rapson method the formula (28) above, the values of x2, x3 and so on can be calculated. Providing that the iteration sequence converges to a number, this number gives the required solution.

What is important with the different iteration methods is their convergence behavior (i.e do they converge every time despite the initial guess or not, are there convergence criteria that can be identified?), their convergence speed and the error in calculating the required solution.

In the case of the Newton Rapson method, since the iteration formula depends on the derivative of the function and the function in this case is a 3rd degree polynomial, it is easy to calculate the derivative and hence come up with the iteration formula.

xn+1=xn−x3+a x2+bx+c3x2+2ax+b

(29)

Full analysis of the Newton Rapson method or any other iteration method is beyond the scoop of this internal assessment report. However, having the curiosity to see how the Newton Rapson method works few examples were calculated and are presented in the following table 3.

In the 1st example it converges after 35 iterations while on the 2nd and 3rd after 9 and 7 respectively.

The limitations that seem apparent with this method are: The solution appears to be connected with the initial guess. It is not understood how the initial guess should be made. A computer

program can be written which can loop using initial guesses from –x to +x with steps of p. both x and p need to be specified following further analysis.

The calculations are cumbersome. Computer programs can be written however that solves this issue.

Table 3 : Examples of cubic equations of the form x3+ax2+bx+c using the Newton Raphson Method

Candidate Number: 00***** 14

Page 17: Polynomial Equations - Cardano v9

FX DFX FX DFX FX DFXA -0.75 6 3B 0.1875 11 3C -0.0156 6 -2xi 3 20.796875 22.6875 3 120 74 3 61 48

1 2.08333 6.162037037 10.083333 1.37838 35.1805 33.2403 1.72917 17.328 22.345052 1.47222 1.825788752 4.4814815 0.32001 10.1673 15.1473 0.9537 4.4572 11.450863 1.06481 0.540974445 1.9917695 -0.3512 2.8334 7.15544 0.56446 0.8291 7.342584 0.79321 0.160288724 0.8852309 -0.7472 0.71349 3.70855 0.45155 0.0584 6.3209685 0.61214 0.047492955 0.393436 -0.9396 0.13199 2.37342 0.44231 0.0004 6.2407666 0.49143 0.014071987 0.1748604 -0.9952 0.00967 2.02886 0.44225 2E-08 6.2402517 0.41095 0.004169478 0.0777157 -1 6.8E-05 2.0002 0.44225 0 6.2402518 0.3573 0.001235401 0.0345403 -1 3.5E-09 29 0.32153 0.000366045 0.0153513 -1 0 210 0.29769 0.000108458 0.0068228

11 0.28179 3.21356E-05 0.003032312 0.2712 9.52166E-06 0.001347713 0.26413 2.82123E-06 0.000599

14 0.25942 8.35921E-07 0.0002662

15 0.25628 2.4768E-07 0.0001183

16 0.25419 7.33867E-08 5.259E-0517 0.25279 2.17442E-08 2.337E-0518 0.25186 6.44273E-09 1.039E-05

19 0.25124 1.90896E-09 4.617E-06

20 0.25083 5.65617E-10 2.052E-06

21 0.25055 1.6759E-10 9.119E-0722 0.25037 4.96564E-11 4.053E-0723 0.25025 1.4713E-11 1.801E-07

24 0.25016 4.35942E-12 8.006E-08

25 0.25011 1.29168E-12 3.558E-08

26 0.25007 3.82722E-13 1.581E-08

27 0.25005 1.13382E-13 7.028E-09

28 0.25003 3.3612E-14 3.124E-09

Candidate Number: 00***** 15

Page 18: Polynomial Equations - Cardano v9

29 0.25002 9.94343E-15 1.388E-09

30 0.25001 2.94903E-15 6.176E-10

31 0.25001 8.8124E-16 2.749E-10

32 0.25001 2.56739E-16 1.216E-10

33 0.25 7.63278E-17 5.435E-1134 0.25 2.77556E-17 2.44E-11

35 0.25 0 8.818E-12

5 CONCLUSION

I started with an historical review of solving equations of 1st, 2nd and 3rd degree. I was impressed to find out that the Babylonians could solve quadratic equations in 1800 BC. As I was also impressed by the fact that the ancient Greeks had geometrical methods to solve certain cubic equations.

When it came to 2nd degree polynomial equations I realized that the general solution is so powerful, that not only it solves any 2nd degree polynomial equations, but the existence of the discriminant gives information of how many solutions or roots the equation has and whether these are real or complex numbers.

It was fascinating for me to discover that Cardano back in 1545 found a general solution for the 3rd degree equation involving discriminant in a similar way to the discriminant of the 2nd degree equation .

However as Cardano did not have a knowledge of complex numbers his formula gave only one real solution when the discriminant was positive. At a later time with the knowledge of complex numbers was solved completely according to the value of the discriminant Δ. I have named this general solution the Cardano extended solution.

In this report I validated the that if:1. Δ>0 we have 1 real and 2 complex solutions (the real solution was also

found by Cardano)2. Δ=0 we have 3 real solutions and at least 2 of them are equal3. Δ<0 we have 3 real solutions which are different to each other.

Although we now have a complete solution for the 3rd order degree this is cumbersome to do by hand. It fits perfectly however in developing computer programs to give all three solutions. I proved this by developing such a program on Microsoft Excel Visual Basic.

An alternative to the Cardano extended solution of the 3rd degree equation is to do so with iterations. Such a method is the Newton Raphson method which was used to

Candidate Number: 00***** 16

Page 19: Polynomial Equations - Cardano v9

solve few equations. Without doing an in-depth analysis of the Newton Raphson method some obvious limitations were observed and are summarized as follows.

The solution appears to be connected with the initial guess. It is not understood how the initial guess should be made. A computer

program can be written which can loop using initial guesses from –x to +x with steps of p. both x and p need to be specified following further analysis.

The calculations are cumbersome. Computer programs can be written however that solves this issue.

Finally comparing the two methods, the Cardano extended method and the iterations method for solving the cubic equations using computers, the preferred alternative is the Cardano extended method since it gives all solutions, real and complex without the need of any initial guesses.

Candidate Number: 00***** 17

Page 20: Polynomial Equations - Cardano v9

6 Appendix A : Excel VBA code written to solve the cubic equation x 3 +ax 2 +bx+c=0

6.1 Function Cardan1(aa As Double, bb As Double, cc As Double) As Variant Dim pp As Double Dim qq As Double Dim DD As Double Dim t10 As Double Dim t100 As Double Dim t20 As Double Dim t200 As Double Dim TH0 As Double Dim ÷10 As Variant Dim CS As Double Const pi As Double = 3.1415926535897 pp = (bb - (aa ^ 2) / 3) qq = 2 * (aa ^ 3) / 27 - aa * bb / 3 + cc DD = (pp ^ 3) / 27 + (qq ^ 2) / 4 If DD < 0 Then CS = ((-qq / 2) / ((-pp ^ 3 / 27) ^ (1 / 2))) TH0 = Application.Acos(CS) x10 = ((-pp / 3) ^ (1 / 2)) * 2 * Cos(TH0 / 3) - aa / 3 ElseIf DD = 0 Then x10 = 2 * (-qq / 2) ^ (1 / 3) - aa / 3

Else t10 = -qq / 2 + (DD) ^ (1 / 2) If t10 > 0 Then t100 = (t10 ^ (1 / 3)) Else t100 = -((-t10) ^ (1 / 3)) 'VBA can not calculate cubic root of (-ve) t20 = -qq / 2 - (DD) ^ (1 / 2) If t20 > 0 Then t200 = (t20 ^ (1 / 3)) Else t200 = -((-t20) ^ (1 / 3)) x10 = t100 + t200 - (aa / 3) ' this is the cardano formula solution End If Cardan1 = x10End Function

6.2 Function Cardan2(aaa As Double, bbb As Double, ccc As Double) As Variant

Dim ppp As Double Dim qqq As Double Dim DDD As Double Dim t102 As Double Dim t202 As Double Dim t1020 As Double Dim t2020 As Double Dim TH02 As Double

Candidate Number: 00***** 18

Page 21: Polynomial Equations - Cardano v9

Dim x202 As Variant Dim x202r As Variant Dim x202i As Variant Dim x202in As Variant Dim x202c As String Dim CS2 As Double Const pi As Double = 3.1415926535897 ppp = (bbb - (aaa ^ 2) / 3) qqq = (2 * aaa ^ 3 - 9 * aaa * bbb + 27 * ccc) / 27 DDD = ppp ^ 3 / 27 + qqq ^ 2 / 4 If DDD < 0 Then If ppp >= 0 Then CS2 = ((-qqq / 2) / ((ppp ^ 3 / 27) ^ (1 / 2))) Else CS2 = -((-qqq / 2) / ((-ppp ^ 3 / 27) ^ (1 / 2))) TH02 = Application.Acos(CS2) If ppp > 0 Then x202 = 2 * (-ppp / 3) ^ (1 / 2) * Cos((TH02 + 2 * pi) / 3) - aaa / 3 Else x202 = -2 * (-ppp / 3) ^ (1 / 2) * Cos((TH02 + 2 * pi) / 3) - aaa / 3 Cardan2 = x202 ElseIf DDD = 0 Then x202 = (qqq / 2) ^ (1 / 3) - aaa / 3 Cardan2 = x202

Else t102 = -qqq / 2 + (DDD) ^ (1 / 2) If t102 > 0 Then t1020 = (t102 ^ (1 / 3)) Else t1020 = -((-t102) ^ (1 / 3)) 'VBA can not calculate cubic root of (-ve) t202 = -qqq / 2 - (DDD) ^ (1 / 2) If t202 > 0 Then t2020 = (t202 ^ (1 / 3)) Else t2020 = -((-t202) ^ (1 / 3)) x202r = Format(((-(t1020 + t2020) / 2) - aaa / 3), "##,##0.0000000000") x202i = Format(((t1020 - t2020) / 2) * (3 ^ (1 / 2)), "##,##0.0000000000") x202in = Format(-((t1020 - t2020) / 2) * (3 ^ (1 / 2)), "##,##0.0000000000") ' this is the negative x202i If x202i > 0 Then x202c = x202r & " + i " & x202i Else x202c = x202r & " - i " & x202in Cardan2 = x202c End IfEnd Function

6.3 Function Cardan3(aaaa As Double, bbbb As Double, cccc As Double) As Variant

Dim pppp As Double Dim qqqq As Double Dim DDDD As Double

Candidate Number: 00***** 19

Page 22: Polynomial Equations - Cardano v9

Dim t103 As Double Dim t203 As Double Dim t1030 As Double Dim t2030 As Double Dim TH03 As Double Dim x303 As Variant Dim x303r As Variant Dim x303i As Variant Dim x303in As Variant Dim x303c As String Dim CS3 As Double Const pi As Double = 3.1415926535897 pppp = (bbbb - (aaaa ^ 2) / 3) qqqq = (2 * aaaa ^ 3 - 9 * aaaa * bbbb + 27 * cccc) / 27 DDDD = pppp ^ 3 / 27 + qqqq ^ 2 / 4 If DDDD < 0 Then

If pppp >= 0 Then CS3 = ((-qqqq / 2) / ((pppp ^ 3 / 27) ^ (1 / 2))) Else CS3 = -((-qqqq / 2) / ((-pppp ^ 3 / 27) ^ (1 / 2)))

TH03 = Application.Acos(CS3) If ppp > 0 Then x303 = 2 * (pppp / 3) ^ (1 / 2) * Cos((TH03 + 4 * pi) / 3) - aaaa / 3 Else x303 = -2 * (-pppp / 3) ^ (1 / 2) * Cos((TH03 + 4 * pi) / 3) - aaaa / 3 Cardan3 = x303 ElseIf DDDD = 0 Then x303 = (qqqq / 2) ^ (1 / 3) - aaaa / 3 Cardan3 = x303

Else t103 = -qqqq / 2 + (DDDD) ^ (1 / 2)

If t103 > 0 Then t1030 = (t103 ^ (1 / 3)) Else t1030 = -((-t103) ^ (1 / 3)) 'VBA can not calculate cubic root of (-ve)

t203 = -qqqq / 2 - (DDDD) ^ (1 / 2) If t203 > 0 Then t2030 = (t203 ^ (1 / 3)) Else t2030 = -((-t203) ^ (1 / 3)) x203r = Format(((-(t1030 + t2030) / 2) - aaaa / 3), "##,##0.0000000000") x203i = Format((-(t1030 - t2030) / 2) * (3 ^ (1 / 2)), "##,##0.0000000000") x203in = Format(((t1030 - t2030) / 2) * (3 ^ (1 / 2)), "##,##0.0000000000") ' this is the negative x203i If x203i > 0 Then x203c = x203r & " + i " & x203i Else x203c = x203r & " - i " & x203in Cardan3 = x203c End IfEnd Function

Candidate Number: 00***** 20

Page 23: Polynomial Equations - Cardano v9

7 Bibliography

1. Analytical solution of a cubic equation: http://www-old.me.gatech.edu/energy/andy_phd/appA.htm

2. Internet Resources for Roots of Cubic Equations http://mathfaculty.fullerton.edu/mathews/c2003/cubicequation/CubicEquationBib/Links/CubicEquationBib_lnk_1.html

3. Solutions of Polynomial Equations - Donald Rideout, Memorial University of Newfoundland http://math2.uncc.edu/~hbreiter/m6105/polynms.pdf

4. Seminar on Advanced Topics in Mathematics-Solving Polynomial Equations - Dr. Tuen Wai Ng, HKU - http://hkumath.hku.hk/~ntw/EMB.pdf/

5. Theory of Equations by J.V. Uspensky 1995 Editorial Limusa, S.A. DE C.V. ISBN 968-18-2335-4 Cubic Function http://en.wikipedia.org/wiki/Cubic_function

Candidate Number: 00***** 21