0% found this document useful (0 votes)
13 views7 pages

Roots: Open Methods: Solving Equations Numerically

Uploaded by

mengeshaawoke663
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)
13 views7 pages

Roots: Open Methods: Solving Equations Numerically

Uploaded by

mengeshaawoke663
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/ 7

Roots: Open Methods

Years ago, you learned to use the quadratic formula

The values calculated with Eq. (PT2.1) are called the “roots” of Eq. (PT2.2). They represent
the values of x that make Eq. (PT2.2) equal to zero. Thus, we can defi ne the root of an
4
y=3+4x -x
equation as the value of x that makes f ( x ) 5 0. For this reason, roots are sometimes
called the zeros of the equation. Although the quadratic formula is handy for solving Eq.
(PT2.2), there are many other functions for which the root cannot be determined so easily.
For these cases, the numerical methods described

Solving equations numerically y=3+4x -x4

Some equations can’t be solved algebraically

and we have to use numerical methods.


1.Interval bisector method
Example1: Solve 3 + 4 x − x 4 = 0 .
Solution
If we plot f ( x) = 3 + 4 x − x 4 we see that the curve crosses the x-axis between x=1 and
x=2. y

1.5

0.5

x
1 2

Therefore there is a root (solution) to the equation 3 + 4 x − x 4 = 0 between x=1 and x=2.
If we want a better approximation we can narrow down the interval.

Let f ( x) = 3 + 4 x − x 4
then f (1) = 3 + 4 − 1 = 6 > 0
and f (2) = 3 + 8 − 16 = −5 < 0
therefore there is a root in the interval x=1 to x=2 y

0.6

0.4

0.2

x
1 1.5 2 2.5

-0.2

we can work out f (1.5)


f (1.5) = 3 + 4  1.5 − 1.5 4 = 3.9 > 0 the root lies between 1.5 and 2
f (1.75) = 3 + 4  1.75 − 1.75 = 0.62 > 0 the root lies between 1.75 and 2
4

if we carry on like this, we can get an accurate enough solution

f (1.8) = - 0.2976 < 0  the root lies between 1.75 and 1.8
1.75  x  1.8
 the root is 1.8 to 1 d.p

Example 2. Show that the equation ln(1 + x) − e − x − 1 = 0 has a root between x=1.5 and
x=2.5.
Find this root to 1 d.p.
Solution
Let f ( x) = ln(1 + x) − e − x − 1
f (1.5) = - 0.306 < 0
f (2.5) = 0.171 > 0  the root lies between 1.5 and
2.5
f (2.0) = - 0.0367 < 0  the root lies between 2.0 and
2.5
f ( 2.25) = 0.0732 > 0  the root lies between 2.0 and
2.25
f ( 2.1) = 0.009 > 0  the root lies between 2.0 and
2.1
f (2.05) = <0  the root lies between 2.05 and
2.1

2.05  x  2.1
 the root is 2.1 to 1 d.p
Exercise

1. Show that x 3 = 14 has a root between 2 and 3. Find this root to 1dp.
2. Show that 2 x = 8 x has 2 roots, the first lying between 0 and 1 and the second
between 5 and 6. Find both of the roots to 1dp.
Answers
1. Let f ( x) = x 3 − 14
f (2) = 2 3 − 14 < 0
f (3) = 33 − 14 > 0 therefore root lies between 2 and 3

f (2.5) = 2.53 − 14 > 0 therefore root lies between 2 and 2.5


f (2.25) < 0 therefore root lies between 2.25 and 2.5
f (2.3) < 0 therefore root lies between 2.3 and 2.5
f (2.4) < 0 therefore root lies between 2.4 and 2.5
f (2.45) > 0 therefore root lies between 2.4 and 2.45

2.4  x  2.45
 the root is 2.4 to 1 dp

2. Show that 2 x = 8 x has 2 roots, the first lying between 0 and 1 and the second
between 5 and 6. Find both of the roots to 1dp.

Let f ( x) = 2 x − 8 x
f (0) = 1 – 0 > 0
f(1) = 2 – 8 < 0  the root lies between 0 and 1
f(0.5) <0  the root lies between 0 and 0.5
f(0.25) <0  the root lies between 0 and0.25
f(0.1) > 0  the root lies between 0.1 and 0.25
f(0.2) < 0  the root lies between 0.1 and 0.2
f(0.15) <0  the root lies between 0 and 0.15

 the root is 0.1 to 1 dp

To find the other root, f (5) = 2 5 − 8  5 = -8 < 0


f (6) = 2 6 − 8  6 = 16 > 0

f(5.5) = 1.25 > 0  the root lies between 5 and 5.5


f(5.25) <0  the root lies between 5.25 and 5.5
f(5.4) <0  the root lies between 5.4 and 5.5
f(5.45) > 0  the root lies between 5.4 and 5.45

5.4  x  5.45

 the root is 5.4 to 1 dp


2. Fixed point iteration x = g (x)
This is also repetitive procedure which leads us closer and closer to the precise answer

Example 1
Consider the equation x 2 − 5x + 2 = 0
y

15

10
y=x2 - 5x +2
5

x
-4 -2 2 4 6 8

-5

-10

f(0) = 02 – 5(0) + 2 = 2 > 0


f(1) = 12 – 5(1) + 2 = -2 < 0
 f(x) must be 0 between 0 and 1 and so one solution lies between 0 and 1

Similarly
f(4) = 42 – 5(4) + 2 = -2 < 0
f(5) = 52 – 5(5) + 2 = 2 > 0
 f(x) must be 0 between 4 and 5 and so the other solution lies between 4 and 5

Rearranging the equation x 2 − 5x + 2 = 0


x 2 = 5x − 2
x =  5x − 2

make an iterative formula x n +1 = 5 x n − 2


(we need +ve square root for 5 x n − 2  0 for all n)

we can now use this to get a sequence of solutions which get closer and closer to the root.

We will start with x0 = 4


then x1 = {5(4) –2} = 4.242640687
x2 = {5(4.242640687)-2} = 4.38328683
x3 = {5(4.38328…….-2} =4.4627832029
x4 = =4.507096199
x5 = =4.531609096
x6 = =4.545112262
x7 = =4.552533505
x8 = =4.556607019
x9 = =4.55884142

 x = 4.56 to 2 dp
To find the other root, we need to re-arrange the equation x 2 − 5 x + 2 = 0 in a different way:
xn + 2
2

Let’s try x n +1 =
5

Let x0 = 4
then x1 =3.6
x2 =2.992
x3 = 2.1904128
x4 = 1.359581647
x5 = 0.76969245
x6 = 0.518485293
x7 = 0.4537654
x8 = 0.441180607
x9 = 0.438928065
x10 = 0.438531569

 x = 0.44 (to 2 dp) ie the smaller root

So how we arrange the equation and the starting value we choose can lead us to different
roots

We find x 2 = 5x − 2 x 2 = 5x − 2 gives x = 4.56 to 2 dp

x2 + 2
5x = x + 2
2
x = gives x = 0.44 (to 2 dp) ie the smaller root
5

2
Or x 2 = 5x − 2 x = 5− gives x = 4.56 to 2 dp
x

−2
Or x ( x − 5) = −2 x = gives x = 0.44 (to 2 dp) ie the smaller root
x−5

Some of the iteration formulae lead to the first root and some to the second root

Generally, when an equation has two or more roots, a single arrangement will not find them
all.

Each iteration formula may give only one root, so that for an equation with 3 roots, you may
need 3 iteration formulae, and so on.
Starting points for iteration
It saves time if you can use a starting point which is close to the root.
To do this, find an interval in which a root lies. That is find two values a and b such that
if f (a ) > 0 then f (b) < 0
The method converges for |g′(x)| < 1

Example 2

Show that the equation ln x − x + 2 = 0 has a root between 3 and 4.


By using the iteration formula x n +1 = 2 + ln x n and starting with x0 = 3, find to 3 s.f. a root of
the equation ln x − x + 2 = 0
Solution
Let f ( x) = ln x − x + 2 then
Then f (3) = ln 3 − 3 + 2 = 0.0986 > 0
f (4) = ln 4 − 4 + 2 = -0.6137 < 0
 a root to the equation lies between 3 and 4

x n +1 = 2 + ln x n
x0 = 3
x1 = 3.098612289
x2 = 3.130954361
x3 = 3.141337866
x4 = 3.144648781
x5 = 3.145702209
x6 = 3.146037143
x7 = 3.146433611
x8 = 3.146177452
x9 = 3.146188209

 x = 3.15 to 3 s.f.
http://www.youtube.com/watch?v=OLqdJMjzib8

Exercise
1. Show that the equation x 3 − x − 2 = 0 has a root between 1 and 2, and can be arranged in
the form x = 3 x + 2 .

Use the iterative formula


x n +1 = 3 x n + 2 to find the value of the root to 3 d.p.

2. Show that the equation e − x − x + 2 = 0 has a root between 2 and 3.

Use the iterative formula


xn+1 = e − xn + 2 to find the value of the root to 3 d.p.

3. Show that the equation e x + x − 6 = 0 has a root between 1 and 2.

Show that the equation can be arranged in the form x = ln(6 − x) .


Use the iterative formula
xn+1 = ln(6 − xn ) to find the value of the root to 3 d.p.

1. 1.521, 2. 2.120, 3. 1.503


Ans.

You might also like