Вы находитесь на странице: 1из 22

L-Iniversity of the Wbstern Cape

Department of \ifathematics & Applied N{athcmatics


Introducti,on To
IVUMERICAL
MtrTHODS
i
DIFFER.trIVTIAL
trQUATIOIVS
Written By
Francis Benyah
2A14
Contents
1 Revierv of Clalculus
2 Floating-point number sl'stems
2.1 RoundirrE;Error'-s
2.2 Significant Digits
3 Soltrtions of Nonlinear Eciuations
3.1 Errtraprnent methods
3.2 Tht Risection n:ethod
il.ll Tl"re l\Iethorl of False Position: Re.(tu,la
fals'i
:1.1 Nervtolr's metliocl (a.k.a. Neu,ton-Raphson
trrethorl)
3.5 The Secant urethocl
;1.6 Ttre Fixetl-point mel,hotl
3.7 Nt'u,ton's nrethorl for systems of nonlinear
eqnations
;l
Ltnst-SquaresApproxinratiot-r
.1.1
l,t-ast-Sclrare-s fit by Non-polyr.romial
Fuuctions
4,.2 Application of Lr.ast-Square-s to Statistical
Problems
.1.13
Exercises
1.4 Lt ast-square-c approxilllation of contitruou-s
firnctions
.1.5
Orthogonal pol;rnomials
5 Poll.nornial L-rterpolation
,--r. 1 Polp'norlial Approxinration of Contimrous
Rnrctions
5.2 Polynonrial Approximation b1' Interpolation
5.3 Er.enh, Spaced Data: Tlrt' Net'ton-Gregor1,'
Formnlas
6 Nunrericrrl Diflerentiation
6. 1 Trvo-Point Formulas for the First Derivative
6.2 Optin-mrtr Step Sizt' for l)i{Iererttct'Rrlntrtlas 1B
6.3 First Derivatives Flonr Nclr'trttt's
Interpolating' Pol1.'rronriais irO
7 Nun.rerical Integration 53
7.1 Newton-Cotes Integration Rrrtttttlits i3
7.2 Ttre
(lonrposite
Ttapezoirlal Rrrlc' 5,1
7.3 Excr'ciscr ;;
7.1 Simpsori's Rrile
i;ti
7.5 Exercise-s it7
1 R.eview of Calculrrs
Definition 1.1 (Limits and Coutinuity) [.et
f
bt, o,
real-ta,hted,ftut.ct'ion d.t.fint:d. on on. ittt.art:a,i
frr.
b] rzrr,/.r:s t
{a,
b};
f
i-c sa.id. to be c.on.tiruLorrs o.l -rrs, rif1im. ,,u
.f [.r)
rn. The.fiarct.i,ort
J
is snidto he contin,u.ous ott
fu,
bl if it
is conl,i,rnrous at erLch poittt in.
fo
b].
The set o.f nll conl.i.n.uou.s.lTtnr,t.ions ott llte closed inte,rt:nl
[a.
b] ls denoted hu Cln, bl.
Dcfinition 1.2 (Corrvergeuce of a Sequerrce) l,cl
{r"}Lr
be an infin,ite sqLt.et1.( r-t.f reitl or {:ort.ltl,e.r: t1rt.t}t-
txtrs. The sequett..:e i:; said lo converge ilt a nun.llt't' .r.
if.
for
an,y e ) 0, f/rt:rr: t;:i:isls a posilir:t, rcu.l n.tttnbtr N(.tl
s'uch t.hat,
rz > .\'(e)
",>
lr'-_
..nl o ..
The notat,ion
,JlR*"
-
, or .rn > .r o,s ) ix), ir?trdr's tho.t the s..qttL'.il1:t
The fo11ot'ing Thcoren gives a relrtiolis l>t'lt'trn
cont inlri ty ancl colr,-ergence.
Theorem l.L t,et.f ltt: afunction d,t.li,rt*1, on an inttrurtl.
lahl
and ls e
[rr,
b]. Then the.folktuittq ore t:qrriuale.nl:
{a) J
is ctuttitt.ttotls ct,t :t'o
1Dj 1irn",*,/(r,)
;(r'n).
Defirrition 1.3 (Differentiability) [,tt
f
hr, a
{urtc-
tion defin,ed on an open interurtl cottlaininq the poitt.f t's1:
t,hen
f
is saitl lo dilJerctLti,abl,e rd
4
if
,. f
(
r)
-f
(.,,)
lllll
-
r +:1:,r
.1' .l'0
2
.t
5
I
9
9
I
11
26
28
2B
l4
16
t7
20
n,l
29
31
J,)
ll4
41
+t)
46
erists. Wren. this li;n,it, eri,sts it is den.ot.ed hy
f 'Qs)
and
is cal,led lfte derivative o.f
J
o,t.;t17. [f a
{unc.t,iott f
ho,s tt
dcriuatiue o,t. cach poin,t itt. a sei
'Y
then
f
is sa,id, t.o be
differerrtiable ori X. Thc d,er'iuatire o.f
f
at rs is the.
slope o.f lhe tt'tn11ent li,ne to the qraph o.f
f
at (r'0,
./(r'o)).
Thc set of fiinctions that are rr times contimrorislv dif-
l-ereritiahle on an ilterrl.al
[o,
b] is tierrr t,ecl lrv
/"fo,
0];
sirlilar'lv, the. st-.t. t:f lril funclions tirat .lrirve derivative's of
trll orrlers r-ur
[a,
6] is dtttotetl b1. 6--fri, 6]. Exnmples of
srrr'1r lurict iorrs irx:ludc
J:o1r.rxnnials,
r'a1.iontr1 fuucl ir.urs.
1r'igr.rruxrrt,l.rical fiurr:t.io1ls, expollrnl,ia1 fulct,ions errid
logaritiuriir' ftrn<:tiurs, providr:d thet, arer <lefiucd on tlt'
given irrtenai.
'I
he fbliowi]rg
'lhcoreuls
are irnportant irr tleril'ing
n)t.tlrods lbr err<rr csl.inlrrles irr nuurcrir:a1 anzrlv-qis. Iheir
proolii <'a:r l>e forur<i in an_v s[ar]da,r<l text on Aclr.anr:etl
(lalculus.
Tlrccrrem l.2 (The Ntlean Value Theorem) If
.f
e
Cfo. 6] anil
J
is differentio,bl,e otr,(.u. b), then lhere erisls
rt ttnrnltrr c irt.
(o,
b) sur:h lho,t
a ntnn,her c e
ln.
b] su,ch llrul
.f 'tri
nr V .r c
fn,
/;]
11'I V .r c
fri,
6l t
C
0. then. lhere et:i,sls
0.
rt, \ ./(i,) ,f
(r)
,t t(')
t,
-,
Jlrr
Fig. 2. Rc,lie's
'I-ltcor.'trr
Theorern 1.4 (Generalized Rolle!s Theorem) /,r:l
.f
r Cla, hl be n t.trnas d,iffert:rtl.iultlt' ort (.tt. b). l.l
.f
tanishr:s ut thi,, tt I I d.istinct poinl.:- .r:0,.rili.r:,.'' ..r',
irt
lo.
bl. then, thr:.*: is cr rttnnhtr c in
itr.
lt)
-*ttclt
lltul
ytnrir,) .,.
0.
Theorern 1.5 (Tire Extrerrre Valuc Theorenr) L:l
f
he. a r:ontirtLt.otr.s
fulttliott
on, lhr cLosed irtl.errol
lo.
bi
Tlttm,
.f
ttt.!tr,irts art absolrLl.e nt,urirt,utn, 1[, uttl. il,]t tt.bst,-
lu,le trtittirnurn. rtt ul xnnt
Ttoirtls {1
uttd,
&2
re;4.diri.!1.
'fhn.l
is.
t1)
.?\/ ./((r )
lG:)
t'
Fig. 1. The lUealr-\talue Tlteorem
Tlreorem l.3 (Rolle's Theorem) Su,ppose
{-[a,
fl
nnd
.f
is r]i.fferentiahle on (o. b). If
f {.n)
Theorem 1.6 (Interruediate Valrre Theoreru) /.1
f
e Clo, ltl andUo is at:u rtrtnthtrbetu:een
f
(u)
artd l'(b),
then. thera r:t:lsl.:- rr nLLnt.her c nt. (rt .b) such thot
f
(c)
,t,..
that
f
- f(t,)
t
&-rr
(,-
qL
t,hat, is
Theorerrr 1.8 (Taylor's Theorem) Supiro;r,
-f
6(ir)fa, h]. un.d./('-i
1)
e.tisls ott (n. lr), rr'rrrl
"r11
c
fo,
Th,en
.for
eLter'! :t: e
[n.
bl, t.ltcrt: t::r'ists
{(.r')
/-
[.r'rr,
suclt th at
ll Ji}r]j
ufit.err:
sztrh tltat
t
i:n
/(()
:
r /(r,)
1)u
r-l
l:rt
/?/({)
-
f
.rrc,)
l:l
.f,(,) -
/',,(.,') I /?,,(.r').
n
-,
i-\ .
_:.i\^r{.r.ir),
rr
!.
____
,__
(.1. I'rt
)
A:I
(:
lrl .
.z)
Fig. 3. Exitreme Vhlue Tl:reorenr
The ahol'e theorern states that a continliolis function
on rhe ciosecl interr.ai
[o,
&] takes on ever]'interrnediate
r.ahx: l:eturen
.f 1n)
an<l
/(ir).
It is therefore. important
il tlt't.r'rrnir-rilrg. iilnorrg other thirrgs, rvhe[irer a.n inLervir]
('ontaiu-q
a roof ri{'ft givcrn lunct.ion.
Theorem 1.7 (Weiglrted Mean Valrre Theorem for
Let
f
be o contittu,ou,s ftLncl.i,ort on the clo.sed interttal
[rr,
61, ortd lel (i,(1....
,(, be poin,ts in
lo.
b]. Then
I.ltt:re is a po.int ( tn (n. b) suth tltut
zl:n
f rte ,l
,?
/()
L-,
i:l
Proof l.I [,t:t
(a) x't n5x{/(.r:)
lr
e
[a.
1l]]
(b) nt
-
r{n{/(.r)lr e
[o,
6]]
Tlten. nt <
f
(t) < L'f , .for
all r e
[o,
b]. Th,erefore,
nnt I
f
f(e,)
{ n l,I.
.for
alt (r e
[n,
6]
z-l
or equit:o,lent,ly.
"f
(rn) t
.f'(.r'n)(.r' -
.ro) -f
I"
l'-'t')
,.,' ,
n)=
, Yi")(.r'n).
f "'+
,!
(,' .i'nl
ottd
r'in ll)/c/,.\\
R,,(r)
-
#t".
.r-nlinrt).
(n
l 1)!
The
Ttolutotnial
P,,(t'\ is callal lizrr n-th Taylor poly-
Srrmalnial
lot f
ohou.t ):i1, and /1,,(.r') is c.alled. lhc rernain-
der terur or t,he tmncation error rusirx'itled u,ilh
&(r,).
In the spe.ciaL r.o,se ruht'.n. r'o
-
0, tht: 71t11lt;r polu-
nomial is called a Maclauriu polynornial.
7/re Taylor Series
fctr f
o,borrt..t:;1 is oliuintd. h11 ta.l;ing
th,e lint,it lirrl,,-.,,
R,(.r'). Simikt,r!,11. lfic Maclaurin Se-
ries./or
f
about r 0 is ohlaint,d b11 |.rtl,ing tht: lim.it.
1ir.n,r-,,-, P"(.r).
2 Floating-point mrrntrer systerns
Cornl>uters gctrcralf i., store reo,l nrnnbars using a
.ll,orLtinq-
pozn.l notation, t'hich is verl' rlrrch like tire scrt:iili/r-rr
n.ot,al.iott. lirr ex;rtuple, tht, li,:ted-poii.l rle-r'irrLal uittrrlrc.r
967.1114 has a floating point representatiou as 0.9[i7.J1.1 :r
1Oil:
-\imilnrl)'.
the rmmber'0.(X)(l(10415 is reprtsenterl as
0.415 x i0
-5.
Generirilv, zr floatirrg-poiut uumber lras thc lc,nn
+.d1 d? d;; "'dn *;l',
rvhere 0
(
r1r <1 IJ
-
1, ancl
(2 t)
1
t:fl
,,, <
1f
"r(9,)
<
,lr,
{; e
[a.
t,]
tl
u
?::1
The-n. h11 t.he htta.rm,ediat e I'-a,lu,e Theorem,, there
'is
a poinl,
(a) rl
-
is the base, rrsnallt, 2. 10 or 16.
(b) p
-
tire nnmber of significani cligits is callecl the
precision.
(c)
"
the exponent, ranging frorn E-;, i.o E*nr.
In hand calcrrlators, the be.rse ll is risuallv 10, hower.er
in cornpriters, the ba-se is often 2; sometimes a hase of
16 is rrsecl. The fi'action 0.d1 d2r\ ... do is calleci the
rrrarrtissa. 1-he fl<"l:rtiug-point nurnberr (2.1) is sairl fo
lre normalized if dt
/
0.
The parameters ii, p.E*i, ancl -E;r*r, specit-v all nu-
lrerical rralues that cau be represented. Ilow-ever, tl.rese
numbets \'irrlr among cornpriters.
Di ffe rent c(ltrrpr r ter m aui.r fa,r't urers r isecl u.']r a,te'"'er forr.n s
t
jrev
ct.rnsiclt,re<1 nlrptopriat,e. C)onscqutrrtly. there. wert:
rrL;rrrl rlifii,r'r'rrl fluill irrg-lloirrt svst('rus.
Exaurple 2.1 The
.follouti,ng
are- norm,alized
flttal,inrl-
1tt-tirtl
rt.u:n,hers. utit.h
il
,,,..
10. an.d p
-
4.
71.9i1
-.0.7195
x 102
:1. 1,13
-
0.lll-lil x 10i
478S-0.4788x104
0.0008463
-
0.846i3 x 10
3
0.5463
..,
0.5463 x 100
0.0098-0.9800x10-2
Example 2.2 Con,sitler a simplifi,ed cnse uit.h. i3
2.p--2.and-2<c<:3.
Iri llt i.s sttstem, aLl nonn.o.li:ed n rtmbers utill be o.f the
fonn
f ..10 r 2e, 0r t.11 x 2',
-2<eS:j
7'h t. n r r m be-rs rep res en t ablc in t.h i s s rt st, etn, th erc.f o re ratt, q e
.from
.11x:)3
-6
to *.11 x23-0.
,4 ltsl o.f rtll t,he positiue nu,m,bers in the ctboue s11st.em. nrt::
It is rr.presentecl a.s the rlrmlrer wilh al1 ztros in ilre
fraction
(it
is not nonnalizecl) il'ith a zcro
('xl)onert.
Obserr.e the gaps in tht systern representecl above. fu
the compriter, a1i tire nutnberrs 4, 4.1,
:{.!:1.:}
iu-r'a1l tlu'
same, il chopping is usecl.
Since the lumher of signific:rnt cligits usr.d iu a floating-
point s1'stern is fixerl, there is orl\. a {inile mrnbc.r of
clistinct r.ahrcs in tho corrrpull''s Lmrul>t.r sl',stcnl in
contra-st to the real nrimber s\.ste'rn.
Let lFo clenote the set ol all nornralizr.cl floating-point
nurrbt,rs of preci,sicnt,p. fhe set If
o
is n.o/ r,lo.sedirncler the
operatiur-s o{ o,d,d,i,tion. sttbt,ral:.t i on. tnttll i.pl,it.o,l ion lnrcl
d,iuisittn. Thai is, a cornprited nrimbcr can fali outsirle
the'reurgc of lFr,. Thcrc are t$,o $,a\-s in which this can
happen.
(a) the fractionarl part may contain n,.rrcr thau
ir
rligits.
(lr) tlre crpont'.tr.t. o[ tire rrrimbrrr ]r,r]'fhll oritsi<le'tlrt'in-
tcr\.al
[l']mzr
, ]ir,,r,r.f .
If a courputatiou
lrrorhi<'es
a nrunber lvit,h an r,x1rr-rnt-nt
too large'to fjt, i:r:r given ('oinplrter.
then t,he sitrratiol i-s
callecl an overflow. Ou the iither hancl, il a r:omputation
prclcluces it nurnber ii"'ith an r,rxtr)otreltt t<;o srn:tll to l;e
rr.prr.se'ntertl, tht sitnirtiou is r<:irlr'reri tti an (underflowl.
Example 2.3 Cirtn sider thc
followittg
sirn,pl.i{i etl
ll,oo,t
in,q-
point sust.ent ui{h
ll
-
10. p
-
i3, Fl,,,in
-
l, F;r,,,,.
-'2.
Let 0 116.4
-
.lJ6,l x 102, b 1.g5 .1,!i-:) :: lt)t, c
.125 .125 x l0o.
Tlrtn
(a) The prorluct l o x ir .671-i4 x i02 is not in lFr.
(b) fflre. plo<luct '!! n ./.,i ,rl .1ij2490 r 1t)+ r'esnlrs
t.o ar ouerfl.out.
(c)'flr<' protirr<1 z c x
] -
.::+:l+ x 10
?
resrrlts in an
u'nd,t:rJlout.
For lnost compirters. the resrrlt of trn ol,t,rflot, is *rx: tht:
::::n "
an underflou'will risriallv be to set thr. r,alrre trr
9.1 Rotmil.ing Error'.s
When rlal;r are rearl into a r:ornputer. they art trirns-
latecl int.o tjre fir'rite nurnhel s)rstr,ln o1- the coruplrter'.
l'liis Lranslat.icin wiil usrial.lv irrvolve sorne rourrd-off
error. In addition, sornetimes the cornprited re'srr1t of a
giveri rr.ai number Irrlls t.xitsi<lc t1u' r'arigi' ri[ lFr,.
'I1rt'rc
are two urethocls ol rk,aliug n,ith thls prolrlt tu.
10,2
I
1
E
.10x21
-
1
lI.2
'
jJ
.Ltx2t
I
16 s
.ri x z1
-
ii
.11 x 22
.,.l3
2
.10x2
1-1
4
.10x22-2
-1
.1(l x 2"
I
.10x23-4
.llx20-i
4
.11 x23,-6
Tire negatir,'e values u'ill be similarly distribr.rtecl. \\re
obsen-e that .:ero is rrot preseut iu the a,bove system.
Sri;lpose that the reai ulrmber r- ha,s exact representation
in it riorrnrrft ::ed
.lloat,in.q-poznl
forrn as
.r
-
0.dr dz...dpdp1rdpt2
.."xiJe
e e
f4pinE,,u,r.]
Thc floating-point rcpresentarioll of :r, denoted h1..fl(:ir),
is obtained bv termina.ting the mantissa of r: at p digits.
1'lrcrc ilre two lvzi\:s t-rf rkrirrg rhis.
One nrethoci cal1ed chopping. simplv chops offthe cligibs
dp;
td1,t:.)
"' to obtain
.ft(p)
-
0.r:/1 r12
. ..
r/, x li''
Tht other rnethoci, linown as rounding, gi\,?s
(2 r)
dp). x
ll" if 0
(
dp;r
(
rlr). + (0.00.
.0i),;]
x J"
The error rhat results lrorn replacing a nurnber with it,s
floatirrg-lloint firrrn is cailerl a rourrd-off er.ror. irre-
spective of whether choppinq or rotLn.di.n,q is trsecl.
Example 2.4 Con,sid.er the co.se tuhere B
-
10, an.d
p
-
7. The irrationaL n.Ltnt.ber;r
-
3.14159265... , has
n or rrt.ali :ul
fi
orii rLq -po i n l. rlec,i.r rxtl
f
ortrt gi L: tn b,u
;
-
0.31,1159265.
..
x 101
.1 7-rligit floal,i,nq-poittt
.form,
o,f ir usinll chopping ls
f
l{")
-
0.i1141592 x 101
On the cttlter lta*d, a 7-dzqit
floali,ng-poinl fonn.
u,sinq
rounding ls
./l(")
-
0.1]141593 x l0r
!. 1.1 Estitn.o,ting e.rrors
Nurnerical errors that occrir due to eithcr rountling or
clropping arer r:alled round-off errors. The foliowing
clcfirritions clescribt two methocls for measrrring approx-
inratr. errors.
Definition 2.1 (Absolrrte Error)
,I/rt,
absolute er-
ror in, appnn:imo,ting a nutn,lter t ltrl i' is qittcn by
Err.:
lft-*l
Definition 2.2 (Relative Error) Tiierelative error
'in,
approtimo.tin,g o, ntt,mher t h11 .i: is q.ittt:n
bry
l"l *o
Example 2.5
{a) Lel, r
- 2.itl he apprttilrnaled hu
j'
-
2.50.
Tltt.:rt. Err,
l.r
ii 0.01, an.d,
nt t,
lI
{).{l{lli9s4.
"
2.ir l
lh) Lelg
..
0.2i bc a:p'pro.ritttatc.d hg.it 0.20. Tht:n.
Err,,
- ly - ul-
0.01, Rct,,
33 -
f).r).17t,19.
"
0lI
(c) Lct.:-0.0000111, ,
-0.0tn008.
Tlten, Err-,
- l; -
2l
-
0.0000A5 cmd
Hrt,
Lf
ftijfi#j#
{).;txr{i2
In Exarnples (a)
anrl (b), the relat,ive nnrrrs irrciicat,t rhat
i is clt:ser to .r" thau
.z)
is to g. r.vht reas the alrsohiit err.ors
give nr> indicat ion of t his nr a 1l .
Irr Iixample (c) thc irhsolurt. error l:-r-r- is verr. suriill.
ho*'ever the iarge thc.relatir.r'error lir1., inclicar<.s ilrat
i is not a goo<1 allpllrxiuratiotl l{) ;.
Thus, rclatir.e orror is rnote risr.iiri in rlt'asru'ing olrr)r.s
than the ab-s61111" elror. A srnail error in a lclalir.elr' largc
nrtrnber ruay ttot, br. rcl'1, serit it..r. I{owerre'r. I itrr sarrt'r,r'nrr
iu a relnr.ivelv slrall nu:lber cor-rld [;r' vr.r.\r ciic:1<tl.un{.
The following gives al cspres-siou lirr the rr,l;rrive r.rror
iu exlxrssinc :: r'eal nuruber ;' lrv its floarirrg-point rtlr
resentation
fl
(t), t,.:ir-tg p di git s.
Theorem 2.L Let
.f
lQ) he the
.floatirtq-poirtt
reTtrrstrt-
t.at.iort of a reo,l ttu.nt.hcr t.
'l'ltttt
f f
t(r)l
-
.. l\
;t
,,
{or
nttrn,titty
Pi
:r,,
tl,
,
sn,,t,,p1,,,,1
(2
3)
Proof 2.L Proo.f
,for
rrxurling.
Let r he rsizten h.4
"
-
(0.r\d2..'dpdpt.t...
.) x i]" uht.rc tfi
/
0, uttd
0 < di 1 iJ. Tlten retr,rtdin.q r rlit:es ont: o.f the.frtlhtit,ittq
11
tto I i t t q - po i r t I n rr t n hr: rs :
l,i
-
rl
Rel*-
-'i
(
/1(.) {+({)'dt'tz"'
[+ [ro.
d1tt2
...
ttis ctp11<;3.
(i) ri
-
(0.dld2
(i.i) :ri,
- l(0.
dr .12
so tltat
"r
C (:r; r,1).
t.ho.t r is closar to ri.
lr-.,1
<
Thcre.fore.
i.t
- .f/(.r)l
lr,l
..
dr,) x c'
.-.dr*3 r)l
xil'
Wit.hont loss o{ gen.eralit11,
than ri;. Then,,
1_t
r-
-
I _ ?f-P
jl'tt
ttil
jeP
The rc,.fore, the reLalire error is
l.r'
r-,1
-
1
-\-
il-P
ir,l
*'2O.dtdz...
drdr11
I 3-p
<- __
--.)
i
D
i,
111
,
- -.)
)
Proo.f
for
chopping.
l.r
- .fl("r:)l -
(0.00.'
.00dp
Fldp F:'
..)r
x ,l'
--
(dpa-ttlp,+2.
. .),;
x i?
< irti.
i).
the relati,tv ercor in
/1(.r)
is
p iti3./or double precision, inslead o.f p
'),1
.for
single precision rttltrccs tltt: round.-oJJ t:rcor.
Definition 2.3 Tha.quo.ntitrl p in
{J.It.)
is o.ftcttrc{trrcd.
to as th.e machine epsilon. It, is tht srnal,lt'st.
ltosilirtt:
fl
oati,n g-point num.her
.for
ult i.i:h
fttt+F)
> 1.
2.2 SiqttiJirnttl Diqils
"I'he
siguificant digits in a uumber con-qists of tht first
lrollzclo digit and all su<rceeding rligits. J'hus, 2.S150 ha.s
five significant <iigits^
q,hile. (l.tlti3.l
has thre'c signi{icant
digit-s.
A number.i is said to agree with another rlurnber
.r to n significaut digits, if both i and .r round to
the same mrmbcr to rr significant digits.
In Iixirmples (2.5) (a) ancl
{b)
ahon,, i ancl .r agree
tr) laro
-significar.rt
cligil.s. rvhele.as.q nncl
.i7
alye('t{) o//.
sigrificarit digit..
The reiatir.e error gives arr indicatiorr of tlx. rnull;err ,:r[
signifir:aut digits in trn approxirlrzrte ?lnsl
.,er.
\ilu'c,sirer:il'-
icalltr, u'e havt, the lirllo'"l,irrB:
Definition 2.4 iSiwi.ficunl Diqitsi ,4. dtt.:i.lt.nl nurnbtr.i
is so,irl t.o apltro:r:i:rto.{r: a rLecirt.ttl rt.u.rnbtr L:, t.tt t't signif-
icant digits, iJ'n is llte ktrllest n,onrte.rlntit:e inle.ga:r
.far
ulti.ch the. rclo.ti.Lrt arror
li
-
;r.l
Rel*
-
+
(
5 x l()-". l?.(i)
l"l
Example 2.6 Detenn,ine t.ltc nunrber of .s)grt,iJir.anl i{t11-
il,s in the
follouin.q
approt:irna.tirtrts:
( a.) Let :'
--
1.000000, i' i.00039E.
(b) Ltr y-,3.14iir92,
il-:3.14
(c) Lct;-0.00001.1. ,
-0.00{)005
Solution
(n)"-1.000000, i- 1.000;198, R,e,l,.
t,, jl _ 0:0!{J?ilig0
l}.9g x l0
1
< ir :< 10
lr,l
I.000000
Thris i approxin'rates :' to forrr'
-significant
cligiis.
(b) y -,, 3.141592.
'i/ .- :3.1.1. flel,,
.lh,$
lj*5.0ti75x10
+
< 5x10:t.
rrefi.rre
;rj
approxirnrrtes
:l/
t() thrtt siglii[icant
ft).
r11 d2
.. .),,
,i
i1-
p
il'
iL
o,ss1,?n.c
(2.4)
-(t].t116"'),,
.front,
u,lti.ch u,e obt.oit"t..
hi the clecirnal systern, w-e hal.e l, 10, aucl so the max-
iiuurr rtlative el'r'or- in appr<-rxim:rting a real nuruber lr-s-
ing p digits is.
l.r f
l(.r)l
-
(S x 10
r
for rorrrr<lirrg
p1
: lt
I
to'
,
lor r.lruplrirrg
(2 5)
The worst-ca-se rourcl-off effects clue to rorucling is hali
tire
q'olst-case
rouncl-off effects lrom chopping. Ilow-ever,
lrecairse of the aclclitional work inr,-oh,-ed iu the rorrncling
pr'o {{:rSS, nlailr-y comput,(.r's r.lse <:}roptrl i ng.
Remark 2.L From t h e abot, e ut e n ot,e t.h o,t t.h c. m ot i rnu m,
rt-.lo,tir:1.. c.rror ( u;ht:th.er ruu.nil,in,g or choppi,ng) d,eptttd.s
onlu Lttt.p. t/rr: precisi-on of the t:ontpu,t,er', and n.ot, on t,he
si::r. uf ther nu;nbr,:r. Wc con t.here:.fore, reduce t,lte rurund-
o.lJ erntr hq irtt-.reo.sinr1 f,lte ralue o.f p. For ir't,stanrc, usinq
(") r 0.000013. i 0.000008, Rel,,
1,,
,il
-
5.!qg.q.1;!6
-
0.11g462 { i.r x x10
0.
i.l
0.000011
Therefore 2 zrpproxirnates z to ri,o
-sigrificant
dig-
i ts.
!. J. 1 Loss of Sign ifican,ce.
Consider the following two numbers .?r 0.70711i1852,
arrd 17 -,, 0.707t1ti78t, lroth of *'irich ]rave I tltcinrzrl dig-
it,s of yrrecision. llherir difl'erence. :r
ll
,.-.
t).000002929,
has olly forrr cligils ol precisiou. This pheuomenon is
callc.rl loss of significance or subtractive cancella-
tion.
For Example,
'fhe fauriliar qi,radrirtic formuia,
b+lF-,1ttc
.I-
'20
ibr the sohition of the quaclratic equation a.r2 * b.r' -1- c
-
0. prr-rl.i<ie,s a ver1, good example rn htte iciss of signific:auct:
ccxrlci occur. Assurne that
r/Fl
4,rc > 0, then the two
rt'al rriots, J1 itnd .|:2 arc givr:n lrv
t+'/F-*n
2a (h
'ttl
a,*)
lrorn which we get
2c
.t"r:
"
6 Jfi-,ilrt'
(2.1o)
In both (2.9) ancl (2.10) w-e har.,e ar.oiclecl thc 1i:ss olr.ig-
nific'alce thi:t crxrlcl ]rave rersultnd frorl the subtractiorr
of nearly equal qnantities in tire computatitx ol .?'1 ;1ucl
7'.2.
Example 2.7
(:onsid,er
solri,nq thr. quadralit: rilurttictn
.r2 80:r | 1
-
0.
'I'ht.z e:tttt:t. nxtt; arL:
zr
-
40 + /1599 rz
-
40
',Cln
\Yit h si ti rii g i t orith nt tl i r. r w uh t,tt i n l l t r
.ft
il,o t t' i r r t
1
rt
{
t
l
} rt ) t: -
i,matiort,s to the rool,s:
ir
...
79.987it .r,2 0.01250
uilh corrc..sp on di,n rl ah s olu t e e.r'rors
lr,
.rirl- 0.19Il x 10
5
lr',
i,:l
-
0.1tt5 x 10
5
an d correspon rli,n11 re.l,afi r: e erro rs
ir, .rt,,l
-
i.r" ,i"i
Jl1 J!2
The hi,glh re.Latit:e e.rrttrirt :t'z iu,d,it:ates a Loss of siqnili-
crnt.r:e irL if,s approrisn,at.iott'utith i2. Thi.s cttuld hattt lx'crt
atoided hy ttsitt.g Fornrula,
{!.10)
irt,st.ead,. Tltat is.
t, JtF E,n
'2
-
- 8{) r/t;g!l
so /r8o: l
.-
0.0125t)2t)
utith c.orrespond,ing rel,atiue crror i.rt .r:2 giuttt b11
I.r', .i" I
J-2
Sirrrilar'h'. iib < l). rlrcn
:l'a
(
-\
O ,,,, 4rrr'\
-l
'2u
)
b2 (42
-
+o,)
(-t, + ,/tr
't*)
(-t t ,/6t +w1
;l'1
'1':l
--
ll l,r .>>
.{nc.
tlrcn b2
=
1/f,r 1,n arrd lrcrrce
(2 7)
(2.8)
suffer a severe 1o-ss of
-qignificant
suffer a severe loss of significant
'2u
-,
-
!/F
-1u"
(a) thc root 11 will
digitsifb>0
(b) the root .r'2 r.till
cligit.sif6<0
Tlris ,qitriation can be a'u'oicled by ro,t.ion.ali::ing t.he d,e-
n.otn'inator.
IIb>0.then
r
(_-F)
lf (6?
-
aac)
2a ((t t.,tr -4*)
lrorn t,hich t't, gct
( 6
.,/tr
-:4-,4)
(-h-\/F-+,u1
2c
IA
-
Unr,;. 4ur.
J'o
r'') o\
{a)
{h)
(c)
1,:l)
( r,.)
(f)
E.tercise.s
Exercise 2.L Writ,e l,h.e
.fctllouinrt
decint,al num,hers o.s
,fioo.litlr1-point,
n,unthers. urit,h
'pret-i.sion
1:t
,.-,
4.
(,r) 34.3217 (e) 0.0007435 (c)
-852
(d) 74.00
Exercise 2.2 lVrite ench o.f th.e.follouting decim,al ntnn.-
6t,r.s as o, fkto,ting-poinl. nutnber u:il.h. p
-. 4. usinfl (i)
("ihoptrritrg
artd (ii) rotmdin.q
((r) 2.;l r0 (1,) i.es76;
(")
?
(,/)
T
f.)
f
Exercise 2.3 For the
.fctllou;i,rt7
pairs of nurnhers e' rmd.
i. rlcrtermine ltt.tu: rno,ny si,gntfurunt di,gi,ts there are in. i
ttith rc.sltect to :t:.
"r:
725.03
"i -. 725.028
.r,
-
0.045803 i'- 0.045813
r
-
4ll.618ti :i
-
4:3.6286
:r
-
2,7i8281 .i
-,
2.7i8
.r-0.0271027 i 0.02710i]7
r' 100,
('X)0
:i
.-
99996
3 Solrrtions of Nonlinear Equations
irr rhis section we consicler tire nurnerical solutions of
nonjinr.ar equations ol the fonn
.f(,)-o
(3.1)
u,irere
/
is a contirurorrslv cliffcrentiable function of a
sirrglc valial;k: .r. 'l'hc valLres of .r' whiclr satisi.r' (3.1) arr:
cailt'd the roots of
/(r)
-
0, or the zeros of
.f
(r).
Somt, cxamples of nonlinear eqrrations are:
l.Jr?*5:r, 2-0
,3 2.t:2 5;r: i G o
..:3 r 4r'? - Lo-t)
;19.:l:l5r'r
-7.9454.t: + 6.3240
-
0
lJ;rle-2.9.tr5r{+1-0
j.lc
to"'+
tan.x
-
0
r:
-r'-
r'os(r:)
3't:*sin(r')-r:''-0
Exact sohitions ol most nonlinear eqr.rations are ahnost
irupos-si[;l<. to obta.irr. e,xc(,1)t irr t.irc fer,i, <,ase.. where
/(r')
is a facl,olizable
lrol).norrrirrl.
Iirr exeurrple. tlie quarlratic
anrl thc, c'ubic rquatioris givtn as thc' first tu'o t'xampies
rrlrt.ne. ]lowever. llrr.re are ru geueral formllae for t}ie
t xact solntion ol polvnomial eqr.rations of degree greater
than 4.
Sonre equations involving transcenclental fuuctior-rs,
such as sin:', cosr. e",1og:r and so forth may be
-solv-ed
bv maklng use ol
1-rroperties
of the
P:rrticlllirr
tran-scen-
cltnlal fririctions inr...rh.'ed. In most t'ases. lrotcr.t'r, anrl
in particular tho lir-st three cxarnl>les, these cqliirii()lls
(:anil0t
bt. so easiiy sohrecl.
For rnany cia.sses of cquations, the rnost r:orltlt-rnlv tisecl
metLrods are iterative nrethods.
'I'lN'sc
rrietlitxls stari
wit.lr r-rne
()r
rn()r(r init iul gucsses. ;rrrtl tlrtrr coirrputer sirc-
cessivcr :rpllroxiuratiorrs u,llich iropt:firiIv.
(xrn\rge
to the
root of
/(r') -
0
1.1 Ert,tr-ttpm,ent, ttt.t:llttitl..s
\\t will flrst, crn-sicler those methocls r.r'hicir are s,-lntr-
times rerf'erred t.c.r a-q r,.nt.raprtt:.rt.t rnr:thocl,s. I'hese met,h-
ocls
-st,art
u.ith ari irrtervzrL euclosing lhe lr-rot. arr<l then
proctrrtl 1,ri obtain at seqllen{rrr o{ shriukiug^
-srrb-init'r'viL1s
rn'hir:h eveni.ually trap t llc r'oot . f lu' tlgcx'it irnrs lilr t hrrsr.
nrt'ttiocls ar<. ba-sr:d orr l ire lbiknviug'I'hc'or<,m.
Theorem 3.1 (The Intermediate Value Theorern)
If
.f
(r) is a c.tttt.tinrr,otu
fLr,n.ction.
ott lhe ittltt'tta.l.
Ltt,
h7,
and
fio)f
(b) < 0, then bg lfie intermediate value
tlreorem. there e:t:isl.s rLt. l.easl one
ltoirt.l I)
C (rr. h)
-su,tlt
tha,t
l(p')
.-
0.
Exercise 3.1 5horr tltat each o.f the.folbu;itq.ftntr:ti.on.s
haur:. ttz,ero in tha ittdirnll:rJ inlr,rrul .
{a) .f
(r)
-
f rr
"r
1
[1,
2]
(b)
f {r)
-
.r r:os(.r,)
10,
1l
ic) f(.r)-r
c''
[0.
1]
(rl,)
f {r') -
t:it | 2.r'r I 10;r'- 20
11,
2]
{") f {r)
12 sin("r') 2
U,
2l
{1.) .f
(r,) iJ.r. 1 .siru ("r') e''
[0,
1] an,l
f
1, 2l
3.2 Tl't,e Risectlon. method
The bisection method starts u,ith au interi.'ai
frr,
/rl.
irr r,l,hidr a root of l,ht: equation
.f(r,)
{) is l<rxru'rr t.l
r:xist, [r1. thr: iact, that
./'("r:)
is c'ont,innrxrs ou llr(] irrl ervnl
[o.
6]
,
arrd t]rat
./(rr)
arrrl
/(6)
havt, ollrositc sigrrs. so
that
/(n)/(6)
< 0. b)'Theorernr (3.1).
Given these conditions, tirc bistction rncthotl is guaran-
teecl to fincl aroot olthe eqrration
l'(.r)
'
0 iu tlre irrler'-
rrril
[a.
]].
Fig. 4. Tlre Risect,ion I\Iethori
v:-f(x)
aB
P5
ti3
Tht, method $,orlis by repla,cing the trapping inrerval bl.
a new trapping interv"al of halvecl wiclth, at each step.
Tire scher.ne proceecls as follow-s:
Set a1
-
a, br
-
6 ancllet pr
-
*{ot
* 6r). Theu one of
the foliorving three s<:enzlrios occurs:
/(ar)/(pr)
(0,
the roor r e
[nr,
p,]. Set a2
-
6r, bz-
]tt
Jl1t1)f \b1)
< 0, the roor r
lrr,,
b,l.Ser ri2
-
p1, b,
-
b1
f
(pr) 0, rhe-. root. r pt.
Tlre process is then repeated with the inte'rval
lor,
br].
The widtir of tiris iutc.rl'a1 is h:rlf r.he width of thet orig-
jrrirl
in{.elva1.
"Ihar
is, 62 il,r
.,,-
t't=at
-
t+
Alter n
it,erations the width of the trappin{intervai[a,,. b,,] is
rtriuced to
#..a
tirrers the widt.h of the r.rriginal irrt,eri,al.
r
1tn1
[1,,
F,, Sl)n
l(,,,+/,,,)
1,U,
,,,)
t-+
7'herdore
l. t'"ls+
Corollary 3.1 Tht. rtutnbtr n ol iterations recluirtrl. to
corttpu.Le a root oJ
f \::l
..,
0 wtth olt at:(:1u11('.u oJ e, ott Lhe
/:ttlt: rtttl,
[a
. b] rs
Sin,ce r e (o", 6"
).
trr:. hrn,e. r I ltn, and so
rr)
kts(l
I
t')(lt .,
)
Letq2
Proof 3.2 Using Thc.ort:m,
l;].2.)
u'e nusl
lird on n sut-h
t,hat
lr 7;,1
<2"(6 n)<r
Th, i s i m4t li tz s th.o.t
2
"(b-a)
< e
an.rJ so
':"
2
11r, (t)
(
Taking logari{,h.m
{to
lny lta.st
)
rliLte-s
I
rt lotl) ) lor1l(b rr)

Therefore
too!(b n\
,,2#
Examtrrle 3.L For an, in.fcruo,Lll ,
'2]t,
uti.th r - 1{)
I
rr:e
ob{,o,in
P"
'f
hus
,lta
O,,
(l
rt
'2,, t
'
lo.qlOa(l, o) log10a('2 l)
Tlreorenr 3.2
ff]isectiort
A'{ethod,! Let.
f Q')
e Cla, tt],
n.nd stL1tpose thal
J@)f(b)
< 0. Tl'ten. the. Ri,sc.r:tiort
meiltetd glenerates a sequence
{pnl-
opprori,m,ati,ng the
rottt r. of
f
(;r)
-
0. su,r'lt lha!,
n) I t1.288
lr_
pnl
<D=,n,n)1 .2rt
Proof 3.L Fctr each n ) l, u;e hate
I
pn
1(rr, * ll,
)
Z
.
h- n
l)r, rl,,
-
JiJ
(3 2)
log 2 l.oq 2
Tlte least. nu,m,her o.f iteration.s rcqlt,i,red
.for
the rlittett ar'-
.ur'z,cg is tltereJctrc n
,
74.
Example 3.2 []se the bi.set:l iort ntet.hod to o.ppro:titn,rtlt:
aroot o.f Lhe.ftmc|ion 13 +2;r2 3;r' 6 0 rn llte in.lert,al
[1,
2]
Table (1), gives 16 iteratious of tht' Ili,section rnotlrod.
ri'ith p16 -,. 1.73204801J4. 1'1rt' e:i;acl .srtltrIit.ur irr tire gir,'e'n
irr(t r',al is r
-
,,/3. The en'or irr 11re approxiruirtiorr, rrsirrg
10 de<rirnal digit acrrrrrrcv, is .10u11 x l0
r'.
(3 3)
(3,1)
(3.5)
10
('
ion l\,Iethod foi r):r'*2r'-31 6
,l o.n b,,
P":1i2(a,"1$,,1 f
(,t,,
)
t')
I
2
3
+
it
(i
T
t
I
1L)
l1
12
,.)
lL)
iI
lir
i6
l
1.,lr
1.5
1.625000
i.687ir00
1.7r B75r)
l.7r 8750
i.726563
r.730469
i.73044i9
I .73144r1
1.71] L9:14
1 .73 1 934
I .73i 934
1.73199ir
i.732025
1.73204t)
2
2
1.75000i)
r.750000
r.750000
i.750000
r.734375
t.tr)+J/.1
1.734375
t.732422
I :'?.) l.).)
r.7'32422
1.732r 78
1.7112056
1.7:l2Oir6
1.732056
1.7;i2056
1.5
1.750000
1.625000
1.fi8750t)
1.71875i)
l.r,)4.)/i)
1.726563
1.7304690
1.7:12422
1.73 i44ir
1.7ri 1934
1.732i78
1.732056
1.7it 1995
r.7:t2025
1.732040
1.732048
-2.62ir
0.2:l437ir
-i.3027J1
-0.56 i 77
-0.1 7069
0.1100t96e-1
-0.707:l7e-1
-0.204lJ5e-l
t).47982t-2
-0.78253e-2
-0. i5i53e-2
0. I6,11 lt'2
0.ti2788e-,1
-0.72627e-3
-0.331 76e-3
-0. I i1449+il
-i).115862e-21
Table l
1'hc'Bisect
'1.!.1 (lonre:r'gcrtt:t
oJ a Sequ.r:nce.
\rtrnerical solutions are oft('tl olttained l-lv courput.ing
se(lllcllce ol' approxinrit tions
..-l'1. J:2.
. .'
. f,'r,,.I,.{.
1.,
. . .,
tirai aplrroirchcs 11re clesirr,rd soluli(nt J:, sa),-.
Defi rrit iorr 3. 1
^9apposc
th o.l o, n. Lt,nt er ioal pro cedu.rt: 11 e rt -
e ro.tt':s a sequen.ce o.f appror.i,tnations r1, it.:2t
. . .
.JrA. .i:r
+ 1.
. .
thut ctttt.ut:r'qe.s t,o th.c tnt.e soht.tiort t.'l'hr:n,, ;..1, is saidto
approxi,m,ate the t,ru,e solu,tion to n si,qnificant dirtits, if
(I)
l&Tif-l
< bx10
r'.
Example 3.3 Shou thot.
.f Q;) -
:r2 szn(r,) 2 lro,s o,
zero ot1. l.hc intr:n:al
lt,
'll.
Oetenn,ittc tht. nutrt,hr:r n o,f
'itern,li,nns
rcqilire{l trt t'.otn1urlr, u nLoL o.f
.l'(L:'1
,,..0
rt:ilh tnt
o,c{:ul'oL-y of c -. 10
!,
on the qiL:tut iltr:n.:al.
Solutiort
l-able' (2) trelorv givcs the' re<lrrirexl nunrbr.r itf it,errations.
wit,lr
7-,y.1
...
1.728454590. 13,r, fheore.rrr (ii.2), the en{n.is
at ]ltost
l"
lr Pr+l
<
/(,r) -
r,3 r2
- .r' I
/(r)
.r,- cos(*:)
,,.
0
f
(r)
-.r -
e
"
-
0
"f
(r,)
-
r'ir + 2r2 + 10.r 20 0
"f
(r,) 12 szrr(-r,) 2 -. 0
/(r)
-
i3e * sin(r:) r"'
-
0.
'*;t-
6.ro;rrr. 05,
b -a 2-1
2"
'
;1-
Exercise 3.2 Solue the
.follotLritrrl
equ,ation,s bt1 thc' Ri-
section. nt.el.hod:
I.r',.
-
-i.,,-, I
r n. --.p L'
< 5x10_"
lrr.l
Sloppinq cond.it'ions
Choose e ) 0 and a po-si1l1,p iuteger A-e, ancl generate a
serqLrerrce pn ,.-
!1crn
* b,,) such that one. of t,he foilorvitrg
couditioris is srrrisfit,d:
(1)
lp" -p,
rl
(
e
i':;
h--4::-!
4.
t), /
o
ll'"l
(3)
l/(p"l
< o
(4) n > Are (maxiu'rrrm nunrher of iterations)
(3 6) (")
(b)
(c)
( ,1)
(e)
{f)
:1.;l lfh.e Metlnd oJ' Fal.st ]"i,tsitiott: Re.gula.fa.ls)
Like the bisection merltod. tire false position method
alscr cirllerl regula falsi is at t:rt.trapnt.t:nl rnethorl, ltnt
hzrs a fa.ster rat(' of convc,rgcllc(, thatr thc bist,ctiorr
methocl.
11
'l.*nbk'2
'hr:
Ili-sc,,ction rnethorl tbr
-.r'
sil?(.].J _1
n, 0 tt b,, p,,:7/2k:,
lb,)
f {p")
I
2
,,
.1
jj
t)
7
IJ
9
10
tl
t2
l3
t4
r.000000
1.5000r)0
f . ir00000
i.62500t)
1.687,:;00
r .71 8750
1.718750
I .726;lri3
1.72656i1
1.726563
1.727539
i.728027
1.72827 I
i.728391
2.0000t)t)
2.000000
r.750000
1.750000
1.750000
1.7ir00tJO
L./.r+.r,,)
i.,D+Jla)
1.7ii0,16!l
1.7285 l6
1.72851(i
i.7285 ] ti
1.7285 1 6
1.7285 i6
1.500000
I.7:r0U00
1.625000
1.687500
1.7 LB7rl0
L.I()+JIi}
[. r JOiitr.,
1.7;JU1(i9
1.72,\51ri
1.727ii|.t)
1.728U27
i.728271
1.728394
1.72845ir
-0.747-t9ir
0.U7x5 1/l
-0.Jir79U6
-{}. 115:'r{2
-0.r}ii4397
{}.i)2 I40(;
-u.006tt75
{).t)072.1lJ
0.00017r)
-0.(10;l:1..18
-0.00 i586
-0.u0u704
-0.000263
-0.()00tlrll
The methocl a,1so reqriires that
/(rs)J(r'r)
< 0. As in
the lrisecticln rrrethorl, we fincl a point ir2 betlveeu lu
artci 11 . <rzrlculate./'(,r::).alri rt'p[ar't'r'itht'r -rs or.r:r bv
.r3, tlclretulirrg ou u'hich of
./(re)
or
.f
(r:i) has the sarne
sigrr ir*s
/(r':).
The <liffercrrce bet.rverru this :ritthorl and
tlrt l>ist<rtion rnetlrod lies in our choice of t,her va.iue :12.
Rtrtlrtr thiur use the. rti<liroint lrf the irrterval, u,'e r"rblain
.r..r as lhc poinl rvirere t hr: straighi, lirre
joirring
tlie pclinls
(.l'6.
./(rs))
and (-r:1,
.f
(r't)) irrt.crsect u,ii.ir i.lre .rraxis. Se'c
figure (i1) bt:low.
Fig. ir. Geon.retlic ir.rterpretation of the me{hocl of False Po-
-siti0n
The equation of the line may be given by
r Start with
/(.x),
a conrirtloris fiutction on
[.rs,
r'r]:
16
arr<1
fi
as valiablcs st{l'ilrg 1hc' valitcs
l'(.r'11)
rrnd
J
(.r1
)
respccl.ivelv. irntl such t,iiat
J9
x
.f1
< 0.
o llr,pt'iil tir<' Iirll,xl-irrq stt'ps:
.
Set ;r'2 to: r'2 1',
Tilffi/(:r:1)
sri thai .r. is
corrt,ainerl in the interrval
["r:11.
.r1].
.
L-lyallal:e
/'(r,")
nrxl storc 1llis ir"s
.f:.
.
Check tlrat t.hc absoiutc rairN,
l.l.3l
is srrilicit,utlv tlif-
ft,r'enl lrorrr 0. sav
l./(.r':l)l
> c. lbr it,s sign to bc re
liablr. dtrtermhre.ri. Il this is lot so. wt, stop, rurcler
stopping cr:rnciilion 1.
.
Checlt tire sigrr of
/2.
Il
/2
has the sanre sign as
./s,
theri rcpl:rr:c llre r.ahie of rrir.rizrbie .10 r'ith the l-alue
.r2. aild t.hrl vah.re o[t]rc'r':rriable
.ft1
rvitlr tirer vzrluc'
.f2.
.
Il
,/3
iras the opposite sigri as.l11, thetr 11,1'1(rpla('('1]l(.
value of r.ariablc .r1
,,1,'ith (lrt,
r,alru' .]'r. iln(1 tlrt, value
of thtr virrial>lc
./r
wit]r thr' vahtc
f3,
.
Clheck
-st<tppiug
conrlit,iorr 2.
o flntii eilirer s[oppiug con<lilion ls satisficrl.
rher final r,ahrtr of 12 ha-s zl \ier\r srrrall assot:iatt'cl l'alut, oi'
/(:r2),
satisfvirg
l(;r2)
< r.
Corollary 3.2 (Stopping corrditions)
The uulut: of
J2
m,usl. lx: sufliritnlly tl.ifJ'en:u.l
J'ntrtt
:.r.ro.
.so,
l,f:l
> e , uhert e
-
l{l
i
.for
('-ttntlp!r. in ortler thol
t,ht: si.qn. o.f
,l'2
(1t,tt
br, reliabl'g del,erm.intrl.
Wc t-.atr u,se. ei,th,er or hoth o.f lht,
l'o!,lttu:itit1
irtrtiilirsrts lit
ntokt; tr.7t .sto1ttrti,ng ttttdi,t ion 2.
.
r53
is su,fficit,ttLl.u srn.al1.. so th.tLt l,ht,
Jittti
tn1)r'(:-c-
tilrt,att o,ssot i.o,l,t:tl aitlt Ih.c rrxt! is str.ffit:iettt{t1 strtu.l L irr
either t,bxtlu,t.e etr rr'.latiuc. ttttns.
o Too rnattrl itcro.t.ions hetre beert tttl;cn. llie t-.hoetsr to bt
satis.lied utith the rc.sul,!. u,e ltart:.fottnd a.fter N , sag
l1Q,
iteral.i ixts.
Ti-re mctlrod is clesignecl to exploit the irurction r.airres
rvirich are calculated clrrring bisection l-retht.rcl, arrcl tir
gairr ef[cier<])r tllrollgh usirrg t ]ris inft-rlruatiol. lt rrses tire
c'ornrnon sense obserl'ation t.lrat i{'/f.r1y) }ras arr irlrsolrrtt,
r.ahrc rnrich less than
.f
(r,r), then tht tcrot of
.f
(.r) u'hic,tr
lies in the trapping intenal
[.r,n,.r1l
will
]rrrrbablv
lit.
tnttclt closct'to J'g llt;rtr lo.r'1.
Tliis w-eightecl clroicc is ac'irievecl lrr. the calcrrlation ,ri'
t,lxr vahre rr" on [.he srraight ]irrr: r'lrorrl lxrllv(,c,u I lrt'1>uint
(:rs,/(r:11)) an<1 t,ht'
1;oiut
(.r'1 ..1'lt'-t'11. itt the
iroint
at
u'hicl-r tl-ris chord rneerts thc ..r-axis.
Example 3.4 tlse the hfeth.od o.f Fa/sc'. Position. to nyt-
pro:timatc. lhe rools ctf lhc.follouti,nq
{uttrt.ions
ott tltt qittrt
in,te.rral.:
(a)
f
(1:) -.-
.r'3 * 2.r2 + lt).r 20
i1,
2l
This line intersects wilh rhe:'-a,ris at ihe point (r=, 0)
lvhere
-. r/-,
,f(ro) Ibt),-
-
\ /, -
lt J\.rr)
'"(.r
rr) ("1.7)
.r11
-
Jl1
(3 s)
If stopping condition 1 is satisfied, tircn the root is gircrr
apprrtxitttittelv by t.he roc'rr
\!.-r
with :lbsolpl(r errol' itt,
rrrost *$.
Ilower,-er. if the stopping conclilion 2 is satisfiecl, the al:so-
hlte error bouncl +l+ urav rveil lre [arge,, er,'en t}utug]'r
ro,
.f
(.rt
))
12
(h.)
f
(.t:)
-
e'r * co.:-(.r:)
-,l.rr [0,
1]
(c)
.f l.r) -
.r'r .srn(.r') 2
[I,21
Solution
The Tabies below give tjre re-sriit: Courpare thc nrun-
her of iterat.ious lvitlr therse obtained ii'orn t.he Bisection
\{ethocl
Tnble 3
'l'lrt,'
I\'Tethod of Fal-qe Position for
.f
(r) :
13 +2r2 + 1 0.r
-
20
:
i)
near the root ;r" ol
/(.r)
0, lvhich r,t i11 be the case iu all
in-qtanccs whttc./"(:r'")
/
0. then irll successive values uf
rr2 r,i11 lie on the same side tif tht, root .r'". As a resrilt. u'e
will not get a scqlrcnce of trappirrg inten als of zrrlritralilr.
snaI1r,iclth. ilather, the tra.pping iurervals rvhich shrinI<
iu size vert slorvl\..
'fhc
<'ouseclrcnrt is that ra'r, caunot
glltlrilntc,e n stlall errol
i:r
-i[
for the t'ttttrputecl ror,rt.
An impror.ernent over Regula Falsi rnr..thod is obtainccl
l.rt, rcplacitrg t lrer sercani bv straighl, lincs ol cvt'rt-strrailer'
slopc. rurtil .r'2 fa11s to tlrc o{.lrersirkr of the zcrcl ol/i.r:).
Fig. 6. Effer{ of Cotrcavitl- otr the nxrthc,rl ol Fnist- Position
lirr insttnrce in lable (5). wlrile. [lie r,'alue of .rs is
(1.]ritin-
.,o1]1r 1spl'ced lry r.alrrcs clost'r to thc root .r-, tlrt'r,alue
of r,1 does not change. (This hzrs o<'crirret'i berar.i-se tht,
graph o{'.f(,r') is ('()1}(r.l\.e rrp, s('e Eigrrrc
{6)).
Suppose that tire riglrt enrlpoint. .r'1 ol tire trapping iu-
l.erval has ll()t
('hilllg('d
iu tlie prt'r'edirrg tlvo i{er:rtiorrs.
I'tx.u, rathrrr l,harr t'al<rulat(' .r'2 ili t.he usr-i:rl rlanll(rr. lv'
trso replace
11.r1)
r'ith 17l2J'(r1), in ttxr r:ourprrtaliol trl
12. fhc cft'ect, of rhis is to ma,ke t.he riext valrrt'ui.r:::
lier tt the right t>f t,he ror.rt .r--. If this worl<s. u'e
1;rr.rt'et'cl
u'itir frrrthr:r' rrrrrnorlifieci regtla
l'u.l,si
sttlrs. If it thil-s ftt
produce a \.alue of 12 lv'hich rcpiact's :r'1
r
tr\re repeat thc
process again, bv lrerlr.ing
-f
(,.r).
Example 3.5 Soh:e 2.r'ir
--
2.5.r' lt 0
.for
the roci irt
the interrol
11,2i
b11 LlttdiJied Re1tru,la Fo.l,si rnt llt,tl.
t'l .l'r t :r't :T:2 ,) /(,
L
:
;]
I
it
6
1.000000
1.;10,1:147
L.:1579 r2
r.36ii978
1.36852I
L.llri8766
2.000000
2.000000
2.000000
2.00000n
2.000000
2.000000
1.304i]48
1.357912
r.366978
i .368501
1.36rt766
1.367995
- L.ll347ii8
-0.2291:16
-0.0118592
-0.006,182
-0.001088
-0.000r 82
i. iJ6799ir 2.000000 1.:tri8Sr)7 -0.0000i11
Table I
'Ilx'N,lethori
of FaLqe Positiorr tirr.f (r :
c"
-.1-r:c,s(r
-+.I : 1.,
.)
.1
i')
6
T
I
9
LO
0
0
U
t)
0
t)
i)
0
0
0
t)
u.69;2EU r
0.69 18782
0.69r 8782
0.tig18782
0.tig18782
lrrble 5
12
:1.:1.1 The tl,Iodi{ied False Position. fufethod
The nrethocl of lhlse posibion lras one clrawback. If the
graph of
/(.r)
is conca\,?, either upwarcl or dorn'nw-arci,
/
(r:)
0.7295500
0.6952801
0.692 r.737
0.rig19038
0.69 i 8S04
0.tigr 8784
0.09i 8782
0.69 1 B78?
0.6!) 18782
0.69 18782
0.rig L87ri2
-0.985786e1
-0.89758r+2
-0.78i)33r--3
-0.675'58e-{
-0.5848r-5
-0.ii05r:-6
-0.4irr,-I
-0.3t-S
0.0
0.u
-0. ie-8
he Nlethod ofFalse Position for r\:r'-st'n :t,
l1 iI:0
-J"
1. r2
.f
(*r)
1
)
3
1
.ir
r.000000000
1.628022506
r.7 i 7979708
1.727.1r02117
r..728360363
2.00000000t)
2.000000000
2.000000000
2.0000000t)0
2.000000000
628022506
7r 7979708
7274102:37
72.9360363
7284ir569 i
1
I
I
1
1
-0.i147!l0ti00
-0.03773.10r)
-0.00381 500
-0,00038290
-0.0000:184i
13
Solution
No*'../(l)
/(2) -
i33 < 0. Set:r,1
-
1, ;rr1
-
2 and
{blklwirrg t,hc abovc algcirit.hrl. Rersults are pror.idt'cl irr
t lur tal;le l:elriw:
Table
(i
\{odifierci Re la Falsi Itlel,hoti
2.0000000
2.0000000
1.7010032
1.70 t00:32
1.7010032
1 . tt6025 16
1.4782609
1.70r 0032
1.6544259
1.tt;r00386
1.66025 i6
1.6adlt00rJ
-2.2;148976
0.s908977
-0.u793241
-0.0t)22700
0.00212117
0.()000002
I:.:nrtr ttt t.he n-tlL it,eratirsrt
It ciur be,sirriwu that this modificd luethod has t.hc prop
e.r't\r that the error in tlie solution, at t.}rc n-tir itr:rntion
is a1:proxirnatelv given bv
ld.,.l
=
C'1d".-,1"n'
lbr some constant C.
Exercise 3.3 Solue t.he
foLloutin.g
equat,ion,s by the False
Po.sittort met.hod:
(a)
f(.t) -
r'3
-
r'2
-
r-- i
__
0
(bi
f
(t)
-
x' - 6'ars(7:)
,,-
0
/r:)
f
(r)
-
r'- c-r
-
0
(d)
.f
(.r)
-.r3
| 2.r2 + io.r
-
20
-
0
(,'i
/(-r') -
.p2 sin(:r;) 2 -,, i)
ff) ft*)
-
3:r* sfn(r)
-
e'
-
0.
:1.
4
jVr"trrlon's
rn eth otl ( a. k. a. l{ eut,on.-R aphson meth od.)
\ervton's method, (1ike the methocl ol false po-silior"r)
is irlso basecl on linear approximation of the function;
holver.er it dcles so using a tangent line to approxirnate
lh<'cLincr. Nervt.on's rnet.irod thcre{tirc', ilssurnes that 1.h<,
liurc't ion is diflcreut.ial:1e.
I-rom an init.ial point r0, a tarlgent iine is clravu'n at the
poiut ("r,i1,
/(r'o))
ou the grnptr of
/(:r).
A nerv approxi-
nratiol is folurci at r1. the point olintersection of the tau-
gcut with the.r:-axis. Ttre process is repcatr:d b1, <1.r,*tr,*
a uelv t,anllerrt iine at tLre poirrl. (:r1
,./(r1))
orr t,htr
liraplr
of
/(r:).
The point of irltersection (r,2,0) of this tangent
line wirh rhe .r-aris gives the next approxilnation. See
Fig=ure (7) bclorv.
Fig. 7. Ceonretric interpretation of the Nervton nretlrorl
Starting fi'om an initiai estirnaie r0, $,e obtain 1hc erlrra-
l,iorr crf the t.:rngeut 1in<'to lhc t'ulve
Lf Ir)
ai th(,
point (rs,J(ro)) is
.27 - /(.r'e)
--
(.r .7,0)./'(.ln).
This tangcnt linc rneets tirt l-axis at thc
1;oint
(.r'1 .0),
rrhere
0
"f(r'o)
(r, ,'o)l''(..,r)
Solr.ing for:r:1 gives
.r1 .r'o
4I4 I'()o) /
t).
.i' t 't'o l
which is an inrpror,-ed estinra.te ol alre root. thau .r1.
Similarjl'. the equation o[ the tairgerri t.o t]re crrrve
l/
.f(r:)
at tire
1)oint
(.r:1 ,
J'(.r1))
is
u-fb't)
-
(-r .r'r)"f'("r'r).
It intersects the r-axis the
(r:,0),
where
x2 r't
#+ J''i1\ /
t)
1'l.rt)
a better estimate than r1.
r0,,r(r0))
r:2,,/(r2))
l:1,.F(r1))
14
Tliis process is tireu repeatecl, to obtain succes-qil-e iter- where
{,
lies betw'een r', aurl rr-. Since or is the rr-rut.
ates :r3, .r4, . . . (3.10) ber:omes
Tire n * 1-th iterate for Newton's methocl is giveu bv
.r,,
r r
:::
..,!
#*
J'' 11',,) /
o (3 9)
rr
-
0, 1,2.
.-'
.
The seqricnce
i:r, )
con\arges, pror.ided the initial point
"ro
is not too far fron the, root.
f'al.>le 7
0 - /(,r) - ./(,r,)+J'(.r,,)(o
..,,)+ j/"({,,)1,,, r',,)?.
(3. t 1)
Divicling equation (:1.1 1) by
f'
(r'
")
ancl rt arrirnging gives
l'(
r
"1
, , , [" {,,) .. r.
ffi
t
(" rn)
fiotjt"
.r,,)) t;i.12)
ll-sing the fact that
.r,rr
1 -
.xrr
#*
(J.13)
Nervl on's I\.'It .r't' + 2"' thod lix
.f
(r') : e*' * 22" * 10:r
t1 .1',,.
.f
(e,"
)
0
1
2
rl
4
r.000000t1i)0
r.41 176.1706
1.369:i36,17 L
i.it68808 r89
1.i168808108
-700000000i)
0.917565{142
0.11i48119
0.000001704
i1.907985F-1,1
Example 3.6
Table B
Neu.ton's Nft.'th thod for
.l(r)
-
r- riir(r) 2
t? ll]rr
.f
(r,,
)
U
I
2
3
+
1.00000t)000
2.26 t542710
1.8071J34.,122
r.71108724('0
1.728468707
- I .84r 47098i:
?.34:t804730
0.291302658
0.00870432 1
0.00000861i0
Example 3.7
:).4. 1 Cctntte.rrJene:e o.f Nc,.tLtt.on's futethod
Assr-rme that the Ne'n'ton iterate r, converges t.o t]-re root
a. u.'ith
/'(r") 10,
nnd define tire error n, afler i.he
ll-th i1.r'rat.ion lrr"-
SUic \
rr
-:I71-1-1
- +;J:+(a
.r',)r. (3.14)
-,-
J.l
\'t-n.i
-"- {n i I
(tt
That is,
.["{t,,) ? ..,-\
rn
I I
n77l; ',,-
' l't']'r
j
lakirrg absohite valuo of Lroth sirles gives
l'" t rl
lJ'"((")l l
21Y;ffi ',,-'
(:,'l(i)
Eqrratiou (3.15) can he expressecl a,s
1r,,1 1l
(
.4fr?, (;1.1I)
we obt,a.iu
rvhere
:11 - s*pi
l#91 r3.1s)
Tner, crpa,o,.*
f f,i*,;1,,
:.,,r* the Tavtor Theo-
t"
::';
'
i /1'l
'
(
renr gi'es
lrrovicled .f'(r,) /
0, Vr- e -I. rvhere r is the inten'a1
[a
r, a t r] for soure ,' >
l(,'t -
r,o)l .
/(o)
'.
/(.,,)
+
.f'(., )(.,
,; +
|1"
((n
)(^ -
,,
)2,
fflil'ilf;',! *i"ft:ttl:Xi:*::ff ?,:,::.:':flil
(3.10) that Newton's nrethocl is quadratically convcrgcrrt.
15
(i)
Fbr instance, i|,11
-
1 ancl tl're error at the n-th iteration
t",,, is given fi1'e,
-
10-1. flre.n tire crrrir al. the next
ilerat.itrrt {"n.1-1
,.-
10
2,
arrrl en12
-,
10
4.
r,'r12
,.-
i0
8,
:nrcl so orr.
,f'(r,) /
0; Vr' -I.
rvhrrre J is the intenal
[o
r', rr- l- r] for srxnc' r >
l(n
ro)lt
.f"(.r')
is firritt' . V"r' c ./:
.r'rt is srifficrientlv close 1,cl tire rciot o.
Exercise 3.4 Solot t.he
Jolloaiug
equntiort.s bu ?,{euton's
m,eth od:
(a)
f
(.r')
.,..
't-:1
.1:?
-
1' I
...
(b)
JQ),,..7--
6'r2.s(.r:) -',0
{r) f(.*)
-r--e-'a-0
1,1) .f lt') -
r3 | 2r2 + 10n
-
20
-
0
(1.)
.f
(t:)
-
f szil(;r,) 2 -. 0
(f )
.f
(r) 3.r t srrz(r')
-
c'' 0.
Exercise 3.5 Appl11 Nc:tlt,ott's rn.et,hod on. the erlu,rttion
.r,?
1t
,..,
0 t,o d,erirc the
fol,l
outin g o,lytrofithm,
for
corn4tu.ti,ng
l.hc squore ntot o.f a pos'itiue: nuntber'p:
Fig. 8.
(leornetric
int,r,rpret.ation o[ the Stt'trrt nrr,tlr<,r]
Frorn Figurc (8), \1,1, can determine an expre-ssion for l'2,
hv using similar triar.rgles as foilows:
(r,,, .r:r)
(3.1e)
"f(rr,) "f(.,,,)
Solving Eqiiation (3.19) flor':ro girts
irn
rr
).f
(rr)
i3.'ro )
J'2
-
J'1
./(,.0) .f [.r'r )
Jb ensrlre tha,t ea,ch nervly calcrilatcd ;r-3 is actiially r'k;ser
to thc root, $,e rnust choose with .rl r:krser to thc loot
than;r:s. This can be done bv iesting thc r.zrlur:s cif
l./(.r11)l
anci
l/(,r:1) | ,
anci sv,'aPping if
.f
(.r,6) is sma1lcr. The poinrs
J'I attcl .I:t. ol'rl:it arttl:.t:1, al'e thetl rt-laltcltxl il.s:iii1 a1ild.?'1
respectiv'elv, anrl the. iteratiou
1l'oce<lurc
repeatr:ri rrnril
con!-ergence occrrrs.
To fincl a root ol
"f
(r,)
-
0. giveu tu'o st.arting poinls, .r'11
and :rrr that :rre ckrse to the root:
(a) If
l.f(rs)l
<
l./(r,)l
sl&'ap J0 ancl 11
Repeat
(b)
Set r., :l.r
r.i,, J r)/rr.r)
; r,lJ-lfGIT
(c) set .rs 11
(d) Set .r'r
-
rt2
Until
l/(rr)l
< r; r.r'here r is the tolerance l,nluer.
'fhe
stca.rrl me'tliorl rlzrl: llg tlrought of ns
(a) a "Neu'ton's Xllethorl, wilhorrt a iorrnula lbr
l''(.r)".
In fact, lvhen rne replace
./l(l)
ir Ner'vton's lorrurila
(2)
(3)
:r1 .r?
Jr
-Jt
J \J li
,n
Fr 1(r',,
1
a;
LTn
(.ise
the alqoritltm, to esti.rncte ,/73, orrrrrot.e to it deci,rnal
placcs. Start
from.ro -
8.0.
J.5 Th.e Secont m,ethorl
A secant is a straight line passing thror.rgh two points
on a griqrh.
'fhe
sq:ant nrethotl asslrmes t,Irat, the I:uu<'
tiorr
/(r,i
is linear in t,ht'rreighborhood of the ro{)l r.
\\,'e theu ciroose two points rs Rncl r:1 close to the root.
Ilrr irrst,irnt:, iI
/(r'")
is smuLl, t.hen rn'e expect .rd [o be
<rlose to the root of
./(r) -
0.
With ro and r'1 cirosen, we obtain the next approxirna-
tion 12, a.s the point of intersection ol the secant, li,ne
tlirough (.i:g,./(r:s)) and (.r'1,./(r',)) with the.rr-zrxis. [f
./
w're exrlr:th. lineerr, 1.hcn t.i-re straigirt linerworrid in-
rcrrsccr ti-re r-axis at fie
-
r. Since
/(r:)
is l1ot linear $,e
should not expeci this; rz will however, be c/rrse to r'.
See Figr.rre (8) belorv.
16
r.ilh its finile-clifferent approximation
.ft(.r)
=
"f
(rr)
/(*o)
.f]
-J:0
rve obtain the formuia for the secart rnethorl.
(b) a "re4ala.faLsi, withor,rt a trapping intenal". Iloth
rnethocls rrse the ,same fornnrla for calcr-rlating:r2.
Example 3.8 Taltle (9) belou
for
shouts t,ha i:t.erat.iotls
frtr
soltin.q
/(r)
-., .r2
-
sr.2(.r')
'2
-. 0, usin.g th.t: sa:ant
tn,elhorl.
Table 9
Exercise 3.6 Softre the
follouing
eqrtation.s ltu the secant
tn c.llt od.:
(a)
f
(..:r)
-
13 12 x 1
(b.i
f
(r) --
.i' - cos(ll)
,,,-
0
(c)
.l'tr) - t: r'-r'
-,,- ()
ld) .{(r) 'r3
i 2;r? + 10"r:
-
20
-
0
(e)
.[(.r)-i
sin(.n) 2-0
(f)
f{r,)
3.r+-.rin(.r)
-
e"'
-
0
:1.6 fh.c, Fi:t:*L-7xti,nt met.h,od
Definition 3.2 A poittt p is called a fixed-point o.f a
funclion
q
i.f
1t
,- gllt).
Example 3.9 'fhe pctint, r
-
0 is a
fired
point, o.f tlte
frrttr
litxtg(.r') - .r(l .r) .
Exanrple 3.1O The point r
-
i rs n
Ji:t:ed-poin,t
o.f
tt(r') -
;r cos({:r:).
Con,qicler rlre ta.sli of
-solving
a non-linear equatiolr
.f(")
-
o (3.21)
Thc fixtd-point mt'thod con-qists of re-arranging the
Eqrration (3.21) into an equiva,ient expressiol <.rf tire
frl'Ir
:r
-
g(r).
t:1.22)
A soh.rtion to th<, equation
/(.r:) -
0 then corresponcls to
ir vahrt .r' rn'hicli solr,ts Eqrration (3.22).
Then, the iteratiou
r,1-1
-
-r7(r:2)
n
'-
0, 1,2,... ,
u'i1l conr,'<,rge. lo ir r'oot ol
f
(.r,)
0.
Example 3.L1
(ion,sid,er
fi,n,tl.i,n,g
a root. of
f {:t',
-'-
,''' --
21 3-0.
(a) One re-arrallgrrlneut of
/[.r)
for a fixec,1-pr.rint itera-
[ioirs is
r
-
q1i.i])
,trr. +.:rr
choose r'1
-
r{,
1l,nt ,
:rr2-rJl(.r1
)
-,
"r'3 -
q1(r'2)
-
ra
.g1(r:3)
:t:s.- gl (r'+)
-
16;
-
g1(:r5)
.,fI;;ll-
'tr.;t\6
- l].10,l
/ETT-/{i.z(x-.1.{)i.l
/.z"ru tT /eJX,B B.{)Ll
(b)
clearly, r,
-)
3, rvhicir is a zero ol the hrrctiol
f
(.:r)
-
,,2 2t ;3'
Another re-arrAngcrneut for a fixec1-point iterration
is gircn bv
r
s'Z(.r)
-f'
)'
')
ch0ostr :rr
-
4, th('11.
.) .)
-r) IPQ';)
''
.'.
- --'- 1.;,
"
)'r-'2
.l
'l
.t -,
.?', I I.i ?
.r'r u2(.t'r\
;i
-
;l
o.;i;;
.t':.i 2
(i
')
;l :l
;.5- g12(t
r) -
--
-
- ---:-::==---=
-
1.263
''
,,'r I t).1i7.-r
'2
.) .)
,) .'
.r'0 g'2(rt,)
---:-_-----
(l,9lf)
'
.t'i, 2 1.2(i;i 2
.r'7-g2(.r'1;)
-
-+
- ,
1.t)2ir
'
.r'{, 2 0.91()
')
rR o2(*\
--1- - ---1-
0.f.,9I7.1
.ri 2 1.0'J;
')
r,i a2(.r.)
3 :l
-l.O{)lx
.?'r I t).{}917.1 l
In tiris ca-se, the iteratiorrs are conr..erging to 1.
another zero of the fiinctior .r'2 2s- 3.
A t-liird re-anarrgtruc'nt is (")
ie Secant l\'It.thod for f{:r)
:
a' srln(ir) 2"
t1 :IO :rl I2
.1iz:)
I
.)
3
I
5
1.000000000
,.0u0000000
1.628U2250t
1.4ir;179840.1
L.742016065
2.000000000
1.628t)22506
1.zliril798404
1.74201606ir
1.724'7368.18
1.62802250ri
1.,15379rq404
L.7420i60frlr
1.726736848
1.728456682
-U.3479t1i.,7ir
-0.S796337;'r
0.04924229
-0.0062457i.r
-0.0000:1483
l7
'fh<:
iierates are clearh- cliverging. The fojlor,r'ing theorem
gives the conditirxrs unclt'r'rvhich the [ixecl-1roiut iteratt:rs
('()llverLes.
Tlreorem 3.3 Denote hu Cla, b) the space o.f all con.t,i,n-
LLorrc
J'u.n,cti,ctns
on the in.terwtl
{a,
bl.
11) If g c Cfn. bl, an,rl g(r) e
fa,
b)
for
all r e
[a,
b],
then yt iro,r a fi.xed point in
[a,
6].
(2)
firrther. if g'(..t) e:tists i.rr
{a.
b') and l,hat a positirre
constant k. et:i,sl,s such that
ls'(,.)l SA<
1,
forol,lre [o,
b]
then this
fia:ed-poitt.t'is
u,n.iqtrc. an.d the iteration
r'r,
- .g(r', 1)
conuerges to it,
for
any startin,g poin,t rs1 e
[n,
6] .
Proof 3.3 (Existence)
#.q(a)
-
o, or
!t(b)
-
b. then
llre ri,strll is triLtiallll tr"ue.
Suppose i nst.ead. I.hat
(r)
.q(o)
) o, and
s{lr)
< b
and. de.fine
ft(r) g(r)
-"n
then h.
'is
continuou.s an,
la,
bl. T'hen, since h,{a) > 0,
and h{b) < 0. there eri,sts a poittt p in
la,b]
su,ch t,hat
h(p)
-
0.. That is.
s{P)- P-
0, that is.sfu,)
-p.
(Uniqueness)
Suppose t.haf p and q are botlt
Ji:terl-point.s
o.f o(r). That
ls,
.q(7r)
-
1t.
at'td
tJlq) -
q, u:tth p
/
q. Thert. h11 the
il'l can.- l-alu e '1"'h eorunn,.
h -
ql
- l.q(/,) .s(q)l
-
st'{3lp
-
ql
< alp ql
<lp-ql
uthich is a cotttrrtdir:t'ion.. Tlterc.frtrc,
[ -
q.
lN'e, now show t,ltri tue cen ohtain. t,he
Ji:r,ed-point
u,s'inq
t,he it.erat,iott r,,
-
g(.t:,
1).
5'11.,:c
ll
:
{o,6]
>
[a,
1r],
thc scrlur:rtce.r,, e
[ri.
{t]
fit'all n }
0.
(ihoose
otty poirr!
,r0 e
[rr,
b]. thett, rLsinq lhe
far.t
t.ho,t -r:,
'-
4(r:,- 1').
o.tt,d,
S(n-) -
r", u;e glet
lr,,
-.i'=l - l7Q" r) - .q(r")l
- 9'({r)1r,,, r - .t'*1,
{fuIean-Iit.ItLt-'
T'ltcoratn)
< Alr,
r -
;r"l (l.q'k)l < k,
.fctr
oll:r'e
[n,
0l)
-
klsb"-)
-
.q(..-)1,
u*t1?
-
A,-q'({.:)
lr',, :
r'1. uh u I
1k)]r,,-z .r-1. ufiy?
(
A'"lr:11
-
.i:"1
A'our, A < 1, > /i" + 0, o,s /? > rc
I{en ce,
,,lir1
lr'"
:r'"1-
,jjr,]l,i,"l:'s
-
r"l o.
Thrtt is, l.he sequence
{rr,}
rttnt,err1es lr;
"r:*.
Example 3.L2 The eqttat'ittrr
f
(.t')
-
,''' 2r' ir
-
0. t?r.2i1')
ha.s root,s 11 on,d, 12 hr the brte.r-aals
12,3l
and
[
:3. 2],
re.spct:tiuelu.
The iojlor.ing are tlvo re-arrangements ol (3.2.i) Ibr a
fixecl-point iteration ar<r
With a starting point 11
iterates
4. wc obtaiu tire lollon'ing
423
aa
-l-
('"' r'2
- s3(r1) -
.r:3
-
q3(:r2)
-
ra
- .r73(;r:3)
-
.r? 3
2
,ni-3
,2
-.j
r)
-
2
6.52 il
2
19.ri2t1?
-
19.62Ir
-o
i92.520312i,
r'-.q1(.r)
-
1n(2r'+ 5)
r,I ;
r g72(.r)
,
(;l.l.t)
(,,].25)
(a) \'erifv that the function.qr(i:) sati-sfv
(i)
91(r:)
(.
12.31
ti.rr all .r: {
[2.31.
(ii)
..i
1'(.r)
(
1 lor all .r e
[2,
3].
(iii) For in11: start,irlg proint :;,'p e
[2,
3], thc- sequenr.e
fntl
-
g1(:r*) convel'gos to a riuiqrir: {ixecl
poiut of
.r7l-
This fixr.d poirrt is ur root o{'./(.r')
0.
(b) \,erify that the filrction.q3(r) satisfv
[i) .q2(])
e
[
3. 2] ibr all r e
[
3,
-2],
(ii)
c2'(r:) < 1 {br all .r
.-
[
-3. 21.
(iii) With a starting point of .xr,r 2.j (,,r cven
wittr .r,o
--
2, n,irich is not irr the intcrrvirl
[-3, -2])
t.he seqnt,ncc cor]vergcs {,o :r fixecl-
point ol
s2A).
18
Remark 3.1 The conditi.on o.f Th,eorem,
(,).3) aresuffr-
cicnt conditions, not necessary conditions.
Example 3.13 Clon.sider the t.o,sk o.f soluing t,he.
{olbw-
ing eqttation rLsin,g
Jbed
point itero,tion,.
./(..) -
.t3+2r2 *10;r-20
-
o
\\.'e determitte uthi,c.h o.f the
.follctuting .functictrts
are su:it-
able.frtrfindinq aroatT, o.f
f
(.r)
-
0 ontheinterualll,2].
ro
-
2.it
.r"1
-
2.,158958
12
-
2.4it7238
.r3
-
2.457164
ru4
-
2.4it7161
,'5
-
2.4it7161
cottler7in.rt t.o r" 2.,157161 . Tlte point. ti is a
Jit:ed
ltoinl
o.f the.ftat-lio'n oQ'), ond so o sttlu,t'ion to
f
(r) 0.
Using rhe salne iieration formula ;r.s iu lixarnlrle (ii.l4),
with a riifferent, st.artirig point .r'11 2.5. gives the fti11ow-
irrg il,t:ral t,s:
To
-
2.5
.r,r Ii.519247
iir2
-
15.63q644
-
(':o
-
1o.r
-
2.r,2)t
20-2:::-;r:3
gi (.r)
g2(-,')
93(.r:)
(rr + 2:r, 1- 10)
Solution
It run lx: uerili,ed that on,lg1 g3(r) is srtitable
for
a
fi,red,-
poittt itt:ro,tiorl to cort.ut:rgt: to lh,e root o.f llte t:quo,tion.
/(.') -
0. t\hy'?
A
fit'ed.-pautt
itera.tton rLsut.g q:3(n') is of thc
fLtnn
.xn-1
1*g3(r")-
20
(.r,2*2.r,r*10)
Th t: To.bla bclo.ut qiues lhe soltLtTon o.f the equation
f
(r)
-
.r':i +, r'r-f l0.r 20 LLsinlt the fircrl-ltoint itey.alion schern,e,
,x
-
g3(:r:), with a starting poin,t rs
-
.
Table 10
Fixerl-Poirrt lUethocl for
/(r)
:
fl3 + 2r2 + 10r
-
20
nl :rl,
I .f("")
0 I i.00Llt)t100()0 I -1.r.r1t47098.1
1 I r.ti8:r666J33 I -0.15r938708
2 I r.7:10147304 I 0.006079216
:t I r.72tl:Jfrg562 I -0.000277:.|89
4 I 1.728469tt0r'i I 0.000012597
5 I i.728-16riL6r I -0.000000572
Example 3.14 C on,sider tlt e
follourin.g
re- arran
q etn.en,l
of Equa,t,ion (J.!3).
Jrn,Fl
-
g(r'r)
-
er.
-5
lVtt,h an. irtit,inl ralue o.f to
- -2.5,
u;e get, the.folloutin,g
scqu et7(-e of it e.rat es
Il is clear that iu this ca.se. the
dir.erging to infinitrr
Again. using the surne ireration
starting point .rs
-
2 gir.es
10
20
sequen(:e of itcrates is
forurirla (3.1,,1), n'itir a
rs
-
2.0
-ri
-
1.194528
r:2
().84!)000
,r3
-
2.286079
lvhi<'.h converges lo the ,sanrc solutiou -r'
-
2.457161 , as
in Exarnlrie (3.14).
l-he fixed poinl, iteration iinrct.ioir
g2(.t)
-
c'' il
rvhich we ustd in the alror,'e exampks, has deril'atir,r,
92'(.t:)
.,.
0.5c"'. flhe absohlre valuc of this <lerivat,ivc is
iess thau ore {rir all .r'
(
1og.. 2 I 0.ti!}l}.
\\te can see whv tlrt starting
l)()int
.?'0
-
2.ir ensrrred
con\,?rgence. Iil'en ',,t'ith rire starting point, .rs
.
2 (r.vlrich
i9
is rot iu the gi'u'en interval), the iterates co]rr?rges to the
solutiou.
Consicler the alternative fixed point iteratiol scheme
n hicir we earlier discrissecl for the same eqriatior-r.
.ql(.r) -1og.(2r*5).
r)
-2.is
Tiris iunctiou has derivative:
.q1'(.r)
2r*5 r12.it
For r )
-1.5.
the absohite r.ahre of this derirative is
Iess than one. I-Ien<:e, rvit,h ir srarting point ;rs
--.
2.5. tht:
iterirtes converges to a fixecl-point of
.g1(.r:).
ro
-
2'5
x'r
-
2.30258x
.r3 - 2.262302
.r':
-
2.253878
r:
r
-
2.252108
..rr-. 2.251735
ls
-
2.251657
.n;
-
2.251641
.tts
-
2.251637
ls
-
2.251ti36
"ho
-
2'2516i16
Exercise 3.7 Solue the
{ollouti:ng
equat,ions lry t,he Fit:tzd-
Puint me.thod:
(a)
f
(r')
-,
.r3
-
:r,2 r: 1
-
(h)
fb)-r
co.s(.r)-61
{t) f(:t:) -.it-c-,-0
(d)
.f {r) -
13 | 2.r'? + 10n:
-
20
-
0
(t:,i
,f {t:) -
72 sr,n(:;) 2 -. 0
U') l{t') -
lJ.rr }.szrr(r) c''
:
o.
,r.'i N eutt,on's nr,et.h od,
f
or s11st,em,s ct.f n.on,li,n,ear eqtr,at,ions
\\t, recnli that tlre Newton-Raph-son methocl for finding
a root of
/(r,)
-
0
.,t'as ba,sed ou the use ol the first-orcler
'far'1or
series to approximate the function
/(:r)
near the
root ai J:
-
o.
"f(r') =
/(")
+
"f'(")("
o) +...
A "tangent line approximation" of
/(.r)
rvas rrsecl to ap
proxirrrilte Lhe root a.t r:
...
n. \!'e use tlsinrilar approa,ch
for a f\nrcl ion ol two variables.
Let that f,"
-
or, g
-
lJ be:r root of the nonlinear s\istell
/(", s) -
o
s(r,
y) -- t)
That is,
/(n,
il)
-
0, g7(o,,i)
-
0. Siippost'thlt out
initial guess (,rn, gn) is x'irsonabll' clost to tlrt root
(a,
Ii), so that
.l-rro*A;ls, 3-Ao*Agn
Then
O
-
"fin.
,l)
- /irs
* A:'s,
Uo
* Aus)
0
- .9(n.
ri)
- .q(rp
* A;'s, yo * Alo)
(i1.26)
(;1.27)
The first-degree Taylor polynomial (a1so calleci the
tangent plane approximation), of the iiurctions
.f
arrcl r7 irr F)quat.iorrs (i3.20) anri (i3.27) r'espectivoly. a[-lou{.
the poirrt (r,s,
37e)
givr.s
0
-
"f
(..0 * Ar:e,
Us
* A376)
=
i)t i)f
,f(..n..,J0)
t
frt.ro..un)A.r',r
l
l;(.rr..vn)agn
(:.i.2\)
0
-
q(r,o
* Ar:6,
Uo
* A37s)
=,
Do i')u.
.q(.r,0.
go)
t
*-.(.r,'..(i,)A.r'n
I
|(
r,,..,Jn)A,un {:i.11))
\Yriting liqual,ions (:3.28) anrl (ll.Zg) iu nrar,rix tbr:l
gives,
trl [1i,..
,,,,i
,-
[/,
t.u. tn) .[,, t.,',,.
u,,)l
[1p,.[,rt
LOl I
l(..n. ln
] [],
(.rn.
!to) lru
(.,n.
ln)]
[-\1,']
Eqniva1ent1l,, (:1.30) bt conrt s.
An impror,-ed est,inrate lrrr tire root is
[.f,
(..u.
st) Ju(.,',,.
yn)l
[A.,',,.l [/'(r'n,
"r
f;,
);,,
ou|,'o'
l;: ;.ll
L";,;l L;l;
li,'l
"'''
\Ye cau ea-sily solve the syster-n in (3.31) fbr A.r'n iu.rcl
Ag51. ri-sing a r.ariety of methocis, including liti'r rsr
met.hod and the GotLssian elimino,tion, mcthod..
[;l]
-[:]
.[i;l
20
(3.:]'l)
Solution
\Vrite thc two eqriations
f Q.u)
r-(:r'+ 1) t 237 18
-
0
11(;r,y) -
(.r'- 1)? t (.y 6)2 25
-
o
Step 1: fteration No. 1
Tire ,Jacobitrn matrir lor tlre sr,stern is
[::.,' 1 2 I
,I(.r.u)
I I
[ ^].r'
2 2s l2l
(3.3rr)
With initiai guess
[rs, url'
-
[
1.15, 10.581r. the cor-
responcling Ja,colrian matrix is given bv
Generallr., for z
-
0, 1,... , we
-soh,-e
the s1'stem
[/,
{,',. !],) f,,(r,.u,tl
[4,,] lti,.u,l)
(;]
3r)
Lr,.(..,.
rt,) ltu
(.r,.1r,)l
lev,l lr,(,r,. u, )
\\''""t
lor Ar; ancl Ay1, ancl us<, i|, to obtain the next (ancl
hopelr rllv) r:stiurate
[.".'l i'''l
,
[o''l r:r:u)
Lrr,
rl
Ls,l LAy,,l
Examplc 3,15 {,se tlr""itte itero.tiotls of l{eutt,on's met.herl
to sol,t:t: thc:
follouti,nq
.s11stern. o.l' t:quo.ti,orts
r(:r * 1) * 237
-
18
,o .a-\
(r t)2 I
(Y - 6)2
-
25
('''()oJ
(:1.37)
(3.,18)
NOTE: The solrrtion is precisely, the points of in-
tersectiorr of the twn curves with the giverr eqlra-
tions. From the Figrlre belorn', we can choose as starting
points (i) ( 1.15. 10.118), ancl (ii) (2.38, 10.77).
Fig.9. A plot of the systtm in (3.35)
enrcl the rigirt-hand r.ector in Equation
(3.33), ( tith
,-0,)be'coures
I t.,t z
J,, .T(.r'p,
.6) |
L
l.;i 9. t(,
[rt,.
*l]
[:
rs;;l
I ti(-,'n.
uo
I L{)..1981U
Substitrrting (3.37) arrcl
tion (3.:33) givr:-s
I
rsz
I
|
-r.:l rr. ro
l
u'i( lr sohrliorr A.r'11
stiti-rting ilto Ilqua,tiorr
lion
.[',,1
*[^.,,l trr;l
rI
iz;;l*l
Lr,,l Ler,,
j
I
ro..rx
] [
n.tir; r;l;
]
I z.+zogs I
- | I
(3'3e)
L
e.er 563
l
(3.;i8) irrro llre svslcrrr in l'.qirir.
Sul>
sr-l1 t r-
i;ll
Step 2: Iteration No. 2
Substitriting;r1
-
2.42593,
Ir -
f1.9156i1, into (3.3ti)
gi.,,es tht' .lacobia,n matlix for tht sct:cutrl it.elatitxr us
.rr-.r(r'r,er)-
[
lsr'rr;z
I ir.ru,
I
.1.3519,-r
7.S;3127
|
[r,,,1 [:.sx;;l
Llr.l frt
;rsrr]
L27rr98. Asu
-
0.tiii.lli7.
(3.34) give,s the' irnproved
27
arcl the right-hancl vector in trqiration (:3.33)
z
-
1,
)
becomes
[./(,.,.u,)l I
r.nzsrrl
tttt
I
v(r'1
. ri,
] L
2.06950
l
Iiquation (3.33), now beconres
Exercise 3.8 So/r:e t,h.e
.folloainq
s11st,em. o.f nonli,near
eqttat'ion s, r r,sin,g N etut,ott's meth od,. Fir.sf , rtst-' t{ A P I' E's
implicitplot c.otlt?n0.nil to oltta.in a.n in.it.ial appro.r:irno-
tion
.for
tht: poin,t o,f inte rse.ctzon o.f t.he graplts o.f tltc. rliut'n
junct'ions.
{a)
( with
(3.41)
Substitrrting into Iiqnation (i}.34) gives an impror,-ed so-
lutirn
u'ilh scihrt,ioir Ari -,, 0.4320tj. Ali,
-
[;l]
.
[:;r]
3.Eil1)i,,
I [^r''l
4.Fit9ir T.8il27,l
LArr i
i.azsr r
I
2.0(i950l
0.01808.
[-z..rz;osl, [-o.czoa'l
I
r,.r,r;ur]
-
[
o.olsos]
(3.42)
2
l [a.rl [o
rsoai'l
7.7e51,
I L^r,l [ri.n+;;r]
0.00669, Ls,
-
0.10333.
Equation (3.34) gives the ntrxt im-
,-= +
!l'
,"'
.l
:!l
(b)
.r'f 1 r,r;li I
3r.:r
?J3
-
4
(")
:,tt2
-
g2
-
3.ry3- r':] t -
(d) The n,onlinear sglstern.
5r'' - !t'
s/
t).25(sin(.r) + cos(U))
(3.4(j)
(3. r7)
(:1. is)
has a sohLl.'i,ort. ilcar (0.2I;. 0.25). J,isr: A''r:rurlorr'.s
rncthod, t.o
fin,d,
a solutiort aer:u.rate to u:i.thin 10
r'
irl
tlte l*, n,orm.
Solue the sq.strnt in {:1.;lit) uti,lh st,arlirtlJ poiill.
(r'n..,/n) (2.3S. 10.77).
[.ise I,t.t;o ite.ration.s o.{ Nr:u:tort's nt.ethod. t.o .sLtlre t.lte
systen'r,of nonlhtrar cqttrt.titttts, ttith thc slnrl itttl pttirtl
(r'0,
t/o) -
(:1. ,t).:
fb,tt)-e'?*t'
2u 6-o
gtr.g)
-
*' 1
!t'
2ir
'
o
Tlre Newron-Rapirson methocl nray be generalizt''cl liir-
t,he.r to chal with rron-lirrear s)rst.elrs in threr:, fbr.rr, ol irn
arLritrarv nnmber ol'"'arizlbir..s. Cl1ear1r, tLre iur,'ersicxr ril
the ,Jacohian matrix .J rrrquires that t iro cictemini nt be
nonzero, ttet.I
I
0, r'hen evaluaterl at e\rerlr iter-ate r:9,
:r1, ... J'r. This is sirnilnr to t.he rtqrrirenrent
"f'(r'")
/
0
rvhen rising the Ntrrn,t,or-Rapirsorr a.lgorithru to solve the'
eqrta,titttt
/(r) =.
0 in n siugle
yari2l;le.
-9
(3..15)
.)
II
r.ee3e2
I
9.S9716.1
Step 3: Iteration No. 3
Using tire values of r2 ard
372
thc s1'stem (3..34) becomes
(")
(f)
2.98783
-5.98781]
rvitjr soir-rtion Ar2
Substituting into
lrroveci
solut.iorr
[;;] [;;]
.[i;,]
[ilt]::l
.It?]xxtl
I z.oooor I
_
l |
(3.43)
L
10.0008el
Sinilarly. iterarion number 4 yielcls
[;:]
I
z oooooI
I
ro.r,oooo
I
(;3.44)
22

Вам также может понравиться