Summarised Notes
Summarised Notes
~
!
.
I ,.._~ {
'
. :_
j'ff\
I\ ! bCf+- Review of Ca1~'.1lus and Simi,;
'
- ✓
- -, ' ·____1.,.,.,
:trical Method~
..
I
~~ .", 1 ·1
Review of Cale~
.
,~
•• 1
l
-~
...
~
°""'~~>
'~
3
"
-- -~
,.,
Definition 1,4 Let f be a fu11 1 ' :-in defined o~ a set X of real
numbersI th·en f IS
·
• • Sal'd The con~ept of integration is also basic in calculus and plays a.n importan\,.,rolc\ r.
Lu J.at'e. the limit A at a, wr,/1 , \ numerical methods. The following definitions and theorems are fundamental in integral.
calculus. ""
lim f(x)
X-tQ
= .4.
'
Definition 1.7 (The Definite Integral) Let f be defined on :z: E [a,b), and a =
,..,
if fo r euenJ E > 0 we have o"' 6(e)? 0 such thatlf(x) - Al < E for O<Ix-al< 5€,- 'e t ,
Definition 1.5 A functio11 J(x) is continuous at the point x = ~ if
Xo < x1 < · ·· < Xn = b be an arbitrary partition of this interval into n subinterval!.
Then the limit of the integral sum
. ~
n-1
1. this function is defined at{, that is if f(~) exists;
Sn = °E m,)t.:z:i •
2. there exists a finite limit iim f (r ) = i({). . ,,.. . i=O
%--+{ -l\,
where
The [un~tious we shall be. consiclcrir,g in MTD303, Numerical Methods, are singie- :r; ~{i ~Xi+I, ti.x; =Xi+! -Xi, i=0,1,2, ... ,n-1,
valucd and continuous, .:c\,ept otherwis'e stated. The above definitions important are as n-+ ~ and max t.:ri -+ 0, is called the definite integral off on x E [a. b), that is,
as we shall be deal~ witltc,!nti9uous-tunctions which present cases for approximating • I
solutions. -ii; "';! n-1 J.b f(x)dx
{ · lim ~ f ({i)t.x; = . . (1.2)
ma,ul:i-+0 i=O
1 Definition 1.6 Let f . be defined in an open interval X containing a, then f is said to
'ff
0
;f be dI erent'1able. at a IJ·• z1·un J! ·r) - f(a) exists. If this lir it exists it is denoted
- ---'-"" · by
•.
I ➔a .! - 0
I Theorem 1.5 (Second .Mean Value Theorem) Let f(x) ~ 0 be continuous and
f'{n) and is ca!!ed_t)ie derivati, ···off. at a. A function thar ,i as a dedvative at each j monotonic decreasing on [a,b], and g(x) ~ 0 be continuo1Js on [a,b]. Then there e:z:i., ts
I
number in X is said to be ·diff- :·s:ntiable im ;(_. The dcrit·-,tiue of f at a is the slope _~ number ~ in (a, b) sµch /ha!
ct
of the tangent line drawn ih ; point (a,f(a)) of the graph off .
··i\' · J. f\x)g(x)dx = f (~) J. g(x)d:z:.
· b .
t
b
Theorem 1.1 If a function f .- differentiable at a J> Oint a, then it is continuous at thi3
'
point. The reverse is •not true: a co11tinuous f,mction is not necessarily differentiable.
. . ..3-'i ' .
I When g(x) =1, this theorem gi,es the average of the function f on [a, b]. In this case
The theorems that follow are of fnndamental importance in the estimation of the re- I J!
we have f (x)dx = (b - a)/({) known also as the first mean value theorem for
!
1
,r
cation of the remainder te1m as ,ve try to justify the accuracy of the calculations. In
regards_to that we give an important theorem on Taylor's polynomials.
:' interior to (a, b) such that ·
/(b) - f (a) = (b- a)f1{0.
·
(1.1)
vffeorem 1.7 (Taylor's Formula) If a function f is continuous and I.as continuot1s
derivatit•es up to and including the n th order deriuatiue on ~ . anti f (n +I ) exish cmd
is finite on (a, b), then Taylor's formula for every x E [a. bJ is
T h<'orcm 1.4 (Cauchy's Theorem (Ex.tended Mean Value Theorem)) If J and
'.I arc real valued Cl)11 linuous fun ctions on [d', bt and diflerentinble on (a, b) and, g'(x) f. 0 f (:r) ;= f (c) + (:i: - c) J1( c) +(x -2\c)2 J" (c) +... + (x - c)" f (11 ) (c) + (:r - c)"-1 Jl"+ I\ ( ' ).
a1A gl /J) f. /(a), Ihm ~ n1 (1t + I )\ '
(/(b) - / (c1))g'(~ 1 -. (y(b) - g(a))/1(~), where a S-: ~ < b. where~ = r + O(x - c). 11 < c <band O < 0 < I ,., true 011 lh• 111lrt 1•111
...
4
) ,._.
4
.. ' , ',n.. ~
Yo+- Yn
f(x)dx ::::: h(-
2
+ 1/l + 112 + .. · + 1/n-l) = h (!/o +Un)+ h ""
L..., Iii
2 i= I
\\.:J )
·~ ~';
•
Review -of Calculus and S_i_~le Numerical Methods
~ - Unit 2
i
Approxi~a ting a· Number ~:- .. -~
_ :'J-
.
•
. ,,.,.,, f:., ~
~
('
with absolute error of
Rn~
h2
12 (b-a)xM2,
• ft
,.. . ~,
where M2 = max \f (x)\ for x on [a, b]. ,:~'
Example l.S Find the area below the cun,e of the function e% between x = 1.8 and
x = 3.4 using the step size h = 0.2. What This Unit is All About
This Unit discusses -the .ea.ors involved fa appi:_oximating a number. In Numerical
Soluti~n Methods it iii important to be aware that computed solutions may not be exact. Hence
the need to identify, and be able to evaluate the errors.,
Using the formula above we have
By the end of this U,nit you should be able to:
= !3.4
02 .. .
b
·. e%~ = t
l a
ftx)dx
1.8
jO-
" ~·
i{6:os 2(7.3~9) + 2(9.025) + 2(11.023) + 2(13.464)
.. -!- +2(16.445)"+'2(20.086) +2(24.533)
. + 29.964}
(i) define and evaluate absolute and relative errors that result from approximating
numbers,.
= 23.9944. (1.6)
(ii) describe different sources of errors,
_The exa.ct value tq four decimal places is e3·4 - el.8 = 23.9144. For this example, the (iii) determine a number to correct significant digits or decimal places,
absolute error expression gives: .
SUMMARY
Ett~ <_
-
10;~' (3.4 - 1.8);;:~,
0.0321 ® (iv) understand the concept of number representation in a computer.
2.1 Introduction
After going through this chapter, you should be able to: In measuring things we often come up with approximate measurements. The problem
of estimating accuracy is an important one: In most situations, calculations are done
1. _Recall important definitions and theorems of the differential and integral calculus .with approximate .numbers and in an approximate ,vay. Therefore, there is a need to
·relevant to tlie study of numerical methods. identify, define and be able to evaluate these errors.
•.• ·:, 1
"' ~ a l l Taylor's formula with a"iemi.inder. I
l
Q. Recall and use Newton's interpolation formula. l 2.2 Absolute and l3e)ative Errors
I
I
@1tecau and use the Trapezoidal formula~ i· Definition 2.1 A number a• is said to be an approximate number to the sxact
I number a, if it differs slightly from a. This approximate number, a•, is called a minor
:
approximation i/ it ~ than a and a major approximation if it is greate~ }
a.
.For example, 1.73 is a· minor approximation of J:i, wherea~ 1.74 is a 1;utjor approxi-
mati,:m of the same number. If a' ·is an approximate ,'a\ue of the numhe.r n, we writP.
n• ~a.
\t\_ .J
Definition ·2.2 The difference betwP.en the exact nmnl,er a untl the tippm:r.inwle 1111m-
ber a' is known as the error and is -sometimes denoted as 6.~, that i.•, 6,r, = a - ri' ,
where 6.a < 0 for a< a• and 6.a > 0 /or a. > a'.
j
.l.
~ -,
•
f
~
8 ' Approximatjng a Number Apprc • .1 ng a Number 9
.,,,
,, ;, ,:i,;. ~ign of the error may not be known and hence i~ is important that we use the meaning that
'~ ab.i;_olh te error of the approximate number, 6. 16.aj. = t... = 2.719 - 2.7 = 0.019.
Definition 2.3 If a• is an approximation to a, th~ absolute error is given by • It should be noted that I.here is an infinity nonnegative numbers A. satisfying the
inequality (2 .2) . Logically, all numbers greater than the limiting absolute error of a
6. = la - a"I - . (2.1) given approximate number satisfy inequality (2.2). Therefore, for practical purposes it ·
is proper to consider the smallest t... out of the infinity set.
{fore two situations are to be clarified. If:
We also take note of the fact that the accuracy of a measureme nt or calculati:on is
l. the number a is known, then the absolute error 6. is immediately determined not guaranteed by the abs0lute error (or the limiting absolute error) . This can be
from (2.1); easily seen in an example wJ,_ere in measuring the lengths of two rods of lengths 200.4 r
and 6.3 one allows a limiting absolute error of 0.1 in both cases . Though the limiting
2. the number a is not known, which is most often the case, 'then the absolute error ·absolute error is the same in the two measurements, the first measurement is done . \
cannot be found from (2.1) . with better accuracy than the secon,d one. An essential factor is the absolute error in
··relation to unit length, and is called the relative El&Pr.
. t;.-,.. ,
l
In the case of 2, it is then necessary to give the upper estimte pf the absolute error so
that the absolute error c~ be calculated. .i!f"
Definition 2.5 If a• is an approximation ·to a, then
. ' ~.:;. ~
Definition 2.4 If a• is an approximation to a and 6. the absolute error of the approx-
imation, then A
o=~, ... (2 .4)
6. = la - a• I :5 t... (2.2)
where 6. 0 is called the limiting absolute error of the approxi"!ation. Clearly,
a• - 6. 0 $a$ a•+ 6. 0 (2.3}
t·
I
wliere a• - 6. 0 is the minor approximation and a• + 6. 0 is the major approximation of number not less than the relative error>:-o/ lhat number. For example · . . '
a.
. • I). • I
Example 2.1 Detennine the limiting abs~lute error of the approximation number;!'= o s .s. ·or- lal < .s. or I). _-5. ialo. (2.5) I
I
I
2. 7 to the number e. ·
Solution
Clearly, thl_l limiting absolute en:or of a number a• can thus be taken as
\
I
From (2.1) we have the inequality
6.
/
= ,~-2_.71 $ t.. • . .
_r
Considering (2.6), then (2.3) becomes
A0 = ial.Sa"" ia•jq•
.. (2 .6) ~
...
Thus,
Since e > _2. i and e < 2_.72,
2.7- 6. 0 $
then
e $ 6. 0 + 2.7.
or - a• - a"6a $a$ a•+ a"<>u
a"(~ - 00 ) $ ~. -5,•a"(l + Oa)
.., (2 .7)
\
le - 2.11 < 2.1~ - 2.1 = 0.02.
This is sometimes written as .,
Hence · · -6v
t-... Q tJ a = a"(l ± .Su)-
A IHO
Ag= o.o_2.
2. 7 ·: t: < 2.71 9_'.'I
l,.;>G\
Example 2.2 Th e weight of ldm~ of water at 0°C is yi uen ·ail 1J = 9!l!l.8-H9/ ± O.Olll yf
(af=9ru.m force) . Dcte1·mi11c th e erro1· of th e 1-csu.lt of wc iyl&in_q th ~ it·nler.
I
\\.
J. :1
,\
~~
J
·Unit at
, . ..
1t.ox,mabng N
20 a umber
. '
(a) Use the three-digit rt••tnding error method, el.53 _
e•r = e(r)n to evaluate f( 1.53) as given above.
= 4.62, and the fact that
.P
Solutions of Non~linear
...
Equations· in One Variable
· ..
' :.,►
~,
(b) Redo the computation in (a) using the nested form off.
(c) Compare the results in parts (a) and (b) to the exact three-digit result
.,
/(1.53) = -7.61. ~
14. Show that, if the number a has more than ~o correct digits, that is n ~ 2, then
for all practical purposes the following formula is true: What This Unit is All About
ur 4 (1.urutmg . error of a) = - l
. . reIat1ve ( -l )n-1 a
This Unit develops variety of methods which can be used for finding numerical solu-
, • 2oml0 tions for the one variable equation f(x) = 0. The convergence of the methods is also
discussed. c-- ·
15. The binomial coefficient By the end of this unit, you should be able to:
-:,,
(m) ml ·
k = k!(m-k)! ../
(i) . perform the root ~elation for an equation /(x) =0 on a given interval, ,
describes the number of ways of choosing a subset of k objects from a set of m
elements. Suppose decimal machine numbers are of the form = 0 by using the root jso!atjQJI, !Eaphical, bisection,~.
(ii) solve the equation /(x)
&wton-Raphson, Modified Newton and the iterative methods,
±O.d1d2d314 x 10", l $ d1 $ 9, 0 S di$ 9, and -15 Sn$ 15.
(iii) determine the convergence of successive approximations,
What is the largest value of m for which the binomial coefficient (;) can be
(Iv) determine zeros of polynomials.
computed by the definition without causing overflow?
3.1 Introduction•
For all practical purposes, the application of mathematics to physical problems leads
to numerical computation whenever analytical methods do not yield explicit results
or their form is complex for any practical use. Some of the most commonly used
numerical methods relate to the solution of algebraic equations in one variable. Various
numerical methods for finding the approximations to the solution of equations that are
not susceptible to algebraic methods are discussed in this unit. The evaluation of errors
for each method used is also an important feature of the of this chnpter.
3.2 Isolation of Roots
If an algebraic equation is fairly complex, it might not be possible to find the exact
roots for it. The situation is worsened if the coefficients in the equation are only known
· approximately, since the exact roots become meaningless. Evidently, the method~ for
approximating th~ roots of au equation and estimating their degree of accuracy must
play an important role in mathematics and science.
In beginning this method, we consider an equation
f(:r.) =0 (~.!)
21
f 22 Solu. ,f Non-linear Equations in One Variable
. '
' utions of Non-linear Eq~ations in One Va6able
-
/It.' where the functiou / (x) is defined and is continuous on sqme finite or infinite interval
11 11 -:/ f(x)
'a < x < b. If/({) = 0,then tile value { E [a, b], is. called a root of the equtJion
(3.1) (sec Fig.I). ·
y
J'(x) > 0
'(,BJ
Ii
I O
I
{/
,
I
,8
__,_
:z;
a
'{ e X
J(a
Fig. 2
•l Fig. 1
I
· I
The signs of the function f(x) are then determined at a number of intermediate poinb
.;.I x = 01, 02, · · .: the choice of which is dependent on the nature of the function J(x): I
,, at the points ok and ok+l the product J(ok) · /(ok+tl < O, then equation (3.1) has I
'I,. ',! root in the interval [ok, Ok+r], A method of halving (bisecting) of the interyaJ is the1
Further, we assume that equation (3.1) has only isolated roots, for example, all the
.. J used to locate the roots. Refer to the Bisection method in section 3.4.
roots of (3.1) belong to intervals that do not intersect. For the approximation of the
r i
roots of the e.quation (3.1) we follow the following procedure:
Note that an n-th degree algebraic equation
1
1. isolate the roots. This is a procedure to identify the smallest possible intervals
aox" + a1x"- + · ·· +an = 0, (ao # 0), ai E IR, i = I, 2, · · · n.
I : [a,ti] containi~g one and only one root of equation (3.1); has at most n real roots. In that way n + I sign changes on [a, P) assures us of the.
I.
l , is~l_ation of all the roots of the equation (3.1).
2. improve the values of the approximate roots, that is, refine the roots to the
required degree of accuracy. Example 3.1 Isolate the roots of the equation by obtaining the sign cha119.es off on
the infinite interval (-oo, oo).
f( x) =;c3 - 6x + 2 = 0.
To start the process of isolation of roots; an interval [a, /3] is identified
with /(o) • f( /3) < 0. In that way the interval [cr.,Bj contains at least ~ne root of
lhc equation J(x) = 0. If/({) = 0, then the root~ will definitely be unique if the Solution
!. ,ti•rivatil·e f'( i:) ,:xists aud retains the same sign thro11rrhout the interval [er, ,BJ. For
••xarnplc. J'(.r) > 0 (or J'(x ) < 0) for rt<£.< ,B (w r'ig.2). Table of rough estimates of the intervals as indicate.cl hy the sign chauges:
l , ~x) 11 -- 1·.3 1~ I ~ I '. I : I +: I
00
•• 'I;,:
2:1 Solo<ioo, of Noa- Ii,,,,. ;.., io O"' Vaoiabl•
Tims, our equatiou has thr- ·· roots in the intervals (-3, =--1),
(0, l) and (1, 3). 3.3
•
S~lutions pl 1~on-linear E.9uations in One Variable
Graphical Meth od ,,l.!i_...fJ
C.
25
If the derivative of the !11nction /(x) is continuous and the roots of the equation
"'-!:1'
J'(x) = Ocan be founrl . :h,•n the process of isolating the The-approximation of the roots of/(,·) = 0 can be foun<l as
roots is simplified. For exam- the x-cnorclinates of the
points of intersection of the graph with the x-a'(is (sec Fig.3).
ple, it is sufficient to l'l'llt,nine the sign of the function at
the points "{here /'(x) = 0
and the end points of •he interYal.
Example 3.2 Isolate the roots of the equation in Example 11
3.! by using the derivative
of f(x) approach.
~
Solutio n
For the above functio n/, we ha,·e f'(x) = 3x 2
·"--'6 = 0. The ..-alues of :r satisfying the
equation are x = ±./i.. Thus L(./2) < 0, f(-./2) > 0, f('Xl)
-- - x llcncc, the equation has roots in the intl'rvnls;· - -- -
> 0 and f(-oo) < O. #
(-oo,-- 12), (-V2,V2) and (-/2,+oo).
. Theore m 3.1 (Error of an approx imate root) Let { E (a.b] .be an e:tact root and
:i: E [a, b] an approximate tc,v! of the equatiori. f(x) = 0, anJ
x E (n,P] (mi' cau be ta/&l'•r• 1,e the least value of lf'(.r)! for
lf'(:r.)I ;?; m1 > 0 fo r I (I , · • b
a$ :r $ (3). Thei, the -~ ~ ~,,
Jollowi119 ineq~ality hold.<:
·- Ix - {I ::; 1/(:rll
m1
{~.2) \_ _/ \
1ediate points: Fig. 3
ction f(x) . lil Proof
,n (3.1) has all Here we use the menn-valur t!worem for the derivatives:
terval is then
f(i) - f(() = (x - {)J'(c), (3.3) .
/''
whrre 1is some number intrnncdi;tc between x and ( . . .
But, since J(~) = 0 an,! . Equation (3. !) is usnnlly repl;,rccl 1,y an r<Jlli\'alent cq11atinu
oft hP. form
lf(c)(;? ; m1, then ,:,(,·) = t/•{,:)
lf(:?J - /(01 = IJ{;:)I e?: 11111.i: - ! i (:l..J)
1vhcrr the functions ¢,(x) an<l 1b(:c) arc simpler than/( ,·).
ur
-es us of the f l:r.-!I '.S 1/(:rll_
1111 Note: Two equations are cal!crl equiva lent ii' thPy han• ~xMtiy
Ll1L' same r<Jols .
The thrornm is pro"r.d. ~
Now 1 instead of ri.•t1!--i h'ri11g t h l' i11trr:-ir,•iicm of t]11 : ~raplt
1
,gr.a off on ·;·111' arcurar:y of the root b 11~111,lly approximatl'<l hy hnw nr
/( .r) wit Ii !J =: II. ,,:,·
ITI'll it satisfies thc ·cq11a- ron~id,•r tl11• i111 "•" ·•·tic,11 c,r
th, · p;rapl1., of ,,\(.r) a111 I , ·1.i:). Thr :r-,·,,,11·rli11:i 1,, 11,j, or
. ti,\n f l.r) = 0. F01: 1•xamplc. if th,· 1111111hcr l.f\.n; is s111:ill. p\;iut of i11l•'r,. : 1•t·:i ·'.. i:. 1!1, rnr, r 11f 1h" 1•q1P1ti,,11 {:.J.l) .
rhrn J is ns,nmr<l t~ f"'·"
.l!.,o,·I approxi mation to thP t;xilt' I n;ot ~-
~ - Examp le 3.3 ' ' _,·.,f!:11! ; ,._1; rr;,1111 ;, ..,. 11 -:i11!J 1/u.• !j "·•1,h itol m ,·J/, 11,/:
\\'iJrn :q,plyin g I hl' Jllt'I ho• I r,[ is,ilat irm .J.i,,nts . · ir ~~ 1rmP1"l"•r,•1l th<lt an ').. "i
111/r -,h•i.;1 "' .,l~•·hrall' ,•q11a1
I,,.. ma'fl r>xhaw.:H \'f•ly i 11 onl•·r
,. ·,
rn
h,,, ,11
rlntrn 1
,.,J;,1
li111
,df:.,
11•,il '!'ln1•. ,I,i, tnNh"<i ~111) ,.)r
rill' iutcn·:,I ~ ,.( ~u ·b· ri1N!-- ,,f t!tr• 1•tpia•
~ -·=e -::z...-o
r ir,11. 111 ,,n l, ·r t11 :1..,·,·rt:ii11 Iii ,· 1/11•rl' i:i ,11d_ , · 111w 1·, •,,I i11 :, ,:j··•·11 i::1, r•::d !:II' hnlving Snltrtiu n
1.1rorc-~.,; i- ,..·,,,nl't :ipp/i1 •1 r:d. i, , ; i:- h d•.,•,~ >·.•;·•
, ;11;d · -, -... t11d
i: 111·~ .•! ·; lw i11l1 :• i:.,:· . ,·i·..:lir. ,,. ,
111, .. i: :1 , 1f •· , 1 •u •rrni :11•11 :;, 1:,: 1•11d i ":i· ·· ,1 ,-,'., i· i:,1 1 l t ~ •I i ! ! : If • ' f i l!
:··· 1! '1
ii: r : ... 1;,, '" .! . :
' ., '1..
c.!,'.)( :=- e?l.
............_ .
26 . Solutions of Non.
11
·
2 22 23
-,
nic non-de creasin g bound ed st
reasing bound ed sequence. Thu
·
\ Fig. 4 from (3.6)
I . . (b n-On )
Iim l'1m -
= n➔oo b --a= 0
(3.1
f.
.,. Hence
n➔oo 2n
('
E= limbn = liman (3.1 .
·~l~'
The toots of this equation are found as the :i;-coot
n➔ oo n ➔ oo
dinates of the points of intetsection ·
'. oJ the parabo la.'3:i:2 and tee cUIVe of the exponential
functio n ez . The graphs of the
Toking the limit in (3.5) as n ➔ oo gives, /(x) is continu ous on [a,b1, \/(~)\ 2 ~ 0. Th\
: :1 two fuctions are shown in Fig.4. With the graphs
is possible only if/({) = 0, meaning that Eis a root or
drawn on a coordinate paper, we get equatio n (3.1).
t
t an approximate value of the only root { = 0.9 of the
equation.. • If there are two. or more roots on
I
i( It should be noted that although graphical method
s of sol~ing equations are com·
[a, b1, then
the roots. It is then repeate d on the other interva
the metho d can be used to find one o ·
l to obtain the other roots. Becau~
. J, paratively simpler than other metho of'the amount of compu tation tha.t is SOIJ,leti
;~ ~, they
0£ the roots. Regarding accuracy of the solution
tend
,
to
we
be only used for rough estimates
needed, this method is best suited for applica tion
mes involve d, depe11ding 011 the a.cc11rac1
using a compu ter.
see that if two lines meet in a
I :-.• sufficiently small angle, then the determ ination of the exact intersection point- maybe
a problem . Also, not all functions ha...:e graphs that
Me ea:,y to draw .
Exam ple 3.4 The equation x 4 + 2:i: 3 - x - l = 0 has a root in the inte1··ual \0, 11
.
/(0) = -1 and /(1) = 1. siM
Activi ty 3.1 Solve the _equation :i; log 10 x = 1 graphic
ally. -
n an bn ~n mn)
1 0.0000 l.OOQO . 0.5000 -1.1900
3.4 The Bisection Method 2 0.5000 1.0000 0.7500 -0.5900
3 0.7500 l.OOj)O 0.8750 0.0500
This method involves finding a root of an equation
of the form J(x) '.:.-0, for a given -1 0.7500 · 0.8750 0.8125 -0.3040 I
function f. · ._ 5 0.81250 0.8750 0.8-138 -0.1350
6 0.8-138 0.8750 0.85!)-I -0.0430
('on!!i<lcr an equation J(:r.) = 0, where J is continuous on \a,b\ and j(a) · f(b) <0 7 0.8594 0.8750 0.8Gi2 -0.0027
(i.c /(ri) and J(b) have opposite signs). 8 0.8672 0.8750 0.8711 -0.026708:.1
I.
~ -,
28
After
•
7 itcmtious· it· is• cl~-,''l'I ti1,1• t t
,7 = o.8672 1s
••
_Solutions of Non-linear Equations-in One Variable
· a good approximation of the root {
;J
'
~
Solutions of Non-linear Equations in One Variable
2!J
"",;•·'
•
with crrnl' · . . y
-~---.
since t he error
I~ - {11 :S 11r, -
lb1·- a1I ·
.- - :::, 0.0181
1°,I
a1I
·
= o.0156
= 1.8 X 10-2' ...
:-VY',l•
%Y· J(b) _B..=Jb, I (b)) ~· .
the approximat.iou is correct to at least four significant figures. ~
(3.~ It is important to use stopping procedures in a code that is written to compute the
,:,. ·"'
root of equal.ion (3.1) using the bisection method. Some of the problems associated
with this method stem from the fact that, at times· there exist sequences {n with the
(31 property that the difference {n - {n-l tends to zero while the sequence itself diverges.
In some cases /({n) ➔ 0 as n ➔ oo while {n differs significantly from { the root of
1 subinterva'
the equntion. If we have no informntion giyen about / cir {, then the relative error
, for 2n subi slopping criterion should be applied, as it ensures an upper boUDd on the number of
iterations performed. This elimim1tes an infinite loop, a possibility that can arise when
the sequence diverges or when the program is incorrectly coded.
· bounded s The bisection method has the important property that it always converges to a so-
iuence. Th lution. Its drawbacks are that it is slow in converging, that jg, it may converge after X
a lnrge number o_f_iterations, and that a good intermediate approximation maybe_dis-
(3.7 carded.
Activity 3.2 Use the bisection method to find a solution to within 10- 4 of the equation Fig. 5
(3.8
/(a ·i.
)12 $0. Th' 600x4 - 550x3 + 200x2 - 20x - ·1 = 0, 0.1 :S :r 51. (3.9)
J find one of · 3.5 · Method of Chords (Secant Method) :\
ots. BeCllUS~
<h•=~acyr The secant method is a faster method for finding a root { of the equation J(x) =·,o than
(,
the method of section 3.4 _(~scqi~n method) . Suppose that { is a root of f (x) c= 0 lying l
in [n,b] such tha~[@J .~ _OJ To be specific, let /(~)_<;_0 and [(b) >_Q, Sta{ting ,,
1/ [0, 1] since with the two initial approximations a and b, the approximation r1 is the x-intercept of
the line joining (n,/(a)) and (b,/(b)). Thus \__~?J~
The UPxt approximatjon, x2 , is the x-intercept of the line joining (a. f (a)) an,t' (:r, , /{:r. i)) I
·1
in the case of Fig.6 and so on. 1
x ,=a+h1 {3.10)
whr.re Fig.5 and Fig.6 giw illustrations of the secant approach for couciwr. upward aucl co1H:avc•
downward functio1is.
- '-f(n) I- . = /{a) (/1- a (3.1 1)
h,-_f(a)+f(b/ 1 Cl) f(b)-f (a) )
. . -J(u)
·1
(,e,• F1g.5) smc:c tau/I= - - = ~J(b)
b ,.;.
111 - a - 1It
.-l. ~th·ity 3.3 Dain! h1 11si11y the. ah,we rclntionship of-tan 0
3
--:,.~ . ,
~. -·
y
- . 'I
Solutions of lllon-linea/ 'e ~-~tions
in One Variable .
I) ~
Solutions _of Non-l inear Equations
in One Variable
31
J ,
J
that f" (x ) > 0 ou [a , b]
' I l. The curve).y = f(x) is concave upward on [a, b] meaning
(sec_Fig.7
y
"'
~
A(a, f(a))
:t
fJt
X
·• b= i
0
Fig. 6
lt(I
'-
/(a)
,,J
·• . •t y = f (i)
Fig. 7
y = f(x) by
od is equivalent to replacing the curve
One can easily see that this meth of the line
and B(b, f(b)) . Thw the equation
a chord that joins the points A(a, /(a))
AB is f(b) - f(a) y - /(a)
b-a =~
or (b - a)(y - f(a)) .
x =a+ f(b) - / (a) . · that the successive appr oxim ation
s
Here·u is fixed and 't(a) > 0, such
Set :r. = x 1 and y = 0 to obta in /(xn)(:r.,, - a)
Xo= b, X1= xo-
· /(xo)(xo - a ) ' , Xn+ t = :r.,. -
/ [xo )-/( a)'" tt- , ,, , • (3.1:5)
J(a)( b - a) =a+ h (3.12)
X1 =a - J(b) - J (a)
eucc. T hat is
form a monotonic decreasing scqu
;~s h1!fore.
{x,, } of the a<~ < · · · < :r.11+ 1 < :r,. < · · · < :r , < :i:o. (1 11)
an,l I.he convergence of the sequence
.Next we ~how itera tion formula for x,, ca~cs:
Let us consider the following two
poiut.~ .1·1 • i = I, 2, 3, · · • as 11 ➔ oc. 2. The graph off is concave ~1 war
d on [a .b]. i.e.
/"(.1.· ff o (See Fi~.8)
~
Solutions of Non-line
ar Eqls in One Variaole
)2- · ~ ~-
Soluttons of No ~ linear
jn,
Equations"-in O~e Variab
le .,,
'!I
·....
,~ sides of the· genera
·\ .; . l term in (3.13) gives
33
r
I,
:~
,. ,. /({ ')
B(b, J(b)) ' = '• - !( {1 - f(a) ('' )
' - a.
It follows tha t /(( ') ·.~
= 0, and since f(x ) =
{ = {'. 0 ha s only on e roo t on [a, b], then
In the same way, it can
proof. Formula. (3.2) of
be
sec
proved tha t {' = efor the second cas e, wh ich com
. l
the approximation. tio n 3.2 is sometimes used for
determining the acc
ple tes the
uracy of
:, \\
1f(b)\
Pr oc ed ur e for th e
Se ca nt M eth od
V I l\
1. Isolat e the roo t:
~. TJ .ux erl ppjJ!Lis one for wh
ich.,ilil has the sam .\
I '
\ a
I XO
/
z ;( 7 / • b ~X
2. Determine which
The succes sive app
formula to use: •
rox
f(x ) is opposite to tha
im ation s Xn lie on the side of
the root e where the
-
e sign as f" (x). Ii ,
l\1....
IJ( a)
~
3. Determine the acc
uracy
--
t of f"( x). sign of
If two successive values
Xn -1 an d Xn are kn ow
. approximate the absol n, then there is anoth
~
~( a,/ (a) )
We make the usu
ute error: er formula. used to
\\
,\II
a.1 ass
Fig. 8 on [a,b].
um pti on s tha t f'( x) is continuous
and does no t chan'\ge '
sign
-~- Let
r-
0 < m1 $ \!'(x)\ $ M1
< +oo
where m1 an d M1 a.re (3.17)
we h~ the smallest and lar
e gest values 1/'
~ix b s? th atJ (a ~ l~)~ .
of (x)\ on [a, bt' ti~ ing (3.13)
) < O. Th ~
mr the successive approxim
ations form a monoton Xn = Xn-1 - f(X/(X n-1)
n-t ) ~f (a ) (Xn-1 -
mcrr.runng seqhence ic a), n = 1, 2, 3, • • • ,.
where a is fixed . Sin I
ce f ({) = 0, we hav;
Xo = a, X1 = xo - J(bJ(xo) · ... . \
) _ f (x~f b - xo), · · · , Xn+I = Xn - f(b f(x n)
) _ f(x n) (b - Xn) - f({ ) - f(Xn- 1) = J(xn-1) - /(a ) I'
Uenre
(3.15) (Xn-\ ) (xn - Xn-1) ,
- a
xo < X1 < x2 <.·" < Using mean-value the
x,; < Xn+l ·orem for derivatives
< .. · < ( < b (3.16) , we have
To complete the proof
we proceed as follow (~ -X n- 1)J '((n -1)
s: = (xn - Xn -1) J'( i 11- 1),
Suppose ' for
\im X n = C, a < ( <
I ( n-1 E (Xn- 1,( ),
n➔ x b Xn - 1 E (u, :r. n- 1)
(1he \i1~1 it. l!xists sin Th us
ce 1:,, is bo nn dc d and monotonic) . Th
en taking limits on bo
\
th · \J' (:i: n- 1) - J'( ~n-1)1\.r
\{ - Xn\ = \J'l(,._i)\
n- :r.,. _i\
(:I I ~)
■
.,,, :~-~',-t"t ~''· ;
42 t-,--
~~ · l ...,
Solutions of_I',,
(.
, near Equations'. in One Variable 1t1- Solu ~ Non-linear Equations in One Variable 4:.
'
" ~ D efinition 3.1 A fixed p oint for a given function ,p is a number x such that ,t,(x) =
Let us assume that for n = 2, x 2 = 4.4934. Thus x.
..;; • I'
f(x2) = 0.0004148333 > 0 :;. Our initial task is to be able to determine when a function has a.fixed point and h01
t~ s point can be determined.
so that
4.4934 < { < 4.4934195. E ~pl~.8 1. The Junction ,p(x) = x, 0 $ x $ 1, has a fi:zed point at each x i,
.·.[o, 1),--
Therefore we can put { = 4.4934 correct to 5 significant figures. -F. r1~
!?• .The f unction ,t,(x) =x - cos irx has exactly two fixed points in[- ½, ½J. X =- I
j
The error estimate in x 2 can be made more exact. Since for x E [x2 , x2), f'(x) < 0, and x·=,½. ~
then .,.
m1 = minl/'(x)I = l/'(x2)I = 4.3860868 > 4,
It\ I ~ so that,
T hus
I{ - x2I $ lf (x 2 )1
m1
= 0.000010055
~
I
{ = 4.4934195 - 0.00001010, 2
where 0 < 9 < 1 (/(4.4934094) = 2.5402 x 10-1 ) .
3.6.3 M odified Newton·Method
I 0 X
-: 2
If the variation of f'(x) on [a, b) is small, then we can put
f'(xn) :::: f'(xo) , (3.28) l l
2•-2
,; ;'J
H!I Thus
Xn+l
·
= Xn -
f (x.)
f'(xof n = 0, 1'. 2,· · · (3.29)
This is equivaleut to replacing the tangents at the points (xn, f(xo)) by straight lines
parallel to the curve y = f (x) at the fixed point (xo, Yo), In this way the problem of
ernluating the derivative f'(xn) in. Newton's method is avoided. The formula is very
w;eful if f.'(xn) is complex.
II 3.7 Iterat ive Met hod(Fixed-Point Iteration) i/' To start the process choose an approximate value of the root, xo, and substitute it into
the right side ot (3.31) to obtain
Ii The method of iteration is one of the most important and well-known numerical meth- xi = ,P(xo). (3.32) .
ods for solving the equa tion f(x) = O. The next number .x2 is obtained by replar.ing xo by xI in (3.32), that is, x •l = ,p(:c 1)
and so on. Thus
Suppose we are given an equation Xn = <P(Xn-1 ), n = 1,2,3, · ··
(3.30) (3.33)
f(x) =0
If t he sequence {x,. };;"= 1 is convergent, then therr, exist a limit ~ = lim 1· . Taking th0
11 w ht·re f (x) is a continuous function and are required to determine the real root of this
11
---,
n ➔ oo
limit in (3.33) as n ➔ oo and assuming rf,(x) to be contin11o us givr?s
cquati,.m. Equation (3.30) is equivalent to the equation
l = ¢(.z;) ' (3.31) · lim .t 11 = t/> ( lim 1:11 _, )
I I
X n-t-x, /1-¼X
I.
, 44 . rt) ._
}
7
or
..
~ -
Jo,_:
,,
It ~ ..
111
Solulfqns ot... on-linear Eguations in One Variable
'¼
. ..~,. ... ,
·
·'"'
45
{ = 4>(n (3.34)
-,
,;,Ft
~
-~
-i. ·y
>
Y't' ,p(x)
=x
.s..
Thus { is a root of (3.31) and is evaluated using (3.33). ,;11., A'fl.
-<ti •
,.
In geometrical terms the method of iteration·leads to roots of equatioif{3.31) which
are x-coordinatcs of the points of intersection of the curv& Y.:= ,f,(x) with the straight
line 11 = x (see Fig. 13). • ..,.. "'- •Ao
., B
rl JI
"~
y I III
~
I IrI
I -
0 Xt x :,X4X2
Xo X
,f,(+) Fig. 14
y=x
I
I I
0 I I I' I
We note that the process of iteration may fail to converge depending on the value of
~ X2 X1 xo X
l</>'(x)I. In the two cases above J.t{x)I < I, and the process of iteration converges. If
Fig. 13 l<l>'(x)I > 1 the process may fail to converge. The following theorem gives sufficient
conditions for the existence and uniqueness of a fixed point.
Theorem 3.3 (Sufficient Conditions for the Existence and Uniquenessof a Fixed Point)
Suppose ,f,(x) is defined a~d diffenm,tiable on [a, bj, and ,f,(x) E (a,'bJ. Then, if there
exist a positive constant q, such that · • ·
1,t,'(x)I ~? < I_,, V x E .(~, ~)
If </>'(x) is positiYe, then the successive approximations x1, x2, X3. · ··are the common then: 1 {3.35)
x- coordinatr.s of the points Ai and Bi, A2 and B2, A3 and B3, · · · of the polygo-
nal line AoB1AiB2A2B3A3 ···("staircase") whose segments are parallel to the x-axis 1. ,f,(x) has a /i_xed poinlin [a, b] irrespective of the initial value xo E [a, b) .
and the y-axis (sec Fig.13). When ¢'(x) < 0 a different kind of the polygonal line 2. The fixed point in [a, b] is unique.
AoB1 Ai B2.42··· ("spiral") is formed (sec Fig. 14).
Proof
Consider two snccessh·e approximations
Xn = ,P(Xn- il
(:UG)
. It . _,, 111 .IPf . Equat1ons
SoIut1011s o Non• 1·tnear . bl ':_
. .in 0 ne Varia
46 Solutions of Non-linear' Equations in One Variable
or
and (- ( = (( - () rp({') for CE((.{).
(3.37)
Xn+I = ¢(xn) or
Subtract equation (3.36) from equation (3.37) to obtain
({ - {)(I - ¢({')) =0 (3.4
Xn+I - Xn = ,P(Xn) - c/!(Xn-il•
Si~) - . ¢(Cl # 0, then { ={, which gives the uniqueness of the fixed point.
By the mean-value theorem we have Th~ ·proofis complete •·
~
Xn+I - Xn = (Xn - Xn_;),p'(xn) ,
The theorem is aj;, valid if ¢(x) is defined and differentiable for all real x . Equati,
for Xn E (Xn- 1,:tn), Using (3.35) we get (3.35) is true for all real values of x.
(3.38)
lxn+l - Xnl :5 qlxn - Xn- d
I' For n = 1, 2, 3, •··, we have Note: Under the given conditions in Theorem 3.3, the method converges for any init
value xo E (a, b]. Also, the method is self-correcting, since for any approximati,
ti lx2 - xd :5 qlxi - xol x;, i = 1, 2, · · · , n, which was incorrectly c?,!culated b_ut belonging to the interval (a,
lxa - x2I :5 qlx2 - xii the process will still converge, as this is taken as a new initial value xo.
I'-- (3.39)
:5 q · qlx1 - xol
Corollary 3.1 If ,p satisfies the assumptions of. Theorem 3.3, then the bounds for t
• ·11; llx1 -xol
error involved in using Xn to approximate ( are given by
lx4 - xal :5 llx1 - xol, · · ·, lxn+l .,. Xnl :5 q"lx1 - xol•
- :to I
(3.40)
""";Iii r[{ - Xnl :5 -lx1
q"
1-q
(3.4
I. Consider the series and
i,·1 . l 'li
.: : xo + (x1 - xo) + (x2 - xi)+· ·· + (x,. - Xn-il + · · ·
(3.41) \{ - Xnl :5 _q_lxn - Xn-il•
1-q
{3.4
r( !
whose partial sums are S1 = x._2 S2 = X1, Sa= x2, · ·· ,Sn =' Xn- 1, Sn+I = Xn, The
1
absolute terms of the series (3.3!1) are less thau the corresponding terms of a geometric
Proof
progression with q < 1, and therefore (31!1) converges absolutely. Thus From (3.38) we get
· lim Sn+l = liro Xn
n-+oo n-+oo
=( for ( E [a,b]. \xn+p - Xnl = l(xn+p - Xn+p-1) + (Xn+p-1 - Xn+p-2) + · · · + (xn+p-(p-2) - Xn+p·
+(xn+p-(p-1) - Xn+p-(p))\
Taking limits on (3.36) and (3.37) gives \(xn+p - Xn+p-i) + (xn+p-1 - Xn+p-2) + Xn+p- 2 + Xn+p-2 + · · · +
I.
,!~";, Xn =nl~ ,p(Xn-d =r,b(nl~~ ,P(Xn-il +(xn+2 - Xn+1) + (xn+I - Xn)I
:5 lxn+p -Xn+p-d + lxn+p- 1 - Xn+p-21+ lxn+p-2 - Xn+p- JI +
where q,(x) is continuous in [a, b] or +lxn+2 - Xn+d + lxn+l - Xnl
(3.42)
~ = r/> (0- :5 q•+p-llx1 -xol + q"+P - 2 lx 1 - :tol + q"+P- 3 lx1 - xo\ + · · · + q" +11:
+q"lx1 - xol
Thus, { is a root of the equation x == ,p(x) and this shows the existence of a fixed point
I ( . To show that ( is unique we proceed in this way. Let
q"l:z:1 - xol[l + q + q2 + · · · + qP- 1].
1[ l
ii' ( = ¢({) (3.-13 )
I\
1/ Th,•11 from (3.43) and (3 .42), we ha\'e
I Thus
I - qP q"
I ' lx n+p - Xnl :5 q•lx 1 - r ol--
1 -q
< -1 -- q 1.r.1- :rol as /i ➔ oo, 0 < 1J < I
.
l
l - ( = ,p(() - ,/J(O
...
to ~~futio~ Non-linear Equations in One Variable
'
19
·48 Solutions of Non-., Equations in One Variable
~;1i·~l· - . ' , . ·'-' i
then
Since lim Xn+p = {, then r •
n-,oo
l{-xnl = 14>({) - ,P(Xn-ill = I{- Xn- d4>(in-il $ ql{-Xn-d, for Xn-1 E (Xn-1,0,
q" (3.47)
I{ - Xnl $ -lx1 - xol-
1- q i.e I{ - Xnl $ I{ - Xn-1I-
Hence the smaller the yalue of q the faster the rate of convergence.
This means that if the iteration process is convergent, then the error I{ - x,.I tends to
Another approach would be to let zero monotonically.
f(x) =x - qi(x). -.i If the choice ofxo is not properly done the successive approximations Xn = ,t,(xn- il, (n =
1, 2, 3, .. •), can be extended beyond the interval (a, b) or even become meaningless.
Note that f'(x) =..l.:::..i(!l;:: 1 - q and f({) =0, and_~us,
lxn - qi(x.)I =lf(xn) - f({)I =lxn - {ll/.'(i:11 ;:: {l - q)lxn - {I, Example 3.9 For the function ,t,(x) = !JIO-x3 , 4>'(x) = -¾(10 - x )-½ < 0 on
3
[l, 2] and hence ,t, i8 atrictly decreasing on [l, 2]. On evaluating 4>' at 2 we see that
,~here in E (xn, {). Hence
1¢'(2)1 :::: 2.12, hence the inequality (3.35) of Theorem 3.3 ia not satisfied on [l, 2].
lxn _ {I $ lxn - </J(xn)I (3.48) A cloaer look at the aequence {xn}~=O starting with x0 = 1.5 showa that it suffices
1-q to conaider the interoal [l, 1.5] instead of [l, 2]. On this intenial, it ia still true that
4>1(x) < 0 and 4> ia atrictly decreaaing; /,,,1. in IMniliea
or (3.49)
~
I{ - Xnl $ l:tn+I - Xnl
1 < 1.28:::: ¢(1.5) $ ¢,(x) $ 4>(1 ) = 1.5
(Xn+I = qi(Xn), Xn = 4>(:tn-iJ).
~
Using (3.37) in (3.41) we have
q
I{- Xnl $ l-1:tn - Xn-1I,
(3.50)
- for all x E [l, 1.5]. Alao, l,t,'(x)I $ 1¢'(1.5)1:::: 0.66 on [l, 1.5]. Thus· by Theorem 3.3 the
sequence {Xn} ::"=o i., ccnvergent on Jhia interval. It is therefore useful to consider an
alternative theorem to Theorem 3.3.
. 1-q
I . • I
In particular if q $ ½, then
- -·
1: Theorem 3.4 Let ,t,(x) be defi~ed and differentiable for all x in [a, b] . In addition;;:_let~·•. .-.t
Iii
I{ - Xnl $ lxn - Xn-d < f 1{ be the root of the equation = ,P(x)
. , "'I.
(3.51)
,
I!·..
' . . X
and therefore
I{ - Xnl < f. located in a smaller iriten,al [a, /J), where c, = a+ ½(b- a) and fj
if
= bL ½(b- a ).. Thus, I
I
The proof is complete • ·
Note: In general, it is true that if lxn - Xn-d is very small then I{ -xnl is also small.
: 1. l,t,'(x)I $ q < 1 for a< x <band j
In particular if 4>'(x) is close to unity, then { - Xn is large, although lxn - Xn-1 I is very
I!. xo E [o, /J]
gmall. Formula (3.50) is used to estimate the error in Xn, The procedure of iteration
should be continued until · . 1-q
lxn - Xn-11. < -. -qE then,
.
be.comes true, where f is the given absolute limiting error of { and 1¢'(x)I $ q. Then 1. all successive ariproximations are in (a,b), such that Xn = ¢,(xn- il E (a ,b). where
by (3.50) n = 1, 2,J, .. .
I{ - Xnl $ f
is valid. li!\l Xn =.( and { is unique on [ri,b] for equ,,tio11 (3.51 ).
2. n~oo
If 3. (3.45) holds.
Xn = 4'(Xn-1) and ( = ¢(().
l ZALWSM . W f:»=. ...
50
Proof
Since
i I'i
1
L~I
.
,ri.
I
/'
r 11
:;. Therefore, Xn E (a, b) , n = 1, 2, 3, · · •, Parts 2 and 3 of the theorem are proved in a
similar way as in Theorem 3.3.
This completes the proof • ·
ltl>'(x)I
= 0.6216099) .
~
I I.;
I Example 3.10 Find the real roots of the equation sinx-x+0.25 = 0 to three significant io (I.I, 1.3) , ,,· that the % oditio~ of T h ,~ roo, 3.4 ~ , sa'1, fie d . T h ns.
·i
,,'· I .
fig·ures, using the fixed point iteration.
Let eho= >o
t he successive approxima tions
.~ = l, 2, 3, · · ·
Xn := ef>(xn-1/:,,,, sinxn-1 + 0.25, n
➔ ➔
Solution
Md a"
lie io (0.9, 1.5) of ( "n oo. We eho~, a, - 1.2 Md ' Oedfy. ~co«li ng <o
the hypothesis t he proble m. t h e li11Iiting absol u te error
Tlie equation is rewritten in the form
1
f = 210-2
/,, x = sinx + 0.25.
T hen , fiud the successive a p proxi1 11ations u ntil
.; I - ,,
~ 0.(J(JJ,
'
.__ Xow
IJ·,. - 1 - i:,.
,,
I < c ----.c..
'.\
~_____________________ ________
r. . i ~-. ~ ,
.
.,__ tj in One Va~iable
Solu tion s of Non -line ar Eq
uat
~ ' Solu tion s of N8'rf-1,,' 1-E qua
tions in One Var iabl e ·" 53
-~~~::.w '
equ atio n
largest pos itive root { of the
Exa mp le 3.1 1 Esti mat e the
X + X = 100 0
3
(3.5 7)
x1 = sin 1.2 + 0.25 = 1.182039
1::::: 1.182
.;, 4 d poin t iter atio n sche me.
x2 = l.17 5
..... ,'ti:- . • to with in 10- by uaing the fixe
...
~
X3 = 1.173
X4 = l.17 2 f; ,, Sol utio n
X5 =l.l 72 7) in the form
Let xo = 10. Cle arly { < xo. Rew rite (3.5
significant fig~ ~- The re-
mations coin~ide to with in four = 100 0-x3
The fourth and fifth -approxi ~;. X (3.5 8)
fore 0.622 . or
lxs - {I :5 1 _ 0 _622 x 0.001
= 0.0016. 1000 1
r) does not exceed X =~ -; ; (3.5 9)
x (including the roun ding erro
The limiting absolute erro r of 5 or
~ E = 0.0016 + 0.002 < ½10- 2.
100 0 l
x = (1000 - x)l
l (3.6 0)
1\
Let ¢1 (~) =- X 2-
- - and "'2( x) = (1000 - x) •. The n
s, we can safely take
X \'
.,Thu { = 1..17 ± 0.005. ~, ( ) -20 00 1
I :r = ~ + x2
Not e: Let
f(x) =0 (3.52) and \'
-1
be writ ten as "(3.53) ~(x ) = 3(Woo_ x)~
. X = tf,(x), = 10, we hav e
e of¢ (x) in the neighbour- At x
erent ways.- The abso lute valu
then t/>(x) maybe chosen in diff
hood of { turn s out to be sma
ll and in som e case s larg e. For
the met hod of itera tion , I I , ( )I
14>1, (10) = 100 ' 4>2 10 :::,: 300 .
199 1
ce q
J
t suit a!l! e opt ion , and hen
the condition
lt/>'(x)I $ q < l,
(3.54) >
14>i~(10)- 1Set
alt to
tha 14>2(10)1. Thu s (3.6 0) is the mos
is setsee
We equ
ve approximations. Equ a-
er convergence of the successi Yn 100 0-x n
for small values of q, ensures fast
=:
with (3.52) thro ugh a tech-
the form (3.53) in agre eme nt so tha t
tion (3.52) can be reduced t~ 1
nique discussed below. Xn+ l = yJ., n = 0,
1, 2, · · ·
belo w:
equ atio n lie in (a, b), and this are liste d in the tab le
Let the desired root { of the The succ essi ve valu es from
(3.55) n
0 < m1 $ /'(x ) ::5 M1 Xn Vn
0 10.0 000 0 990 .000 00
e m1 > 0 is the sma lles t
then consider -/(x ) = 0.) Her a$ x $ b.
for a $ x $ b. (If f'(x ) < 0, l 9.96 655 990 .033 45
M the largest value of f'(x ) in j
value of /'(:r.) in a$ x $ba nd 1 2 9.96 666 990 .033 34
3 9.96 667
n
Replace (3.52) by the equ atio ty
con tinu ed unt il the ineq uali
The proc ess of iter atio n is
x = x - >..J(x) = q,(x), >.. > 0
1- qE
The parameter >.. is then chos
en in such a way tha t lxn - Xn-il ~ -
q
0 $ ¢'(x ) = 1 - >..J'(;,) $ q <
I (3.56) , of € tho exa ct rnot nnrl
i, achie,OO, wb, re , is th,
specifi,d limiting ah,o\u t, ,,.o
(3.56). we obta in 1 300 ==
i1, a ~ .c ~ I,. U~ing (3.55) and == --
6661 = 0 .000 1 a nd --- 00 - I :o 1
l - -3 29!)
0 $ 1 - >..M1 $ I - >..m1 $
q. l4>'(x)I < q. Since 19.9 666 7 - 9.96 1 100 00 300 100 00
.
- it is clea r tha t 0 .000 ! < 0 .02. 300
I !Rt
t (3 .56) is sati sfie d. 0.02 , then
and q = I - -M1 < 1, so tha to with in 10-~. 9 .966 fi7 I n ' "' tit~ rroo t
Tint •. we .-:an cho ose >.. = -M1 Thus, we can 1->ut { :o
·.1i:.
54
• • •
.,,.
~olutions of Non-linear Equations in One Variab
le
13• Solo<Oo, of Noo-llom Eqoa<loo, lo Oo,
Va,laS,
:r - {.
'i out the operation of divisiou of P(x) by
3.8 Zeros of Polynomials. Hom er's Met hod at x = {.
Hom er's Sche me: Evaluation of P(x)
Suppose we have a polynomial of degree
n, ~- ao a1 a2 Un
lL
(3.61) J' + bo{ b1{ b11-1{
P(:r) = ao:rn + 01:rn-l + · · · + On-1:r + On ;1°fl
..
,.
with real coefficients ak, k = 0, l, 2, • · •, n bo b1 =P(O
. b2 bn
" = a 0, b1 =
D efinit ion 3.2 (Zeros of a polyn omia
l) Let P(:r) be a polynomial of degree n ~
I
.where a., k = 1, 2, .. ·, n are coefficients of P(:r)
a2 +b1{, ··: ·· ~
and bu a1 + bu{,1
given in the Jonn
:r2r' ...(:r - Xtr• = 0,
~-- 2 +3x -4 at x = -2 using Homer's Sch
P(:r) = On(:r - :r1r (:r -1 4
Example 3.12 Evaluate P(x) = 2;, -3x
maybe complex, and m1+ m2 + ... +mt =
c
where the numbers :r1, :r2, ... , :ri,, are unique,
P(x) = 0 are called the zeros of this ~
n, then the numbers :r1,:r2, .. ,,:rn for which Solu tion
polynomia l.
"'
Set up the Homer's scheme:
3.8.1 . Hom er's Method a 0 - 3 3 -4 I.=! _
the value of (3.61) when :r = {: -4 6 -10 14
~et us assume that we are required to find
(3.62)
P({) = ao{n + a1{n-l +· · ·+On -I{+ On 2 -4 5 -7 10 = Pf-2 )
a-
Further if (3.62) is. represented in the form to find an appro xima te zero of a polyn
When using Newton-Raphson method scht
ated by taking advan tage of Hom er's
P({) = (··· ((((ao{ + ai){ + a2){ + a3){ + · · · + On-il{ + On), P(x), both 'P and P' can be easily evalu
Thus , assuming
then we can find the numbers P (:r) = (x - {)Q(x) + /Jn,
+bn-1{ = P({). (3.63)
· bo = ao, bi= a1 +bo{, b-i = a2 + b1{,· ·· ,bn = On where
bn-1 are coefficients of the polynomial Q(x) Q(x) = f3oxn-l + /31X11-2 + ·· · +f3n-1,
Let us show that the numbers bo, b1, .. ·,
by x - { . Thus we. have
obtained as the quotient on dividing P(x)
Q(:r) = fJo:rn-l + /31:r"-2 + · · · + f3n -l (3.64)
P'(x) = Q(x) + (x - {)Q'( x) (Jj
and (3.65) and
P(x) = Q(x)(x -{) + /3n·
P'(O = Q(~) . (3
ily the remainder theorem f3n = P({). Hence, from (3.64) and (3.65) we obtain
Q({) . Hence P(() and P'(O are found
2 Then P'({) can be found by evaluating
P(,:) (.Box•-l + /31:r"- + · · · + /3n-l )(:r - {) + /311 similar maimer using Homer's meth od.
1 2 · · · + (/311- 1 - .Bn-2{):r + (f3n - /3n-iOx 0.
/3ox" + (/31 - /3o{)x"- + (/3-i - /31{):x"- +
s of x gives Exam ple 3.13 Find an approximation
of the zer?Js of
Comparing coefficients ,6f the same power
~iu =au. /31- f3o{ =a1 , /32 - fJJ{ = u2, · · · ,/311-1 - /311-2{ = au-I , /3,. - /311-1{ = a,. . 2
P( x) = 2.r~ - 3x + 3.r - 4
Tl11.1s w,• ol,tain (3.63) . Hom er 's method to cv11/11alr P (.c,,) ar,d /
using the Ncwton-Raphsrm procedure and
for each iterate Xn.
of the quotient Q(x) witho ut canyi ng
I
Tliis allows us to dct.cnnine the rnctticicut.s
I
I
L
·~ '• ·,;
-
;6 Solutions of Non-linea~ E .s in One Variable
§2.,4 Solutions qf N~·ar Equations in One Variable
~I
57
So\uti~n r (b) Secant Method: The fixed endpoint is the one for which the sign of /(x)
is the same as that of J"(x). Al!IO, the successive approximations Xn lie on
Consider x = -2. Let xo ={, so that x = x0 = -2. ;
the side of the exact root { where J(x) has opposite sign to J"(x) .
,,.:
2 o -3 3 -4 1- 2 (c) Newton's method: For small values of f'(x) this method may require huge
+ -4 8 -10 ~ -- -~ '4\~ . calculations and in some cases it would not work.
,,, _
(d) Fixed-Point iteration method: This process should be continued until
2 -4 5 -7 10 =P(-2) >;, )I
.,.,
'i-!, lxn - x
~ _1I::; 1-q
-q-f'
Using (3.64), (3.66) and (3.67) we have .
~ ,
7
I = OJ + /Jo{,
Q(x) /3oxn-1 + fhxn-2 + fhxn-3 ;t f3Lt;, where 14>'(x)I ::; q < 1, and f is t~e limiting absolute error of the exact root . .
2x3 -4x2 +5x-7 1~
2. Use the Horner's Scheme to evaluate a polynomial for a given value of the
ng Homer's Sch
I
and P'(-2) ~ Q( ~2). Thus by evaluating Q(-2) in a similar manner as above we find argument. ·
P'(-2): "~ 3. Apply special methods, Newton's method, to find the approxilllate rnot of a
2 --1 5-7 \-2 polynomial P(x), by taking advantage of Horner's scheme to evaluate P and P'.
-4 16 -=i2
4. Write out the expressions for errors and be able to evaluate these.
2 -8 21 -49 = P'(-2)
and •
x1 = xo - ·P(xo) "'-1.796.
P'(xo)
EXERCISES
G) .
Convince yourseU that ez - h 2 = 0 has a zero at x = 0.714805912. Use eight
Appiying the same procedure for the secol)d time, we find x2;
iterations of the bisection method, beginning with the interval [0, l ], to approx-
2 0 -3 3 -4 j- 1.796 imate the zero. Tabulate the error after every iteration, and tabulate estimatl'S
of the ma.ximum error. Is the actual error always less -than the maximum error
+ -3.592 6.451 -6.197 5.742
estimate? Do the actual errors continually decrease?
2 -3..592 3.451 -3.197 1.742 · = P(x1)
and
2 -3.592 3.451 -3.197 1- 1.196
0 The quadratic ftinction J(x) = x2 - x + 0.24 has zeros at x = 0.4 and x = 0.6.
Observe that the endpoints of [O, l] are not satisfactory to begin the bisection.
Graph the function, and from this deduce the boundaries of intervals that will
converge to each of the roots. If you start with [0.5, 1], what is the error bonncl
+ -3.592 12.902 -29.368
after six iterations? What is the actual error after six applications of the method?
2 -7.184 16.353 -32.565 = Q(xi) = P'(xd
r~Use the bisection method to find the smallest positive rnot of each of the following
Henr.e
P(-1.796) l.742 •
V equations with a relative accuracy of0.5%. Find good starting values from graphs
X2 = -1.796- P'(-1.796) = -}.796- -32.565 "'-1.74h of the equations:
') are found in (a) e- z = cos x;
SUMMARY
(b) i 3 - 2:i: + 1 = 0:
After going through this unit, you should be able to: (c) sin 2.i: - e·T- I= O;
I. Use the following met.hods to find solutions to /(x) ~ 0. Discnss the strengths (d) ln(.r. - l) - x 2 = 0.
and weaknesses of these methods.
'(:r,i) and P'(x. (al Bisection method: The process will always converge to a solnt.ion. But it
-1. The [unrtion f (:r.) = rcos (-:r._\
,. - 2) has ma.ny zrros, <·sp,·•·ially 11<':tr .r = '2 . wlt1'n •
i~ ~lnw in convP.rging. J( x) is unclcfinccl. Graph the f1111 c:t.io11. D1•t cr111i 1w 1hr lirsl fu11r Zl'rus . l u f.,
111
signilirnnt fi gmPs. for :r > 0 l,y tl,P bi,CC'tion IIIPI lirul.
~
". I
58
w
Solutions o,ll;near:_Equations in One Variable ~5 S.ns of Non-linear Equations in One Variable
. -:_.."If'- .,
'2- 5. Repeat Problem 3, this time using the method of chords(secant meihod)~J;om- /o)Tse Newton's method to find solutions accurate to within 10- 5 for the fo1Jo11
pare the number if iterations required with the number used in the bisectiofl \.0roblcms: · r
method. ,:'
{r. (a) . e% +2-r +2cosx-6 = 0 for 1 $ x $ 2
6. Find where the cubic y = x3 - x + 1 intersects the parabola y = 2x • From a
graph of the two functions, locate the intersection approximately, and use the
2
.~ <. ": (b) 2x cos 2x - (x - 2) 2 = 0 for 2 $ x .$ 3 and 3 $ x $ 4
secant method to refine the approximate root until you have achieved accuracy ,.. (c) e% - 3x2 = 0 fqt O$ x $ 2 and 3 $ x $ 4.
J,y •, •"
of up to five significant figures. How many iterations are needed? IQ. j /ii ~et hod of False Position (or the Regulh Falsi method) generates app1
,,~
7. Explain why the secant method usually converges to the root with a specified ·1rnations in the same way as the Secant method, but it provides a test to eru. ·
·that the root is bracketed between successive iterations. The approximation :i; .
precision more rapidity than the bisection method.
chosen in th~ ,~a,me 'way as in the Secant method, as x-intercept of the line joiii •
8. An algorithm for the secant method: To determine a root of J(x) = 0, given two (xo, J(xo)) and (x1, /(xi)). To decide which secant line to use to compute_x3,1
values xo and x1 that are near to the root, we proceed in this way; check to see whether the produc~/(x2) · f (x 1) is negative or not. If it is negatn
then x 1 and x2 bracket a root and we choose x3 as the x-intcrcept of the i
INPUT initial approximations xo, x 1; tolerance value TOL; maximum number of joining (x 1,f(xi)) and (x2,/(x2)). If not, we choose x3 as x::intercept of the I
iterations No. joining (x 0,f(xo)) and (x2,J(x2)) and theJJ interchange the indices on xo and 1
.
!'
~
l OUTPUT approximate solution x or message of failure. Repeat Problem 9 using the method of False Position. Compare the nuJ •i"
of iterations required with bisection; secant and Newton's methods.
,:,:
Step 1 Set i = 2; 11. Find the root near ..Q} of ex - 4x 2 =: 0 by Newton's method, beginning ~,
.., . !lo = J(xo) xo = 1. How ac~urate·is the estimate after four iteratia1i.s? How many iteratl
LJ YI= /(.ri)
with Newton's method does it take .to match the accuracy achieved after e1 .
Step 2 For i $ No do Steps 3-6 iterations by the bisection method? Tabulate the number of correct digits at a'
1:; ·1 iteration with Newton's method, and determine whether these double each tin
(x1 -xo)
Step 3 Set y = x1 - Yi---) . (compute x;) 12. Use Newton's method to derive the algorithm for computing the square root
YI -yo
r1 Step 4 If Ix - xd <TOL then
N ,i.e on x 2 = N:
,, l
Xi+l =~ (x; + f) . II
OUPUT (x); (the process is concluded successfully)
I
13. Problems involving the amount of money required to pay off a mortgage over'\
STOP. Otherwise go to step 5. fixed period of time involye a formula,
I
Step 5 Set i = i + 1. A= ~[l - (l + if"],
1
Step 6 Set xo = x1; (update xo,Yo ,X1,Yil
known as an ordinary annuity equation. In this equation A is the amount of ti
Yo= YI mortgage, Pis the amount of each payment, and i is the interest rate per pcrio
X1 = X
for. the 11 payment periods. Suppose that a 25-year mortgage in the amount t
YI =f(x).
Step 1 OUTPUT ('Method failed after No iterations, No=', No); S85 000.00 is needed and the borrower can afford house payments of at ml!
(tl,e process is concluded unsuccessfully) · J \.875.00 a mouth. What maxim~! interest rate can the borrow~r afford to pay'/
v s e Newton's method to find solutions accurate lo withi11 10-~ to tl lf' prohlcim
STOP.
(a) :r 2 - 2xe-z + e- 2z = 0, for O::; :c ::; 1
3
(b) .1: - + 3:c(4-.r) - 8• = 0 for O$ J; $
3:c 2 (2-r) I.
Jmplemc11t the above algorithm on Problem 6 with a computer program using
a11y t:0111putcr la11guag~ known to you. 15. Repeat Problrm 14 11si11g the modified Newt on's 111,·thod. Is t li Pn • ;in iuq ,ru1r
mr nt in conv1•rgc•1wr speed or ,IJ :i 11rac:y u1·1•r Pniblc111 1-1''
.
60 •
Solutions of Non-linear Equations in One Variable
'i,~ :
... , _,;
.
Solutio n~on-l inear Equaifons in O~e Variable '
,.:~
61
•.
~ Y°
·,
I
24. (a) Use Theorem 3.3 to show that the sequence defined
by
...
16. Show that the sequences Xn converge to x = o: How large
must n be before
Xn - X ~ 5 X 10- ?
2 1 1
Xn = -2Xn-i + --,
(a) Xn = 1/n; .(Hinti The sequence Xn ➔ x, (a ·iimit), if and only
if,· for any Xn+l
arbitrarily small positive number E, there exists an integer 11·sue~ 2
that for
for n ~ I., ·converges to v'2 whenever xo > J2.
n > N, we have \x 11 - x\ < f . Thus in our case .l¼ - 0\ .< e-= 5 x 10-
• For
show that if O <
(b)' Use the fact that O < (xo - v'2) whenever x0 f. /2 to
2
example, ¼< fcj, for all n > 20.) :: "'cl' .;. ~~
xo < J2, then x1 > J2.
(b) = 1/n2 ,n ~ l '· ?:J.•'• e in (a) converges
(c) Use the results of parts (a) and {b) to show that the sequenc
Xn
= 10-2• ..convefg_es'quadrat1cilly to zero. to J2 whenever xo > 0.
17. Show that the sequence Xn
. ,t ....
..it. .
s linearly to polyoomi,I, by findi,g
18. Show that the sequence {;!r }f, for any posi~ive integer k, converge f:)i ,d ,;"'°"" ""''°"' '°with in 10-5 to all the"" ' of the
x = 0. For each pair-in integers k and m, determine a
number N for which
v : h e real zeros using Newton's method and then reducing to polynomials of lower
~ < 10-m. order to determine any complex zeros;
4
(a) P(x) = x + 5x - 9x 2 - 85x - 136
3
-If:) Use algebraict manipulation to show that each of th~ following (unctions has a
V fixed point at a /(a)= 0, where
point precisely when 4
(b) P(x)= x +x3 +3x 2 +2x+ 2
2
(a) /(x) =x4 +2:i: -x _- 3 (c) P(x) = I6x4 + 88x3 + 159:i:2 + 76x - 240
(b) g1(x) = [3 + x - 2x 2J¼ (d) P(x) = x3 - 7x 2 + I4x - 6
X + 3] ½
. (c) g3(x) = [ -· - 2
·. . x+
to the computation
20. Use the following formulae · representing different approaches
speed of conver-
of 21 113, Rank these methods in order, based on their apparent
gence, assuming Po = 1.
20Pn-l + :lL
Pn - 1
f, (a) Pn 21
P!-i - 21
{b) Pn = Pn-1 - - 3 - 2 -.
Pn-1
P~-l - 2lp~-l
(c ) Pn=Pn-1 2 _ ·
Pn-1 21
I ,{\Solve x3 - x- l = 0 for the root in [l., 2], using fixed-point iteration . Obtain !Ill
~ approxima~ion to the root accurate to within 10-2•
22. For each equation, determine an interval [a, b] on which the
fixed point iteration
y to obtain
method will converge. Estimate the ·number of iterations nece8sar
approximations· accurate to within 10- 5 :
2-er+ x1
(a) T =
3
~(b) T=(f) l /2,
[a, b] on
C:f}or_ 2
the f.q mttion ~x :-- e' '." 0, deter_mine a function g and an interval
solution of this
wluch the fixed-po int iteration scheme w_ijl converge to a positive
equation .
~