Pure Mathematics 2: Solution of equation by Numerical Methods

Authors Avatar
Pure Mathematics 2: Solution of equation by Numerical Methods

Introduction:

In this coursework, I am going to solve equations by using the Numerical Methods. Numerical methods are used to solve equation that cannot be solved algebraically e.g. quadratic equations ax²+bx+c=0 can be solved using this formula:

x= -b± V b² - 4ac

2a

Therefore numerical methods would not be used for quadratic equations. I will be working with cubic equation because there is no formula to solve it. There are three methods, which I will be using:

* Change of sign method

* Newton-Raphson method

* Rearranging f(x) = 0 in the form x = g(x)

Change of sign method:

This method is concerned with when a function crosses the x-axis, and by definition changes sign (+ and -). If we are looking the root of equation f(x) = 0. The point at which the curve crosses x-axis is the root. Once an interval where f(x) changes sign then the root must be in the interval.

f(a) > 0

f(b) < 0

Therefore root must be between [a,b]

f(a) < 0

f(b) > 0

Root is between the interval [a,b]

To find the interval of each root for the equation, I'll be doing a decimal search first.

Lets take the equation y = x³ - 12x + 5

x

-4

-3

-2

-1

0

2

3

4

f(x)

-11

4

21

6

5

-6

-11

-4

21

There are 3 roots in this equation and they are in these intervals: [-4, -3]

[ 0 , 1 ]

[ 3 , 4 ]

Now, I am going to use Interval Bisection to find out one of the root. This method is similar to decimal search but instead of dividing each interval into 10 parts, using interval bisection, only need to divide into 2, which is more simpler.

f(x) = x³ - 12x + 5

I am going to use the root in the interval [0,1]

f(0) > 0

f(1) < 0

f(0+1) › f(0.5) = -0.875

2

Therefore f(0.5) < 0

f(0) > 0 f(0.5) < 0 f(1) < 0

Root is in interval [0, 0.5]

I now test the mid-point of [0, 0.5]

f(0+0.5) › f(0.25) = 2.015625

2

Therefore f(0.25) > 0

f(0) > 0 f(0.25) > 0 f(0.5) < 0

Root is in interval [0.25, 0.5]

I will now test mid-point of [0.25, 0.5]

f(0.25+0.5) › f(0.375) = 0.552734375

2

Therefore f(0.375) > 0

f(0.25) > 0 f(0.375) > 0 f(0.5) < 0

Root is in interval [0.375, 0.5]

I am going to continue this process with spreadsheet. Eventually, it will give an interval that is close to the root.

n

A

b

c

f(a)

f(b)

f(c)

0

0.5

5

-6

-0.875

2

0

0.5

0.25

5

-0.875

2.015625

3

0.25

0.5

0.375

2.015625

-0.875

0.552734

4

0.375

0.5

0.4375

0.552734

-0.875

-0.16626

5

0.375

0.4375

0.40625

0.552734

-0.16626

0.192047

6

0.40625

0.4375

0.421875

0.192047

-0.16626

0.012585

7

0.421875

0.4375

0.429688

0.012585

-0.16626

-0.07692

8

0.421875

0.429688

0.425781

0.012585

-0.07692

-0.03219

9

0.421875

0.425781

0.423828

0.012585

-0.03219

-0.00981

0

0.421875

0.423828

0.422852

0.012585

-0.00981

0.001389

1

0.422852

0.423828

0.42334

0.001389

-0.00981

-0.00421

2

0.422852

0.42334

0.423096

0.001389

-0.00421

-0.00141

3

0.422852

0.423096

0.422974

0.001389

-0.00141

-1.1E-05

4

0.422852

0.422974

0.422913

0.001389

-1.1E-05

0.000689

5

0.422913

0.422974

0.422943

0.000689

-1.1E-05

0.000339

6

0.422943

0.422974

0.422958

0.000339

-1.1E-05

0.000164

7

0.422958

0.422974

0.422966

0.000164

-1.1E-05

7.67E-05

8

0.422966

0.422974

0.42297

7.67E-05

-1.1E-05

3.29E-05

9

0.42297

0.422974

0.422972

3.29E-05

-1.1E-05

.11E-05

20

0.422972

0.422974

0.422973

.11E-05

-1.1E-05

.53E-07

The require root is in the interval [0, 1]

When n = 20 the root is in the interval [0.422972, 0.422974]. Therefore, the root should be 0.422973 +/- 0.000001 (6 d.p.)

Root is 0.422973 ± 0.000001

Failure of the change of signs method

There are a few situations where change of signs method cannot apply to some curves.

The first is when the curve touches the x-axis.

The change of signs method will not be able to detect a double root, as there is not change of sign, therefore this is a failure for this method.

The second failure is when there is a discontinuity in f(x)

This is the equation 1 =0 has no root, but the change of sign method will

x - 2.7

converge the root at x=2.7. Therefore this is another failure for this method.

The third one is when several roots are too close together, and I am going to demonstrate why this method will not work for this.

I am going to use the equation f(x) = x³-1.7x²+0.84x-0.108

First I am going to carry out a decimal search

x

-3

-2

-1
Join now!

0

2

3

f(x)

-44.928

-16.588

-3.648

-0.108

0.032

2.772

4.112

-

-

-

-

+

+

+

The root is in the interval [0, 1]. Using interval bisection, I am going to find the root in the interval.

f(0+1) › f(0.5) = 0.012

2

f(0) < 0 f(0.5) > 0 f(1) > 0

Root is in interval [0, 0.5]

I am going to test the interval [0, 0.5]

f(0+0.5) › f(0.25) = 0.011375

...

This is a preview of the whole essay