Professional Documents
Culture Documents
MUSA Numerical Methods NOTES
MUSA Numerical Methods NOTES
A17KA0105
SKAW - BACHELOR IN CIVIL ENGINEERING
SCHOOL OF CIVIL ENGINEERING
SSCE2393
NUMERICAL METHODS
CHAPTER 1 - 7
***There might me some errors/miscalculation in this document. Kindly, contact me through any one of the medium below if you spot the
mistake(s). Thank you.
Follow my telegram channel to find out more about what stuffs I have
regarding civil course.
http://t.me/Musa_Civil_UTM
CgePHtCnu mgrHop e1
t Yxorc;se 1.1 (Pap, 3)
Locale, t[,e root o$ the {oUouriDg nonhns*r eqruahons bu using
g raph;col rnetl.,od
=
_a.\42
U=Sinz
f (tr")f Cnl = -o.414 e o
ience ,t g (!r, n) x
2 9in 7'tL : o =) Qbc) -- 2sin * - ?t
2 9fn T=?L
f(n)
J=]sinz Point of intersec,|ion is in
(-n,-i) ,o, (8, o)
(Ca1f(b) < o
tlence 4 e (-n ,-5 )
{,o X
\ e (Lr,n1
tbr)+Cb) L o
I Lo) = e-o-ZLo)
:I
f Cr; = {'-7L,1
= -2.602
{Co)46t). -2-6?z Lo
Aen6o t* e (o, r; x
bt = 1-zrt
{Cz") Polnt of inte.sq,ttoo is in
!,3* (- lro)
{(a)+tb) (o
{C-,) = )Gt) +3e-r - r
= -1.94e
f (o) = 2-Lo)+?e" -l
--.1 ,l-
xl =x+\ ) $Czc1=v-3-r-l
Po'nt ol inte.rsecton fs in
fc,.;
Lt,z7
l=x+1
fCa) f[b) < o
{Cr)= ts-l-l
:-l
7L f1z) = z3-z-l a;+b6
-) 2
fcl:96'r=-[ L
,l
Vlunre x* € (\,2)
!:zL!
.!,
o Venca tha root t: = O'r-" l-S2q- X
c) ?:-?C +i* -2 =O i oLt<-Ll ) L=o'oos
{C*) = ea - )L2 +?zc-2
F=S . X'+bX-T
x
fc.1 Poir,t o( intensection is rn
Lo, t]
f(al +(b) < o
{Co) =-l
7L f(r) --?lo,
fco)f(D =-?.\bs <o
; ?L* e (o,t)
,...-ry _ x3-x- I
X=X
JX1
q t(-;
O l. c;ooo Lxl
I l' 5oo o Lxl
3 t$Lgl lxl ?,
t4 \,7247 I t
tlzt -nnl ;' Q -oao6 ( o'oo oE
5 I.3r4 ? l
fCzc)
i >L;
=L- o.B -o.z Siq ,"
('cr1= l-o-z cos>L
o o_oooo Lxl
ffi
I t -oooo [x]
*
2 o,eG45 I
v_ rz_ x-o.g_ogsinX
,\
l-o.z cosx
," x! o (orl)
fr
\-- smatlest Posi+iv@ valv,o
,', %* e (Vz)
X=X -
SinX -2*. +? z [-Q6zz r t
CoS X -2 l r- -r. I = o oooo(o-ooo5
I _46zzj
{ Cr) = -e -3e?q
{b)f(t)=-o.3G?Q <o
.'. ?c* e (o r)
Sg+ Lo=o-oooo
I g=o;ooo5
{CA't-?x+a-€* i, x-,
{,CD =tt-?+e-d. o -oooo
o Lxl
o-5ooo Ix]
Vv:
I
o.6030 t,xl
e
y'-3x*2-e-' o-bgo t
X=X- 3
zx -7+{x -zst = O-Ooo0 < o.Ooo5
4 o-6040 1'*,
gince Io-eolo-o-6oqo
I = o.ooo0 <O.OaoF
Hance the "eo| z<! =
Lq = o-boqo x
d) x' r tO cos >r = O => €b) =t3+lo bs L
\O cos ?c = -7L2
fc*)
Poinl of iqfur\etl'bn iE lr)
to U =l0coSzc \,T,,J
/) Srnat[ss{ +vo
vatuo
{Ca>fCb) c o
* {ct; = 6.11$?o
+O) '-o.t6r5
f(r)fCz>=-t. o??q Lo
,'. T* e (JrZ)
9= -z]
ge.+ To= l-oooo ; e=o.Ooos
L
flxED POINT METH.D
* Exerciee L.G (?age 25-26)
C\he qr^ation zLA nzr*-xL-l=o has a root in Lt ,2)- Show that the
given e4,$alion cc^n be writt@n in eev\ra\ #orm of (ixed ?otnl
\tero|;sa eXuatron ?L,g(71) css tollow z
\ila +\*2
-rt = g*q +7t + 3
tt( A*+42-t) = Zxq +Z*" tZ
e=o,oo05 *
ZL = 3zo4 2X2 +3
= lcn)
U= 3x4 +t*+Z tt' =+ lTv\ 4zt423+4rc - I
I r.r54? L*]
2 l-l{e4 Lxl
3 t.\LG4 t*l
4 t.\23G L xl
6 I't24'.|r,'e-Lsl<e,
6 l.tzA I J
Lo--lr gr(t)=-0.4460
0= o -ooo 5
l9'crl l = o'44 60 Ll
L [*r = (j rili -zztf )'/+ :. gLr) salisf res conver gencg,
condilion
x -'(?+X-zx')"0
i v-;
o t.oooo
I l.l84e
2 l.0gol
4 0l?
3 \.1 4
4 i. rolg
5 I .133q binc?- | t. tZr+o -l.tZa3\ = O.0oo ? <o.ooo5
I l. tz tg
q 1.t255
lo 1.1232
\l [.1247
.\2 1. l23B
r3 \- 12la3 I
I \r,,+ -tLyl < e
r4 \. tzAo l
A) Z:tt = b+L-Lt I
3 C^)
JT
Arx-r+yv.
?La -- 3+*-t4
T -F (;) (z+tc-rt+il' (
g'c,-) -\
r - 4zs)
- r L+r-t[\Vz
"=t " J =9L*) To=1 , g'(l)= -O.arz4
lg'C}l= o-G124 < |
cl) a
')L)-)t--l=o t ?L=
L+l
1L
, Lt,N t xo= 1.5
.1,
7'n
= -
,(zt+r)tzz
(rt )- r i* '^ (x*t1-tr.
Lo=1.5 i gt(r.F) = -o.l72l
{=o.ooOg
I9'(r.5)l o'l?71= 1l '
.'| gLL) salisfias
convergencp cond*r oo
Li+t =
I
.,
bg .rsing 1.,30 properhes : sin(A-0) = sinA cnsg- sing coSA
gin (fl1_2rr)= sinII?L cos2rr _ sin2Tr cos ITz
= sin Tz
2 sin(nz -zn) + x =o
sin(tI?r-21I) = -*
2
t\x-2rr -- sin-r
Ct)
x-> =|stn-'G)
* = f stn-' (t)r, = 9u)
s@=I si6-r(-t).,
g'czt)= I f t\
r JF,)T(-Z)
-t
=_\'/ t \
zr[@/ Sincg[ t.af tl -l.6g ztl=s.s.o3<ct-ooo,
.'. the root r* =L6= l-68 Lq X
Lo=l i g '[ r) = -O_ \g 39
lg,cr)l = o.ttjg 1l
,
lr l1r) satr sfres conygrg?nca
condilion
L 7i
o l-o@o
0=O.ooo$ I r.$3?3
Lir,= 2 1_6to4
ds,n-'(*)* ? \-6q65
4 t-6?+?
5 \.6$32
c l_69t6
7 t-6$2..1 ,
=-h(t+zlc) *ex+2
(?z'tt1t" Ax+D
f,,: O-ooo5
t, 7L,i
o O-oooo
I o. 50 oo
z o-?568
3 o.BE36
4 o.ggq I
5 o -10 23
G o.{ o+ I
? o -q,o$q
8
-rst <z
q Z';:;:o]
'".
9inc4 [o9o qq -o.qoq 6l = o.ooo3 10 -ooo5
.'. tL'a .oot ztt= Tq=o-eOel
*
e)x-@szt=O ) 2L- coSL+itL , lO,t1 t Lo=o
J
7-z C.OS * 9(z'; =
\ Lr,oSz+z)
+?Li azc= **
*rl** g,(*) -- C-sn rr + r)
jr= f
#=gi^) ' Xo=c) : 9'@) = o.5 1\
.'. $Czc) SahSf;gS conv%rgr2kcg corrdil,.on
0= o-0005
tlr--
@s Li' +Lc
'-L+l'-
\, - cogX +f,
7
i ti
O o.Oooo
I o.5ooo
2 0.6899
3 o-?3o4
4 0.7?77
5 o.?3sq t,
6 l\?q-7'5\ e
<
ct'?310
J t*zc
, Lo, t7 t {o=O'
I
v
kb+ztL -- \ gCA= I t*,.f
1L2 (z+t) = 1 g,cn)=
"
-*(r+*i?r"
I
t- -
^tL
L+l Lo=Q: |'CO;= -O.5
z --ffi I
= gc^) \g'co)l = o.5 < I
;, gL^-) safisf,zs converyence co ndi*ion
Z=o.ooog
?Li+r =
f,= I
Jr+x
i' xt
o o-oooo
I l.Oooo
2 o.?0?l
3 0.?654
q o.a6l6
5 o_?E E4
6 o.?E 4g l
lx+-z-el < e
7 o.?EAq J
L x_;
O t-ogoo
l o-?50 0
2 0.7165
g o-71t6
L ,lL;
o \.og oo
I t.??o z sr nco \ t. sza5- $z lg,l = o.0oo3 I O.0Aci6
L 1.4C)1 o .',fl'rg rool 2(! =xrz= 1.52?5
T t.5945
*
4 l.4q 3l
5 l.53gg
6 1.5t60
7 l.527ta
I t'5zt?
q r.5245
Io 1.5231
il l.5z3S
\2 \,5235 Ito-rrl < L
\)z* +7* -br-F=o
IW
tL=
2x+t
,lt,z) ) ko=l
t
v
L'(z^+3) = ?tt +S lh) = (?x+S)h (zt+?iY"
q 7- ?x+5
- u= (?x+ilv" u,=
'' '|vag *G)Gt+E\b
v = (Lxrz\b r, -i()(ra+g7-3rz
L--w
lm z g(*)
=
v _ t2,,G5'
l- i. g)x) satisf;gs conv}ry?lyr6g conolilron
^-J2X+?
t i{-;
o t-0000
I \.264q
L il 'l
\.26 ,
<0
3 \-z6,rJla|-L'l
X: \7rd-z
9
L 7.t
o -"l.Oo Og
I *o-zt07
L -o.3glq
3 -o.3qob I
h -o-34r3J\Lq-74ltL
ELIMINATION METHOD
***Exercise 2.1
Solve the following 1-8 system of linear equations using
(a) Gauss elimination
(b) Gauss elimination with partial pivoting
Show your calculation in 4DP.
1 2 4 𝑥1 11 1 2 4 11 18
1. a) 4 1 −1 𝑥2 = 6 [A|b] = 4 1 −1 6 10
2 5 2 𝑥3 3 2 5 2 3 12
𝑚21 = 4/1 = 4 ; −𝑚21 𝑅1 + 𝑅2 → 𝑅2
𝑚31 = 2/1 = 2 ; −𝑚31 𝑅1 + 𝑅3 → 𝑅3
1 2 4 11 18
0 −7 −17 −38 −62 𝑚32 = 1/−7 = −0.1429 ; −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0 1 −6 −19 −24
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-0.1429 (-7) + (1) = 0
-0.1429 (-17) + (-6) = -8.4293 1 2 4 11 18
-0.1429 (-38) + (-19) = -24.4302 0 −7 −17 −38 −62 = [U|d]
-0.1429 (-62) + (-24) = -32.8598 0 0 −8.4293 −24.4302 −32.8595
1 2 4 𝑥1 11 1 2 4 11 18
1. b) 4 1 −1 𝑥2 = 6 [A|b] = 4 1 −1 6 10
2 5 2 𝑥3 3 2 5 2 3 12
𝑅1 ↔ 𝑅2 (𝑝𝑎𝑟𝑡𝑖𝑎𝑙 𝑝𝑖𝑣𝑜𝑡𝑖𝑛𝑔)
4 1 −1 6 10
1 2 4 11 18
2 5 2 3 12
4 1 −1 6 10 4 1 −1 6 10
0 1.75 4.25 9.5 15.5 𝑅2 ↔ 𝑅3 (𝑝𝑎𝑟𝑡𝑖𝑎𝑙 𝑝𝑖𝑣𝑜𝑡𝑖𝑛𝑔) 0 4.5 2.5 0 7
0 4.5 2.5 0 7 0 1.75 4.25 9.5 15.5
𝑚32 = 1.75/4.5 = 0.3889 ;
−𝑚32 𝑅2 + 𝑅3 → 𝑅3
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-0.3889 (4.5) + (1.75) = -0.0001 = 0
-0.3889 (2.5) + (4.25) = 3.2778 4 1 −1 6 10
0 4.5 2.5 0 7 = [U|d]
-0.3889 (0.0) + (9.50) = 9.5
0 0 3.2778 9.5 12.7777
-0.3889 (7.0) + (15.5) = 12.7777
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-1.1895 (14.6286) + (17.4) = -0.0007 = 0
-1.1895 (-23.0787) + (-32) = -4.5479 1.4 −3.4 8.3 2.4 8.7
0 14.6286 −23.0787 −0.2143 −8.6644 = [U|d]
-1.1895 (-0.2143) + (-8.2) = -7.9451
0 0 −4.5479 −7.9451 −12.4937
-1.1895 (-8.6644) + (-22.8) = -12.4937
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0.8706 (4.9963) + (-4.35) = -0.0002 = 0
0.8076 (-5.3643) + (8) = 3.3298 5.6 3.8 1.2 1.4 12
0 4.9963 −5.3643 4.3250 3.9568 = [U|d]
0.8076 (4.3250) + (2.05) = 5.8153
0 0 3.3298 5.8153 9.1448
0.8076 (3.9568) + (5.7) = 9.1448
3 4 3 𝑥1 16 3 4 3 16 26
3. a) 1 5 −1 𝑥2 = −12 [A|b] = 1 5 −1 −12 −7
6 3 7 𝑥3 102 6 3 7 102 118
𝑚21 = 1/3 = 0.3333 ; −𝑚21 𝑅1 + 𝑅2 → 𝑅2
𝑚31 = 6/3 = 2.0000 ; −𝑚31 𝑅1 + 𝑅3 → 𝑅3
3 4 3 16 26
0 3.6668 −1.9999 −17.3328 −15.6658 𝑚32 = −5/3.6668 = −1.3636 ; −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0 −5 1 70 66
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
1.3636 (3.6668) + (-5) =0
1.3636 (-1.9999) + (1) = -1.7271 3 4 3 16 26
0 3.6668 −1.9999 −17.3328 −15.6658 = [U|d]
1.3636 (-17.3328) + (70) = 46.3650
0 0 −1.7271 46.3650 44.6381
1.3636 (-15.6658) + (66) = 44.6381
3 4 3 𝑥1 16 3 4 3 16 26
3. b) 1 5 −1 𝑥2 = −12 [A|b] = 1 5 −1 −12 −7
6 3 7 𝑥3 102 6 3 7 102 118
𝑅1 ↔ 𝑅3 (𝑝𝑎𝑟𝑡𝑖𝑎𝑙 𝑝𝑖𝑣𝑜𝑡𝑖𝑛𝑔)
6 3 7 102 118
1 5 −1 −12 −7
3 4 3 16 26
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-0.5556 (4.4999) + (2.5) = -0.0001 = 0
-0.5556 (-2.1669) + (-0.5) = 0.7039 6 3 7 102 118
0 4.4999 −2.1669 −29.0034 −26.6706 = [U|d]
-0.5556 (-29.0034) + (-35) = -18.8857
0 0 0.7039 −18.8857 −18.1818
-0.5556 (-26.6706) + (-33) = -18.1818
2 8 4 𝑥1 9 2 8 4 9 23
4. a) 4 −5 −16 𝑥2 = 7 [A|b] = 4 −5 −16 7 −10
10 −5 1 𝑥3 4 10 −5 1 4 10
𝑚21 = 4/2 = 2 ; −𝑚21 𝑅1 + 𝑅2 → 𝑅2
𝑚31 = 10/2 = 5 ; −𝑚31 𝑅1 + 𝑅3 → 𝑅3
2 8 4 9 23
0 −21 −24 −11 −56 𝑚32 = −45/−21 = 2.1429 ; −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0 −45 −19 −41 −105
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-2.1429 (-21) + (-45) = 0.0009 = 0
2 8 4 9 23
-2.1429 (-24) + (-19) = 32.4296
0 −21 −24 −11 −56 = [U|d]
-2.1429 (-11) + (-41) = -17.4281
0 0 32.4296 −17.4281 15.0024
-2.1249 (-56) + (-105) = 15.0024
2 8 4 𝑥1 9 2 8 4 9 23
4. b) 4 −5 −16 𝑥2 = 7 [A|b] = 4 −5 −16 7 −10
10 −5 1 𝑥3 4 10 −5 1 4 10
𝑅1 ↔ 𝑅3 (𝑝𝑎𝑟𝑡𝑖𝑎𝑙 𝑝𝑖𝑣𝑜𝑡𝑖𝑛𝑔)
10 −5 1 4 10
4 −5 −16 7 −10
2 8 4 9 23
10 −5 1 4 10 10 −5 1 4 10
0 −3 −16.4 5.4 −14 𝑅2 ↔ 𝑅3 (𝑝𝑎𝑟𝑡𝑖𝑎𝑙 𝑝𝑖𝑣𝑜𝑡𝑖𝑛𝑔) 0 9 3.8 8.2 21
0 9 3.8 8.2 21 0 −3 −16.4 5.4 −14
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0.3333 (9.0) + (-3) = -0.0003 = 0
0.3333 (3.8) + (-16.4) = -15.1335 10 −5 1 4 10
0.3333 (8.2) + (5.4) = 8.1331 0 9 3.8 8.2 21 = [U|d]
0.3333 (21) + (-14) = -7.0007 0 0 −15.1335 8.1331 −7.007
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
1.3021 (-4.8003) + (6.2503) = -0.0002 = 0
1.3021 (0.2332) + (5.2168) = 5.5204 12 7.8 4.6 21.38 45.78
0 −4.8003 0.2332 18.786 14.2185 = [U|d]
1.3021 (18.786) + (-0.1710) = 24.2903
0 0 5.5204 24.2903 29.8104
1.3021 (14.2185) + (11.2965) = 29.8104
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0.768 (6.2503) + (-4.8003) = -0.0001 = 0
12 7.8 4.6 21.38 45.78
0.768 (5.2168) + (0.2332) = 4.2397
0 6.2503 5.2168 −0.1710 11.2965 = [U|d]
0.768 (-0.1710) + (18.786) = 18.6547
0 0 4.2397 18.6547 22.8942
0.768 (11.2965) + (14.2185) = 22.8942
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-3.8095 (18.16) + (69.18) = -0.0005 = 0
0.5 −8.7 15.3 0.6 7.7
-3.8095 (-21.14) + (-115.72) = -35.1872
0 18.16 −21.14 9.92 6.94 = [U|d]
-3.8095 (9.92) + (3.36) = -34.4302
0 0 −35.1872 −34.4302 −69.6179
-3.8095 (6.94) + (-43.18) = -69.6179
3.7 4.8 −2.5 7.8 13.8 3.7 4.8 −2.5 7.8 13.8
0 1.3326 7.008 9.103 17.4438 𝑅2 ↔ 𝑅3 0 −9.3485 15.6378 −0.4538 5.8356
0 −9.3485 15.6378 −0.4538 5.8356 0 1.3326 7.008 9.103 17.4438
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
0.1425 (-9.3485) + (1.3326) = 0.0004 = 0
3.7 4.8 −2.5 7.8 13.8
0.1425 (15.6378) + (7.008) = 9.2364
0 −9.3485 15.6378 −0.4538 5.8356 = [U|d]
0.1425 (-0.4538) + (9.103) = 9.0383
0 0 9.2364 9.0383 18.2754
0.1425 (5.8356) + (17.4438) = 18.2754
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
4.8889 (-3.5734) + (17.4699) = -0.0001 = 0
3.21 4.28 6.35 14.18 28.02
4.8889 (-14.4004) + (9.4938) = -60.9083
0 −3.5734 −14.4004 −15.3040 −33.2779
4.8889 (-15.3040) + (29.3145) = -45.5052 0 0 −60.9083 −45.5052 −106.4142
4.8889 (-33.2779) + (56.2781) = -106.4142
= [U|d]
9.16 8.64 3.72 25.16 46.68 9.16 8.64 3.72 25.16 46.68
0 1.2525 5.0465 5.3639 11.6633 𝑅2 ↔ 𝑅3 0 15.0356 −0.3159 18.889 33.6084
0 15.0356 −0.3159 18.889 33.6084 0 1.2525 5.0465 5.3639 11.6633
Operation: −𝑚32 𝑅2 + 𝑅3 → 𝑅3
-0.0833 (15.0356) + (1.2525) = 0
9.16 8.64 3.72 25.16 46.68
-0.0833 (-0.3159) + (5.0465) = 5.0728
0 15.0356 −0.3159 18.889 33.6084 = [U|d]
-0.0833 (18.889) + (5.3639) = 3.7904
0 0 5.0728 3.7904 8.8637
-0.0833 (33.6084) + (11.6633) = 8.8637
LU FACTORIZATION METHOD
***Exercise 2.2
Solve the following system of linear equations using LU factorization
(a) Doolittle method
(b) Crout method
Show your calculation in 4DP.
−2 4 3 𝑥1 −3
1. a) Ax = b → 3 2 −4 𝑥2 = 19
4 3 5 𝑥3 −5
−2 4 3 1 0 0 𝑝 𝑞 𝑟 𝑝 𝑞 𝑟
3 2 −4 = 𝑎 1 0 0 𝑠 𝑡 = 𝑎𝑝 𝑎𝑞 + 𝑠 𝑎𝑟 + 𝑡
4 3 5 𝑏 𝑐 1 0 0 𝑢 𝑏𝑝 𝑏𝑞 + 𝑐𝑠 𝑏𝑟 + 𝑐𝑡 + 𝑢
We obtain,
𝑝 = −2.0000
𝑞 = 4.0000
𝑟 = 3.0000
3
𝑎𝑝 = 3 → 𝑎= = −1.5000
𝑝
4
𝑏𝑝 = 4 → 𝑏= = −2.0000
𝑝
𝑎𝑞 + 𝑠 = 2 → 𝑠 = 2 − 𝑎𝑞 = 8.0000
𝑎𝑟 + 𝑡 = −4 → 𝑡 = −4 − 𝑎𝑟 = 0.5000
3 − 𝑏𝑞
𝑏𝑞 + 𝑐𝑠 = 3 → 𝑐= = 1.3750
𝑠
𝑏𝑟 + 𝑐𝑡 + 𝑢 = 5 → 𝑢 = 5 − 𝑏𝑟 − 𝑐𝑡 = 10.3125
−2 4 3 1 0 0 −2 4 3
To find solution of Ax = b or
A = LU : −1.5 8 0.5 = −1.5 1 0 0 8 0.5 LUx = b, let Ux = y
−2 1.25 10.3125 −2 1.375 1 0 0 10.3125
−2 4 3 𝑥1 −3
1. b) Ax = b → 3 2 −4 𝑥2 = 19
4 3 5 𝑥3 −5
−2 4 3 𝑝 0 0 1 𝑎 𝑏 𝑝 𝑝𝑎 𝑝𝑏
3 2 −4 = 𝑞 𝑠 0 0 1 𝑐 = 𝑞 𝑞𝑎 + 𝑠 𝑞𝑏 + 𝑠𝑐
4 3 5 𝑟 𝑡 𝑢 0 0 1 𝑟 𝑟𝑎 + 𝑡 𝑟𝑏 + 𝑡𝑐 + 𝑢
We obtain,
𝑝 = −2.0000
𝑞 = 3.0000
𝑟 = 4.0000
4
𝑝𝑎 = 4 → 𝑎= = −2.0000
𝑝
3
𝑝𝑏 = 3 → 𝑏= = −1.50000
𝑝
𝑞𝑎 + 𝑠 = 2 → 𝑠 = 2 − 𝑞𝑎 = 8.0000
𝑟𝑎 + 𝑡 = 3 → 𝑡 = 3 − 𝑟𝑎 = 11.0000
−4 − 𝑞𝑏
𝑞𝑏 + 𝑠𝑐 = −4 → 𝑐= = 0.0625
𝑠
𝑟𝑏 + 𝑡𝑐 + 𝑢 = 5 → 𝑢 = 5 − 𝑟𝑏 − 𝑡𝑐 = 10.3125
6 1 −6 𝑥1 −1
2. a) Ax = b → 4 −3 0 𝑥2 = 7
2 2 3 𝑥3 3
6 1 −6 1 0 0 𝑝 𝑞 𝑟 𝑝 𝑞 𝑟
4 −3 0 = 𝑎 1 0 0 𝑠 𝑡 = 𝑎𝑝 𝑎𝑞 + 𝑠 𝑎𝑟 + 𝑡
2 2 3 𝑏 𝑐 1 0 0 𝑢 𝑏𝑝 𝑏𝑞 + 𝑐𝑠 𝑏𝑟 + 𝑐𝑡 + 𝑢
We obtain,
𝑝 = 6.0000
𝑞 = 1.0000
𝑟 = −6.0000
4
𝑎𝑝 =4 → 𝑎= = 0.6667
𝑝
2
𝑏𝑝 =2 → 𝑏= = 0.3333
𝑝
𝑎𝑞 + 𝑠 = −3 → 𝑠 = −3 − 𝑎𝑞 = −3.6667
𝑎𝑟 + 𝑡 =0 → 𝑡 = 0 − 𝑎𝑟 = 4.0002
2 − 𝑏𝑞
𝑏𝑞 + 𝑐𝑠 =2 → 𝑐= = −0.4546
𝑠
𝑏𝑟 + 𝑐𝑡 + 𝑢 = 3 → 𝑢 = 3 − 𝑏𝑟 − 𝑐𝑡 = 6.8183
6 1 −6 1 0 0 6 1 −6
To find solution of Ax = b or
A = LU : 4 −3 0 = 0.6667 1 0 0 −3.6667 4.0002
LUx = b, let Ux = y
2 2 3 0.3333 −0.4546 1 0 0 3.1813
6 1 −6 𝑥1 −1
2. b) Ax = b → 4 −3 0 𝑥2 = 7
2 2 3 𝑥3 3
6 1 −6 𝑝 0 0 1 𝑎 𝑏 𝑝 𝑝𝑎 𝑝𝑏
4 −3 0 = 𝑞 𝑠 0 0 1 𝑐 = 𝑞 𝑞𝑎 + 𝑠 𝑞𝑏 + 𝑠𝑐
2 2 3 𝑟 𝑡 𝑢 0 0 1 𝑟 𝑟𝑎 + 𝑡 𝑟𝑏 + 𝑡𝑐 + 𝑢
We obtain,
𝑝 = 6.0000
𝑞 = 4.0000
𝑟 = 2.0000
1
𝑝𝑎 =1 → 𝑎= = 0.1667
𝑝
−6
𝑝𝑏 = −6 → 𝑏= = −1.0000
𝑝
𝑞𝑎 + 𝑠 = −3 → 𝑠 = −3 − 𝑞𝑎 = −3.6668
𝑟𝑎 + 𝑡 =2 → 𝑡 = 2 − 𝑟𝑎 = 1.6666
0 − 𝑞𝑏
𝑞𝑏 + 𝑠𝑐 =0 → 𝑐= = −1.0909
𝑠
𝑟𝑏 + 𝑡𝑐 + 𝑢 = 3 → 𝑢 = 3 − 𝑟𝑏 − 𝑡𝑐 = 6.8181
2 −1 1 𝑥1 −1
3. a) Ax = b → 3 3 9 𝑥2 = 0
3 3 5 𝑥3 4
2 −1 1 1 0 0 𝑝 𝑞 𝑟 𝑝 𝑞 𝑟
3 3 9 = 𝑎 1 0 0 𝑠 𝑡 = 𝑎𝑝 𝑎𝑞 + 𝑠 𝑎𝑟 + 𝑡
3 3 5 𝑏 𝑐 1 0 0 𝑢 𝑏𝑝 𝑏𝑞 + 𝑐𝑠 𝑏𝑟 + 𝑐𝑡 + 𝑢
We obtain,
𝑝 = 2.0000
𝑞 = −1.0000
𝑟 = 1.0000
3
𝑎𝑝 =3 → 𝑎= = 1.5000
𝑝
3
𝑏𝑝 =3 → 𝑏 = = 1.5000
𝑝
𝑎𝑞 + 𝑠 =3 → 𝑠 = 3 − 𝑎𝑞 = 4.5000
𝑎𝑟 + 𝑡 =9 → 𝑡 = 9 − 𝑎𝑟 = 7.5000
3 − 𝑏𝑞
𝑏𝑞 + 𝑐𝑠 =3 → 𝑐= = 1.0000
𝑠
𝑏𝑟 + 𝑐𝑡 + 𝑢 = 5 → 𝑢 = 5 − 𝑏𝑟 − 𝑐𝑡 = −4.0000
2 −1 1 1 0 0 2 −1 1
To find solution of Ax = b or
A = LU : 3 3 9 = 1.5 1 0 0 4.5 7.5 LUx = b, let Ux = y
3 3 5 1.5 1 1 0 0 −4
2 −1 1 𝑥1 −1
3. b) Ax = b → 3 3 9 𝑥2 = 0
3 3 5 𝑥3 4
2 −1 1 𝑝 0 0 1 𝑎 𝑏 𝑝 𝑝𝑎 𝑝𝑏
3 3 9 = 𝑞 𝑠 0 0 1 𝑐 = 𝑞 𝑞𝑎 + 𝑠 𝑞𝑏 + 𝑠𝑐
3 3 5 𝑟 𝑡 𝑢 0 0 1 𝑟 𝑟𝑎 + 𝑡 𝑟𝑏 + 𝑡𝑐 + 𝑢
We obtain,
𝑝 = 2.0000
𝑞 = 3.0000
𝑟 = 3.0000
−1
𝑝𝑎 = −1 → 𝑎 = = −0.5000
𝑝
1
𝑝𝑏 =1 → 𝑏= = 0.5000
𝑝
𝑞𝑎 + 𝑠 =3 → 𝑠 = 3 − 𝑞𝑎 = 4.5000
𝑟𝑎 + 𝑡 =3 → 𝑡 = 3 − 𝑟𝑎 = 4.5000
9 − 𝑞𝑏
𝑞𝑏 + 𝑠𝑐 =9 → 𝑐= = 1.6667
𝑠
𝑟𝑏 + 𝑡𝑐 + 𝑢 = 5 → 𝑢 = 5 − 𝑟𝑏 − 𝑡𝑐 = −4.0002
2 −1 1 2 0 0 1 −0.5 0.5
To find solution of Ax = b or
A = LU : 3 3 9 = 3 4.5 0 0 1 1.6667 LUx = b, let Ux = y
3 3 5 3 4.5 −4.0002 0 0 1
2 0 1 𝑥1 25
4. a) Ax = b → 4 1 13 𝑥2 = 108
6 4 42 𝑥3 292
2 0 1 1 0 0 𝑝 𝑞 𝑟 𝑝 𝑞 𝑟
4 1 13 = 𝑎 1 0 0 𝑠 𝑡 = 𝑎𝑝 𝑎𝑞 + 𝑠 𝑎𝑟 + 𝑡
6 4 42 𝑏 𝑐 1 0 0 𝑢 𝑏𝑝 𝑏𝑞 + 𝑐𝑠 𝑏𝑟 + 𝑐𝑡 + 𝑢
We obtain,
𝑝 = 2.0000
𝑞 = 0.0000
𝑟 = 1.0000
4
𝑎𝑝 =4 → 𝑎= = 2.0000
𝑝
6
𝑏𝑝 =6 → 𝑏= = 3.0000
𝑝
𝑎𝑞 + 𝑠 =1 → 𝑠 = 1 − 𝑎𝑞 = 1.0000
𝑎𝑟 + 𝑡 = 13 → 𝑡 = 13 − 𝑎𝑟 = 11.0000
4 − 𝑏𝑞
𝑏𝑞 + 𝑐𝑠 =4 → 𝑐= = 4.0000
𝑠
𝑏𝑟 + 𝑐𝑡 + 𝑢 = 42 → 𝑢 = 42 − 𝑏𝑟 − 𝑐𝑡 = −5.0000
2 0 1 1 0 0 2 0 1
To find solution of Ax = b or
A = LU : 4 1 13 = 2 1 0 0 1 11 LUx = b, let Ux = y
6 4 42 3 4 1 0 0 −5
2 0 1 𝑥1 25
4. b) Ax = b → 4 1 13 𝑥2 = 108
6 4 42 𝑥3 292
2 0 1 𝑝 0 0 1 𝑎 𝑏 𝑝 𝑝𝑎 𝑝𝑏
4 1 13 = 𝑞 𝑠 0 0 1 𝑐 = 𝑞 𝑞𝑎 + 𝑠 𝑞𝑏 + 𝑠𝑐
6 4 42 𝑟 𝑡 𝑢 0 0 1 𝑟 𝑟𝑎 + 𝑡 𝑟𝑏 + 𝑡𝑐 + 𝑢
We obtain,
𝑝 = 2.0000
𝑞 = 4.0000
𝑟 = 6.0000
0
𝑝𝑎 =0 → 𝑎= = 0.0000
𝑝
1
𝑝𝑏 =1 → 𝑏= = 0.5000
𝑝
𝑞𝑎 + 𝑠 =1 → 𝑠 = 1 − 𝑞𝑎 = 1.0000
𝑟𝑎 + 𝑡 =4 → 𝑡 = 4 − 𝑟𝑎 = 4.0000
13 − 𝑞𝑏
𝑞𝑏 + 𝑠𝑐 = 13 → 𝑐= = 11.0000
𝑠
𝑟𝑏 + 𝑡𝑐 + 𝑢 = 42 → 𝑢 = 42 − 𝑟𝑏 − 𝑡𝑐 = −5.0000
2 0 1 2 0 0 1 0 0.5
To find solution of Ax = b or
A = LU : 4 1 13 = 4 1 0 0 1 11 LUx = b, let Ux = y
6 4 42 6 4 −5 0 0 1
𝑥1
a) Ax = b → 𝑥2 =
𝑥3
1 0 0 𝑝 𝑞 𝑟 𝑝 𝑞 𝑟
= 𝑎 1 0 0 𝑠 𝑡 = 𝑎𝑝 𝑎𝑞 + 𝑠 𝑎𝑟 + 𝑡
𝑏 𝑐 1 0 0 𝑢 𝑏𝑝 𝑏𝑞 + 𝑐𝑠 𝑏𝑟 + 𝑐𝑡 + 𝑢
We obtain,
𝑝 =
𝑞 =
𝑟 =
𝑎𝑝 = → 𝑎=
𝑝
𝑏𝑝 = → 𝑏=
𝑝
𝑎𝑞 + 𝑠 = → 𝑠 = −𝑎𝑞
𝑎𝑟 + 𝑡 = → 𝑡 = −𝑎𝑟
−𝑏𝑞
𝑏𝑞 + 𝑐𝑠 = → 𝑐=
𝑠
𝑏𝑟 + 𝑐𝑡 + 𝑢 = → 𝑢 = −𝑏𝑟 − 𝑐𝑡
1 0 0 𝑝 𝑞 𝑟
To find solution of Ax = b or
A = LU : = 𝑎 1 0 0 𝑠 𝑡 LUx = b, let Ux = y
𝑏 𝑐 1 0 0 𝑢
Solution: 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥1
b) Ax = b → 𝑥2 =
𝑥3
𝑝 0 0 1 𝑎 𝑏 𝑝 𝑝𝑎 𝑝𝑏
= 𝑞 𝑠 0 0 1 𝑐 = 𝑞 𝑞𝑎 + 𝑠 𝑞𝑏 + 𝑠𝑐
𝑟 𝑡 𝑢 0 0 1 𝑟 𝑟𝑎 + 𝑡 𝑟𝑏 + 𝑡𝑐 + 𝑢
We obtain,
𝑝 =
𝑞 =
𝑟 =
𝑝𝑎 = → 𝑎=
𝑝
𝑝𝑏 = → 𝑏=
𝑝
𝑞𝑎 + 𝑠 = → 𝑠 = −𝑞𝑎
𝑟𝑎 + 𝑡 = → 𝑡 = −𝑟𝑎
−𝑞𝑏
𝑞𝑏 + 𝑠𝑐 = → 𝑐=
𝑠
𝑟𝑏 + 𝑡𝑐 + 𝑢 = → 𝑢 = −𝑟𝑏 − 𝑡𝑐
𝑝 0 0 1 𝑎 𝑏 To find solution of Ax = b or
A = LU : = 𝑞 𝑠 0 0 1 𝑐 LUx = b, let Ux = y
𝑟 𝑡 𝑢 0 0 1
Solution: 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
Solve the following system of linear equation using Cholesky factorization method. Show the
calculation in 4DP.
2 3 4 𝑥1 20
8. Ax = b → 3 6 7 𝑥2 = 36
4 7 10 𝑥3 48
2 3 4 𝑎 0 0 𝑎 𝑏 𝑑
𝐴 = 𝐿𝐿 𝑇
→ 3 6 7 = 𝑏 𝑐 0 0 𝑐 𝑒
4 7 10 𝑑 𝑒 𝑓 0 0 𝑓
𝑎2 𝑎𝑏 𝑎𝑑
2 2
= 𝑎𝑏 𝑏 + 𝑐 𝑏𝑑 + 𝑐𝑒
𝑎𝑑 𝑏𝑑 + 𝑐𝑒 𝑑 2 + 𝑒 2 + 𝑓 2
we obtain
𝑎2 =2 → 𝑎 = 1.4142
3
𝑎𝑏 =3 → 𝑏= = 2.1213
𝑎
4
𝑎𝑑 =4 → 𝑑= = 2.8285
𝑎
𝑏2 + 𝑐 2 → 𝑐 = √6 − 𝑏 2
=6 = 1.2248
7 − 𝑏𝑑
𝑏𝑑 + 𝑐𝑒 =7 → 𝑒= = 0.8164
𝑐
2 2 2
𝑑 + 𝑒 + 𝑓 = 10 → 𝑓 = √10 − 𝑒 2 − 𝑑 2 = 1.1546
then 𝐴 = 𝐿𝐿𝑇 , 𝑈 = 𝐿𝑇
2 3 4 1.4142 0 0 1.4142 2.1213 2.8285
𝐴 = 𝐿𝐿𝑇 → 3 6 7 = 2.1213 1.2248 0 0 1.2248 0.8164
4 7 10 2.8285 0.8164 1.1546 0 0 1.1546
EXACT SOLUTION: x = (1 , 2 , 3)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2 3 4 𝑥1 9
9. Ax = b → 3 6 7 𝑥2 = 16
4 7 10 𝑥3 21
2 3 4 𝑎 0 0 𝑎 𝑏 𝑑
𝐴 = 𝐿𝐿 𝑇
→ 3 6 7 = 𝑏 𝑐 0 0 𝑐 𝑒
4 7 10 𝑑 𝑒 𝑓 0 0 𝑓
𝑎2 𝑎𝑏 𝑎𝑑
2 2
= 𝑎𝑏 𝑏 + 𝑐 𝑏𝑑 + 𝑐𝑒
𝑎𝑑 𝑏𝑑 + 𝑐𝑒 𝑑 2 + 𝑒 2 + 𝑓 2
we obtain
𝑎2 =2 → 𝑎 = 1.4142
3
𝑎𝑏 =3 → 𝑏= = 2.1213
𝑎
4
𝑎𝑑 =4 → 𝑑= = 2.8285
𝑎
𝑏2 + 𝑐 2 = 6 → 𝑐 = √6 − 𝑏 2 = 1.2248
7 − 𝑏𝑑
𝑏𝑑 + 𝑐𝑒 =7 → 𝑒= = 0.8164
𝑐
𝑑2 + 𝑒 2 + 𝑓 2 = 10 → 𝑓 = √10 − 𝑒 2 − 𝑑 2 = 1.1546
then 𝐴 = 𝐿𝐿𝑇 , 𝑈 = 𝐿𝑇
2 3 4 1.4142 0 0 1.4142 2.1213 2.8285
𝐴 = 𝐿𝐿𝑇 → 3 6 7 = 2.1213 1.2248 0 0 1.2248 0.8164
4 7 10 2.8285 0.8164 1.1546 0 0 1.1546
EXACT SOLUTION: x = (1 , 1 , 1)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
3 −12 10 𝑥1 1
10. Ax = b → −12 64 −60 𝑥2 = −8
10 −60 60 𝑥3 10
3 −12 10 𝑎 0 0 𝑎 𝑏 𝑑
𝐴 = 𝐿𝐿 𝑇
→ −12 64 −60 = 𝑏 𝑐 0 0 𝑐 𝑒
10 −60 60 𝑑 𝑒 𝑓 0 0 𝑓
2
𝑎 𝑎𝑏 𝑎𝑑
2 2
= 𝑎𝑏 𝑏 + 𝑐 𝑏𝑑 + 𝑐𝑒
𝑎𝑑 𝑏𝑑 + 𝑐𝑒 𝑑 2 + 𝑒 2 + 𝑓 2
we obtain
𝑎2 =3 → 𝑎 = 1.7321
−12
𝑎𝑏 = −12 → 𝑏 = = −6.9280
𝑎
10
𝑎𝑑 = 10 → 𝑑= = 5.7733
𝑎
𝑏2 + 𝑐 2 = 64 → 𝑐 = √64 − 𝑏 2 = 4.0004
−60 − 𝑏𝑑
𝑏𝑑 + 𝑐𝑒 = −60 → 𝑒 = = −5.0001
𝑐
𝑑2 + 𝑒 2 + 𝑓 2 = 60 → 𝑓 = √60 − 𝑒 2 − 𝑑 2 = 1.2915
then 𝐴 = 𝐿𝐿𝑇 , 𝑈 = 𝐿𝑇
3 −12 10 1.7321 0 0 1.7321 −6.928 5.7733
𝐴 = 𝐿𝐿𝑇 → −12 64 −60 = −6.928 4.0004 0 0 4.0004 −5.0001
10 −60 60 5.7733 −5.0001 1.2915 0 0 1.2915
EXACT SOLUTION: x = (1 , 1 , 1)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
3 −12 10 𝑥1 −5
11. Ax = b → −12 64 −60 𝑥2 = 32
10 −60 60 𝑥3 −30
3 −12 10 𝑎 0 0 𝑎 𝑏 𝑑
𝐴 = 𝐿𝐿 𝑇
→ −12 64 −60 = 𝑏 𝑐 0 0 𝑐 𝑒
10 −60 60 𝑑 𝑒 𝑓 0 0 𝑓
2
𝑎 𝑎𝑏 𝑎𝑑
2 2
= 𝑎𝑏 𝑏 + 𝑐 𝑏𝑑 + 𝑐𝑒
𝑎𝑑 𝑏𝑑 + 𝑐𝑒 𝑑 2 + 𝑒 2 + 𝑓 2
we obtain
𝑎2 =3 → 𝑎 = 1.7321
−12
𝑎𝑏 = −12 → 𝑏 = = −6.9280
𝑎
10
𝑎𝑑 = 10 → 𝑑= = 5.7733
𝑎
𝑏2 + 𝑐 2 = 64 → 𝑐 = √64 − 𝑏 2 = 4.0004
−60 − 𝑏𝑑
𝑏𝑑 + 𝑐𝑒 = −60 → 𝑒 = = −5.0001
𝑐
𝑑2 + 𝑒 2 + 𝑓 2 = 60 → 𝑓 = √60 − 𝑒 2 − 𝑑 2 = 1.2915
then 𝐴 = 𝐿𝐿𝑇 , 𝑈 = 𝐿𝑇
3 −12 10 1.7321 0 0 1.7321 −6.928 5.7733
𝐴 = 𝐿𝐿𝑇 → −12 64 −60 = −6.928 4.0004 0 0 4.0004 −5.0001
10 −60 60 5.7733 −5.0001 1.2915 0 0 1.2915
EXACT SOLUTION: x = (3 , 2 , 1)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥1
Ax = b → 𝑥2 =
𝑥3
𝑎 0 0 𝑎 𝑏 𝑑
𝐴 = 𝐿𝐿 𝑇
→ = 𝑏 𝑐 0 0 𝑐 𝑒
𝑑 𝑒 𝑓 0 0 𝑓
𝑎2 𝑎𝑏 𝑎𝑑
2 2
= 𝑎𝑏 𝑏 + 𝑐 𝑏𝑑 + 𝑐𝑒
𝑎𝑑 𝑏𝑑 + 𝑐𝑒 𝑑 2 + 𝑒 2 + 𝑓 2
we obtain
𝑎2 = → 𝑎=
𝑎𝑏 = → 𝑏=
𝑎
𝑎𝑑 = → 𝑑=
𝑎
2 2
𝑏 +𝑐 = → 𝑐 = √−𝑏 2
−𝑏𝑑
𝑏𝑑 + 𝑐𝑒 = → 𝑒=
𝑐
2 2 2
𝑑 + 𝑒 + 𝑓 = → 𝑓 = √−𝑒 2 − 𝑑 2
then 𝐴 = 𝐿𝐿𝑇 , 𝑈 = 𝐿𝑇
𝑎 0 0 𝑎 𝑏 𝑑
𝐴 = 𝐿𝐿 𝑇
→ = 𝑏 𝑐 0 0 𝑐 𝑒
𝑑 𝑒 𝑓 0 0 𝑓
0 0 𝑦1 By using calculator:
1) Solve Ly = b, → 0 𝑦2 = → 𝑦1 =
Forward substitution
𝑦3 𝑦2 =
𝑦3 =
𝑥1 By using calculator:
2) Solve 𝐿𝑇 x = y, → 0 𝑥2 = → 𝑥1 =
0 0 𝑥3 𝑥2 =
Backward substitution
𝑥3 =
Solution: 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2 −1 0 𝑥1 1
14. a) Ax = b → −1 2 −1 𝑥2 = 2
0 −1 2 𝑥3 3
𝑑1 𝑒1 0 2 −1 0 𝛼1 0 0 1 𝛽1 0
𝐴 = 𝐿𝑈 → 𝑐2 𝑑2 𝑒2 = −1 2 −1 = 𝑐2 𝛼2 0 0 1 𝛽2
0 𝑐3 𝑑3 0 −1 2 0 𝑐3 𝛼3 0 0 1
𝛼1 𝛼1 𝛽1 0
= 𝑐2 𝑐2 𝛽1 + 𝛼2 𝛼2 𝛽2
0 𝑐3 𝑐3 𝛽2 + 𝛼3
we obtain
𝛼1 = 2.0000
−1
𝛼1 𝛽1 = −1 → 𝛽1 = = −0.5000
𝛼1
𝑐2 𝛽1 + 𝛼2 =2 → 𝛼2 = 2 − 𝑐2 𝛽1 = 1.5000
−1
𝛼2 𝛽2 = −1 → 𝛽2 = = −0.6667
𝛼2
𝑐3 𝛽2 + 𝛼3 =2 → 𝛼3 = 2 − 𝑐3 𝛽2 = 1.3333
2 −1 0 2 0 0 1 −0.5 0
then 𝐴 = 𝐿𝑈 → −1 2 −1 = −1 1.5 0 0 1 −0.6667
0 −1 2 0 −1 1.3333 0 0 1
2 0 0 𝑤1 1 By using calculator:
1) Solve Lw = b, → −1 1.5 0 𝑤2 = 2 → 𝑤1 = 0.5
0 −1 1.3333 𝑤3 3
Forward substitution 𝑤2 = 1.6667
𝑤3 = 3.5001
2 −1 0 𝑥1 1
14. b) Ax = b → −1 2 −1 𝑥2 = 2
0 −1 2 𝑥3 3
𝛼1 = 𝑑1
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1 , 𝑖 = 2 ,3 ,…,𝑛
𝑒𝑖
𝛽𝑖 = , 𝑖 = 1 ,2 ,3 ,…,𝑛 − 1
𝛼𝑖
𝑏1
𝑤1 =
𝛼1
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖 , 𝑖 = 2 ,3 ,…,𝑛
𝑥𝑛 = 𝑤𝑛
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1 , 𝑖 = 𝑛 − 1 ,𝑛 − 2 ,…,1
𝑖 1 2 3 4
𝑑𝑖 2 2 2 Type equation here.
(𝛼1 = 𝑑1 )
2 1.5 1.3333 Type equation here.
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1
(𝑤1 = 𝑏1 /𝛼1 )
0.5 1.6667 3.5001 Type equation here.
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖
𝑥3 = 𝑤3
2.5001 4.0002 3.5001 Type equation here.
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1
1 2 0 0 𝑥1 7
15. a) Ax = b → 2 3 −1 0 𝑥2 = 9
0 4 2 3 𝑥3 10
0 0 2 −4 𝑥4 12
𝑑1 𝑒1 0 0 𝛼1 0 0 0 1 𝛽1 0 0
𝐴 = 𝐿𝑈 → 𝑐2 𝑑2 𝑒2 0 = 𝑐2 𝛼2 0 0 0 1 𝛽2 0
0 𝑐3 𝑑3 𝑒3 0 𝑐3 𝛼3 0 0 0 1 𝛽3
0 0 𝑐4 𝑑4 0 0 𝑐4 𝛼4 0 0 0 1
𝛼1 𝛼1 𝛽1 0 0
= 𝑐2 𝑐2 𝛽1 + 𝛼2 𝛼2 𝛽2 0
0 𝑐3 𝑐3 𝛽2 + 𝛼3 𝛼3 𝛽3
0 0 𝑐4 𝑐4 𝛽3 + 𝛼4
we obtain
𝛼1 = 1.0000
2
𝛼1 𝛽1 =2 → 𝛽1 = = 2.0000
𝛼1
𝑐2 𝛽1 + 𝛼2 = 3 → 𝛼2 = 3 − 𝑐2 𝛽1 = −1.0000
−1
𝛼2 𝛽2 = −1 → 𝛽2 = = 1.0000
𝛼2
𝑐3 𝛽2 + 𝛼3 = 2 → 𝛼3 = 2 − 𝑐3 𝛽2 = −2.0000
3
𝛼3 𝛽3 =3 → 𝛽3 = = −1.5000
𝛼3
𝑐4 𝛽3 + 𝛼4 = −4 → 𝛼4 = −4 − 𝑐4 𝛽3 = −1.0000
1 2 0 0 1 0 0 0 1 2 0 0
then 𝐴 = 𝐿𝑈 → 2 3 −1 0 = 2 −1 0 0 0 1 1 0
0 4 2 3 0 4 −2 0 0 0 1 −1.5
0 0 2 −4 0 0 2 −1 0 0 0 1
By using calculator:
1 0 0 0 𝑤1 7
1) Solve Lw = b, → 2 −1 0 0 𝑤2 = 9 → 𝑤1 = 7.0000
𝑤2 = 5.0000
0 4 −2 0 𝑤3 10
Forward substitution 𝑤3 = 5.0000
0 0 2 −1 𝑤4 12
𝑤4 = −2.0000
By using calculator:
1 2 0 0 𝑥1 7 𝑥1 = 1.0000
2) Solve Ux = w, → 0 1 1 0 𝑥2 = 5 → 𝑥2 = 3.0000
0 0 1 −1.5 𝑥3 5 𝑥3 = 2.0000
Backward substitution
0 0 0 1 𝑥4 −2 𝑥4 = −2.0000
1 2 0 0 𝑥1 7
15. b) Ax = b → 2 3 −1 0 𝑥2 = 9
0 4 2 3 𝑥3 10
0 0 2 −4 𝑥4 12
𝛼1 = 𝑑1
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1 , 𝑖 = 2 ,3 ,…,𝑛
𝑒𝑖
𝛽𝑖 = , 𝑖 = 1 ,2 ,3 ,…,𝑛 − 1
𝛼𝑖
𝑏1
𝑤1 =
𝛼1
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖 , 𝑖 = 2 ,3 ,…,𝑛
𝑥𝑛 = 𝑤𝑛
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1 , 𝑖 = 𝑛 − 1 ,𝑛 − 2 ,…,1
𝑖 1 2 3 4
𝑑𝑖 1 3 2 −4
𝑒𝑖 2 −1 3 0
𝑐𝑖 0 2 4 2
𝑏𝑖 7 9 10 12
(𝛼1 = 𝑑1 )
1 −1 −2 −1
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1
𝛽𝑖 = 𝑒𝑖 /𝛼𝑖 2 1 −1.5 0
(𝑤1 = 𝑏1 /𝛼1 )
7 5 5 −2
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖
𝑥4 = 𝑤4
1.0000 3.0000 2.0000 −2.0000
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1
1 1 0 0 𝑥1 5
16. a) Ax = b → 2 −1 5 0 𝑥2 = −9
0 3 −4 2 𝑥3 19
0 0 2 6 𝑥4 2
𝑑1 𝑒1 0 0 𝛼1 0 0 0 1 𝛽1 0 0
𝐴 = 𝐿𝑈 → 𝑐2 𝑑2 𝑒2 0 = 𝑐2 𝛼2 0 0 0 1 𝛽2 0
0 𝑐3 𝑑3 𝑒3 0 𝑐3 𝛼3 0 0 0 1 𝛽3
0 0 𝑐4 𝑑4 0 0 𝑐4 𝛼4 0 0 0 1
𝛼1 𝛼1 𝛽1 0 0
= 𝑐2 𝑐2 𝛽1 + 𝛼2 𝛼2 𝛽2 0
0 𝑐3 𝑐3 𝛽2 + 𝛼3 𝛼3 𝛽3
0 0 𝑐4 𝑐4 𝛽3 + 𝛼4
we obtain
𝛼1 = 1.0000
1
𝛼1 𝛽1 =1 → 𝛽1 = = 1.0000
𝛼1
𝑐2 𝛽1 + 𝛼2 = −1 → 𝛼2 = −1 − 𝑐2 𝛽1 = −3.0000
5
𝛼2 𝛽2 =5 → 𝛽2 = = −1.6667
𝛼2
𝑐3 𝛽2 + 𝛼3 = −4 → 𝛼3 = −4 − 𝑐3 𝛽2 = 1.0001
2
𝛼3 𝛽3 =2 → 𝛽3 = = 1.9998
𝛼3
𝑐4 𝛽3 + 𝛼4 = 6 → 𝛼4 = 6 − 𝑐4 𝛽3 = 2.0004
1 1 0 0 1 0 0 0 1 1 0 0
then 𝐴 = 𝐿𝑈 → 2 −1 5 0 = 2 −3 0 0 0 1 −1.6667 0
0 3 −4 2 0 3 1.0001 0 0 0 1 1.9998
0 0 2 −4 0 0 2 2.0004 0 0 0 1
By using calculator:
1 0 0 0 𝑤1 5
1) Solve Lw = b, → 2 −3 0 0 𝑤2 = −9 → 𝑤1 = 5.0000
𝑤2 = 6.3333
0 3 1.0001 0 𝑤3 19
Forward substitution 𝑤3 = 0.0000
0 0 2 2.0004 𝑤4 2
𝑤4 = 0.9998
By using calculator:
1 1 0 0 𝑥1 5 𝑥1 = 1.9991
2) Solve Ux = w, → 0 1 −1.6667 0 𝑥2 = 6.3333 → 𝑥2 = 3.0009
0 0 1 1.9998 𝑥3 0 𝑥3 = −1.9994
Backward substitution
0 0 0 1 𝑥4 0.9998 𝑥4 = 0.9998
EXACT SOLUTION: x = (2 , 3 , -2 , 1)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
1 1 0 0 𝑥1 5
16. b) Ax = b → 2 −1 5 0 𝑥2 = −9
0 3 −4 2 𝑥3 19
0 0 2 6 𝑥4 2
𝛼1 = 𝑑1
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1 , 𝑖 = 2 ,3 ,…,𝑛
𝑒𝑖
𝛽𝑖 = , 𝑖 = 1 ,2 ,3 ,…,𝑛 − 1
𝛼𝑖
𝑏1
𝑤1 =
𝛼1
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖 , 𝑖 = 2 ,3 ,…,𝑛
𝑥𝑛 = 𝑤𝑛
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1 , 𝑖 = 𝑛 − 1 ,𝑛 − 2 ,…,1
𝑖 1 2 3 4
𝑑𝑖 1 −1 −4 6
𝑒𝑖 1 5 2 0
𝑐𝑖 0 2 3 2
𝑏𝑖 5 −9 19 2
(𝛼1 = 𝑑1 )
1 −3 1.0001 2.0004
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1
(𝑤1 = 𝑏1 /𝛼1 )
5 6.3333 0.0001 0.9998
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖
𝑥4 = 𝑤4
1.9989 3.0011 −1.9993 0.9998
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1
EXACT SOLUTION: x = (2 , 3 , -2 , 1)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
5 2 0 0 𝑥1 16
17. a) Ax = b → 2 3 1 0 𝑥2 = 15
0 1 2 −1 𝑥3 4
0 0 −1 2 𝑥4 4
𝑑1 𝑒1 0 0 𝛼1 0 0 0 1 𝛽1 0 0
𝐴 = 𝐿𝑈 → 𝑐2 𝑑2 𝑒2 0 = 𝑐2 𝛼2 0 0 0 1 𝛽2 0
0 𝑐3 𝑑3 𝑒3 0 𝑐3 𝛼3 0 0 0 1 𝛽3
0 0 𝑐4 𝑑4 0 0 𝑐4 𝛼4 0 0 0 1
𝛼1 𝛼1 𝛽1 0 0
= 𝑐2 𝑐2 𝛽1 + 𝛼2 𝛼2 𝛽2 0
0 𝑐3 𝑐3 𝛽2 + 𝛼3 𝛼3 𝛽3
0 0 𝑐4 𝑐4 𝛽3 + 𝛼4
we obtain
𝛼1 = 5.0000
2
𝛼1 𝛽1 =2 → 𝛽1 = = 0.4000
𝛼1
𝑐2 𝛽1 + 𝛼2 = 3 → 𝛼2 = 3 − 𝑐2 𝛽1 = 2.2000
1
𝛼2 𝛽2 =1 → 𝛽2 = = 0.4545
𝛼2
𝑐3 𝛽2 + 𝛼3 = 2 → 𝛼3 = 2 − 𝑐3 𝛽2 = 1.5455
−1
𝛼3 𝛽3 = −1 → 𝛽3 = = −0.6470
𝛼3
𝑐4 𝛽3 + 𝛼4 = 2 → 𝛼4 = 2 − 𝑐4 𝛽3 = 1.3530
1 1 0 0 5 0 0 0 1 0.4 0 0
then 𝐴 = 𝐿𝑈 → 2 −1 5 0 = 2 2.2 0 0 0 1 0.4545 0
0 3 −4 2 0 1 1.5455 0 0 0 1 −0.647
0 0 2 −4 0 0 −1 1.353 0 0 0 1
By using calculator:
5 0 0 0 𝑤1 16
1) Solve Lw = b, → 2 2.2 0 0 𝑤2 = 15 → 𝑤1 = 3.2000
𝑤2 = 3.9091
0 1 1.5455 0 𝑤3 4
Forward substitution 𝑤3 = 0.0588
0 0 −1 1.353 𝑤4 4
𝑤4 = 2.9999
By using calculator:
1 0.4 0 0 𝑥1 3.2 𝑥1 = 1.9999
2) Solve Ux = w, → 0 1 0.4545 0 𝑥2 = 3.9091 → 𝑥2 = 3.0002
0 0 1 −0.647 𝑥3 0.0588 𝑥3 = 1.9997
Backward substitution
0 0 0 1 𝑥4 2.9999 𝑥4 = 2.9999
EXACT SOLUTION: x = (2 , 3 , 2 , 3)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
5 2 0 0 𝑥1 16
17. b) Ax = b → 2 3 1 0 𝑥2 = 15
0 1 2 −1 𝑥3 4
0 0 −1 2 𝑥4 4
𝛼1 = 𝑑1
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1 , 𝑖 = 2 ,3 ,…,𝑛
𝑒𝑖
𝛽𝑖 = , 𝑖 = 1 ,2 ,3 ,…,𝑛 − 1
𝛼𝑖
𝑏1
𝑤1 =
𝛼1
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖 , 𝑖 = 2 ,3 ,…,𝑛
𝑥𝑛 = 𝑤𝑛
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1 , 𝑖 = 𝑛 − 1 ,𝑛 − 2 ,…,1
𝑖 1 2 3 4
𝑑𝑖 5 3 2 2
𝑒𝑖 2 1 −1 0
𝑐𝑖 0 2 1 −1
𝑏𝑖 16 15 4 4
(𝛼1 = 𝑑1 )
5 2.2 1.5455 1.353
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1
(𝑤1 = 𝑏1 /𝛼1 )
3.2 3.9091 0.0588 2.9999
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖
𝑥4 = 𝑤4
1.9999 3.0002 1.9997 2.9999
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1
EXACT SOLUTION: x = (2 , 3 , 2 , 3)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥1
Ax = b → 𝑥2 =
𝑥3
𝑑1 𝑒1 0 𝛼1 0 0 1 𝛽1 0
𝐴 = 𝐿𝑈 → 𝑐2 𝑑2 𝑒2 = 𝑐2 𝛼2 0 0 1 𝛽2
0 𝑐3 𝑑3 0 𝑐3 𝛼3 0 0 1
𝛼1 𝛼1 𝛽1 0
= 𝑐2 𝑐2 𝛽1 + 𝛼2 𝛼2 𝛽2
0 𝑐3 𝑐3 𝛽2 + 𝛼3
we obtain
𝛼1 = 𝑑1
𝑒1
𝛼1 𝛽1 = 𝑒1 → 𝛽1 = =
𝛼1
𝑐2 𝛽1 + 𝛼2 = 𝑑2 → 𝛼2 = 𝑑2 − 𝑐2 𝛽1 =
𝑒2
𝛼2 𝛽2 = 𝑒2 → 𝛽2 = =
𝛼2
𝑐3 𝛽2 + 𝛼3 = 𝑑3 → 𝛼3 = 𝑑3 − 𝑐3 𝛽2 =
𝑑1 𝑒1 0 𝛼1 0 0 1 𝛽1 0
then 𝐴 = 𝐿𝑈 → 𝑐2 𝑑2 𝑒2 = 𝑐2 𝛼2 0 0 1 𝛽2
0 𝑐3 𝑑3 0 𝑐3 𝛼3 0 0 1
𝑤1 By using calculator:
1) Solve Lw = b, → 𝑤2 = → 𝑤1 =
Forward substitution
𝑤3 𝑤2 =
𝑤3 =
𝑥1 By using calculator:
2) Solve Ux = w, → 𝑥2 = → 𝑥1 =
Backward substitution
𝑥3 𝑥2 =
𝑥3 =
Solution: 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥1
Ax = b → 𝑥2 =
𝑥3
𝛼1 = 𝑑1
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1 , 𝑖 = 2 ,3 ,…,𝑛
𝑒𝑖
𝛽𝑖 = , 𝑖 = 1 ,2 ,3 ,…,𝑛 − 1
𝛼𝑖
𝑏1
𝑤1 =
𝛼1
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖 , 𝑖 = 2 ,3 ,…,𝑛
𝑥𝑛 = 𝑤𝑛
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1 , 𝑖 = 𝑛 − 1 ,𝑛 − 2 ,…,1
𝑖 1 2 3 4
𝑑𝑖 Type equation here. Type equation here. Type equation here. Type equation here.
𝑒𝑖 Type equation here. Type equation here. Type equation here. Type equation here.
𝑐𝑖 Type equation here. Type equation here. Type equation here. Type equation here.
Type equation here. Type equation here. Type equation here. Type equation here.
𝑏𝑖
(𝛼1 = 𝑑1 )
Type equation here. Type equation here. Type equation here. Type equation here.
𝛼𝑖 = 𝑑𝑖 − 𝑐𝑖 𝛽𝑖−1
𝛽𝑖 = 𝑒𝑖 /𝛼𝑖 Type equation here. Type equation here. Type equation here. Type equation here.
(𝑤1 = 𝑏1 /𝛼1 )
Type equation here. Type equation here. Type equation here. Type equation here.
𝑤𝑖 = (𝑏𝑖 − 𝑐𝑖 𝑤𝑖−1 )/𝛼𝑖
𝑥𝑛 = 𝑤𝑛
Type equation here. Type equation here. Type equation here. Type equation here.
𝑥𝑖 = 𝑤𝑖 − 𝛽𝑖 𝑥𝑖+1
Solution: 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
ITERATIVE METHOD
***Exercise 2.3
Solve the following linear system using :
(a) Jacobi iterative method
(b) Gauss-Seidel iterative method
With initial guess 𝐱 (0) = 𝟎. Shown the calculation in 3DP and let ε = 0.005. if possible,
rearrange the given system of linear equations into strictly diagonally dominant system to
ensure the method is convergence.
(Note: Stop after 10 iteration if the method still not converge)
(9)
‖𝐱 (9) − 𝐱 (8) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖(8) |}
1≤𝑖≤3
= max {|𝑥19 − 𝑥18 | , |𝑥29 − 𝑥28 | , |𝑥39 − 𝑥38 |}
( ) ( ) ( ) ( ) ( ) ( )
5
( ) 4 ( )
‖𝐱 (5) − 𝐱 (4) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥15 − 𝑥14 | , |𝑥25 − 𝑥24 | , |𝑥35 − 𝑥34 |}
( ) ( ) ( ) ( ) ( ) ( )
6( ) 5 ( )
‖𝐱 (6) − 𝐱 (5) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
(6) (5) (6) (5) (6) (5)
= max {|𝑥1 − 𝑥1 | , |𝑥2 − 𝑥2 | , |𝑥3 − 𝑥3 |}
= max{0.000 , 0.002 , 0.000}
= 0.002 < ε = 0.005
(6)
𝐱≈𝐱 = (𝟐. 𝟗𝟗𝟗 , 𝟓. 𝟎𝟎𝟎 , 𝟐. 𝟗𝟗𝟖)
SOLUTION → 𝑥1 = 2.999 𝑥2 = 5.000 𝑥3 = 2998
MUHAMMAD MUSA BIN YUSOF
A17KA0105
4
( ) 3 ( )
‖𝐱 (4) − 𝐱 (3) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
(4) (3) (4) (3) (4) (3)
= max {|𝑥1 − 𝑥1 | , |𝑥2 − 𝑥2 | , |𝑥3 − 𝑥3 |}
= max{0.003 , 0.002 , 0.000}
= 0.003 < ε = 0.005
𝐱 ≈ 𝐱 (4) = (𝟑. 𝟎𝟎𝟎 , 𝟓. 𝟎𝟎𝟎 , 𝟑. 𝟎𝟎𝟎)
SOLUTION → 𝑥1 = 3.000 𝑥2 = 5.000 𝑥3 = 3.000
MUHAMMAD MUSA BIN YUSOF
A17KA0105
9( ) 8 ( )
‖𝐱 (9) − 𝐱 (8) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥19 − 𝑥18 | , |𝑥29 − 𝑥28 | , |𝑥39 − 𝑥38 |}
( ) ( ) ( ) ( ) ( ) ( )
7( ) 6 ( )
‖𝐱 (7) − 𝐱 (6) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥17 − 𝑥16 | , |𝑥27 − 𝑥26 | , |𝑥37 − 𝑥36 |}
( ) ( ) ( ) ( ) ( ) ( )
5
( ) 4 ( )
‖𝐱 (5) − 𝐱 (4) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥15 − 𝑥14 | , |𝑥25 − 𝑥24 | , |𝑥35 − 𝑥34 |}
( ) ( ) ( ) ( ) ( ) ( )
5( ) 4 ( )
‖𝐱 (5) − 𝐱 (4) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
(5) (4) (5) (4) (5) (4)
= max {|𝑥1 − 𝑥1 | , |𝑥2 − 𝑥2 | , |𝑥3 − 𝑥3 |}
= max{0.004 , 0.001 , 0.001}
= 0.004 < ε = 0.005
(5)
𝐱≈𝐱 = (𝟐. 𝟎𝟎𝟏 , 𝟐. 𝟎𝟎𝟏 , 𝟐. 𝟗𝟗𝟗)
SOLUTION → 𝑥1 = 2.001 𝑥2 = 2.001 𝑥3 = 2.999
MUHAMMAD MUSA BIN YUSOF
A17KA0105
5( ) 4 ( )
‖𝐱 (5) − 𝐱 (4) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥15 − 𝑥14 | , |𝑥25 − 𝑥24 | , |𝑥35 − 𝑥34 |}
( ) ( ) ( ) ( ) ( ) ( )
7. Solve the following linear system using Gauss-Seidel method starting 𝐱 (0) = 𝟎.
𝑅 3 4 𝑥1 21 | | > | |+| |
Ax = b → 1 2𝑅 −1 𝑥2 = 9 | | > | |+| | *no need to rearrange
2 −1 𝑅 𝑥3 18 | | > | |+| |
Compare the number of iteration to obtain the solution if
a) R = 10
b) R = 100
Show the calculation in 4DP and let ε = 0.0005
6( ) 5 ( )
‖𝐱 (6) − 𝐱 (5) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥16 − 𝑥15 | , |𝑥26 − 𝑥25 | , |𝑥36 − 𝑥35 |}
( ) ( ) ( ) ( ) ( ) ( )
𝐍𝐔𝐌𝐁𝐄𝐑 𝐎𝐅 𝐈𝐓𝐄𝐑𝐀𝐓𝐈𝐎𝐍 = 𝟔
MUHAMMAD MUSA BIN YUSOF
A17KA0105
3 2
( ) ( )
‖𝐱 (3) − 𝐱 (2) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥13 − 𝑥12 | , |𝑥23 − 𝑥22 | , |𝑥33 − 𝑥32 |}
( ) ( ) ( ) ( ) ( ) ( )
𝐍𝐔𝐌𝐁𝐄𝐑 𝐎𝐅 𝐈𝐓𝐄𝐑𝐀𝐓𝐈𝐎𝐍 = 𝟑
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥1 | | > | |+| |
Ax = b → 𝑥2 = | | > | |+| | *no need to rearrange
𝑥3 | | > | |+| |
𝑘 ( ) 𝑘−1 ( )
‖𝐱 (𝑘) − 𝐱 (𝑘−1) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
(𝑘) (𝑘−1) (𝑘) (𝑘−1) (𝑘) (𝑘−1)
= max {|𝑥1 − 𝑥1 | , |𝑥2 − 𝑥2 | , |𝑥3 − 𝑥3 |}
= max{ }
=< ε = 0.005
(𝑘)
𝐱≈𝐱 =( )
SOLUTION → 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥1 | | > | |+| |
Ax = b → 𝑥2 = | | > | |+| | *no need to rearrange
𝑥3 | | > | |+| |
𝑘 ( ) 𝑘−1 ( )
‖𝐱 (𝑘) − 𝐱 (𝑘−1) ‖∞ = max {|𝑥𝑖 − 𝑥𝑖 |}
1≤𝑖≤3
= max {|𝑥1𝑘 − 𝑥1𝑘−1 | , |𝑥2𝑘 − 𝑥2𝑘−1 | , |𝑥3𝑘 − 𝑥3𝑘−1 |}
( ) ( ) ( ) ( ) ( ) ( )
= max{ }
=< ε = 0.005
(𝑘)
𝐱≈𝐱 =( )
SOLUTION → 𝑥1 = 𝑥2 = 𝑥3 =
MUHAMMAD MUSA BIN YUSOF
A17KA0105
LAGRANGE INTERPOLATION
***Exercise 3.1
For the question 1 – 10, using Lagrange Interpolation approximate the value of:
1. 𝑓(2) if 𝑖 0 1 2
𝑥𝑖 0 1 3
𝑦𝑖 = 𝑓(𝑥𝑖 ) 0 1 0
1 1 1
Then : 𝑃2 (𝑥) = 3 (𝑥 − 1)(𝑥 − 3)(0) + (− 2) (𝑥)(𝑥 − 3)(1) + 6 (𝑥)(𝑥 − 1)(0)
1
= − 2 (𝑥)(𝑥 − 3)
When 𝒙 = 𝟐,
𝑃2 (2) = 1
Then : 𝑓(2) = 𝑃2 (2) = 1
2. 𝑓(3) if 𝑖 0 1 2
𝑥𝑖 0 1 4
𝑦𝑖 = 𝑓(𝑥𝑖 ) 2 1 4
1 1 1
Then : 𝑃2 (𝑥) = 4 (𝑥 − 1)(𝑥 − 4)(2) + (− 3) (𝑥)(𝑥 − 4)(1) + 12 (𝑥)(𝑥 − 1)(4)
1 1 1
= 2 (𝑥 − 1)(𝑥 − 4) + (− 3) (𝑥)(𝑥 − 4) + 3 (𝑥)(𝑥 − 1)
When 𝒙 = 𝟑,
𝑃2 (3) = 2
Then : 𝑓(3) = 𝑃2 (3) = 2
3. 𝑓(0.2) if 𝑖 0 1 2
𝑥𝑖 0.1 0.3 0.4
𝑦𝑖 = 𝑓(𝑥𝑖 ) 1.2314 1.9121 2.3855
1 1
Then : 𝑃2 (𝑥) = 0.06 (𝑥 − 0.3)(𝑥 − 0.4)(1.2314) + (− 0.02) (𝑥 − 0.1)(𝑥 − 0.4)(1.9121) +
1
(𝑥 − 0.1)(𝑥 − 0.3)(2.3855)
0.03
When 𝒙 = 𝟎. 𝟐,
𝑃2 (0.2) = 1.5274
Then : 𝑓(0.2) = 𝑃2 (0.2) = 1.5274
4. 𝑓(2.5) if 𝑖 0 1 2
𝑥𝑖 2.1 2.4 2.6
𝑦𝑖 = 𝑓(𝑥𝑖 ) 0.5208 0.5104 0.3813
1 1
Then : 𝑃2 (𝑥) = 0.15 (𝑥 − 2.4)(𝑥 − 2.6)(0.5208) + (− 0.06) (𝑥 − 2.1)(𝑥 − 2.6)(0.5104) +
1
(𝑥 − 2.1)(𝑥 − 2.4)(0.3813)
0.1
When 𝒙 = 𝟐. 𝟓,
𝑃2 (2.5) = 0.4581
Then : 𝑓(2.5) = 𝑃2 (2.5) = 0.4581
5. 𝑓(3) if 𝑖 0 1 2 3
𝑥𝑖 0 1 2 4
𝑦𝑖 = 𝑓(𝑥𝑖 ) 1 1 2 5
1 1
Then : 𝑃3 (𝑥) = − 8 (𝑥 − 1)(𝑥 − 2)(𝑥 − 4)(1) + 3 (𝑥)(𝑥 − 2)(𝑥 − 4)(1) +
1 1
(− ) (𝑥)(𝑥 − 1)(𝑥 − 4)(2) + (− ) (𝑥)(𝑥 − 1)(𝑥 − 2)(5)
4 12
When 𝒙 = 𝟑,
𝑃3 (3) = −1/4
Then : 𝑓(3) = 𝑃3 (3) = −1/4
6. 𝑓(3) if 𝑖 0 1 2 3
𝑓(5)
𝑥𝑖 0 2 4 6
𝑦𝑖 = 𝑓(𝑥𝑖 ) 1 -1 -1 -1
1 1
Then : 𝑃3 (𝑥) = − 48 (𝑥 − 2)(𝑥 − 4)(𝑥 − 6)(1) + 16 (𝑥)(𝑥 − 4)(𝑥 − 6)(−1) +
1 1
(− ) (𝑥)(𝑥 − 2)(𝑥 − 6)(−1) + (𝑥)(𝑥 − 2)(𝑥 − 4)(−1)
16 48
When 𝒙 = 𝟑,
𝑃3 (3) = −9/8
Then : 𝑓(3) = 𝑃3 (3) = −9/8
Or directly substitute the value x = 3 & x = 5 into
𝐿0 (𝑥) , 𝐿1 (𝑥) , 𝐿2 (𝑥), 𝐿3 (𝑥) to get 𝑃3 (3) & 𝑃3 (5)
When 𝒙 = 𝟓,
𝑃3 (5) = −7/8
Then : 𝑓(5) = 𝑃3 (5) = −7/8
MUHAMMAD MUSA BIN YUSOF
A17KA0105
1. 𝑓(2) if 𝑖 0 1 2
𝑥𝑖 0 1 3
𝑦𝑖 = 𝑓(𝑥𝑖 ) 0 1 0
2 3 0
When 𝒙 = 𝟐,
𝑃2 (2) = 1
Then : 𝑓(2) = 𝑃2 (2) = 1
Or directly substitute the value x = 2 into
𝑃2 (𝑥) to get 𝑃2 (2)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2. 𝑓(3) if 𝑖 0 1 2
𝑥𝑖 0 1 4
𝑦𝑖 = 𝑓(𝑥𝑖 ) 2 1 4
2 4 4
When 𝒙 = 𝟑,
𝑃2 (3) = 2
Then : 𝑓(3) = 𝑃2 (3) = 2
Or directly substitute the value x = 3 into
𝑃2 (𝑥) to get 𝑃2 (3)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
3. 𝑓(0.2) if 𝑖 0 1 2
𝑥𝑖 0.1 0.3 0.4
𝑦𝑖 = 𝑓(𝑥𝑖 ) 1.2314 1.9121 2.3855
2 0.4 2.3855
When 𝒙 = 𝟎. 𝟐,
𝑃2 (0.2) = 1.5274
Then : 𝑓(0.2) = 𝑃2 (0.2) = 1.5274
Or directly substitute the value x = 0.2 into
𝑃2 (𝑥) to get 𝑃2 (0.2)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
4. 𝑓(2.5) if 𝑖 0 1 2
𝑥𝑖 2.1 2.4 2.6
𝑦𝑖 = 𝑓(𝑥𝑖 ) 0.5208 0.5104 0.3813
2 2.6 0.3813
When 𝒙 = 𝟐. 𝟓,
𝑃2 (2.5) = 0.4581
Then : 𝑓(2.5) = 𝑃2 (2.5) = 0.4581
Or directly substitute the value x = 2.5 into
𝑃2 (𝑥) to get 𝑃2 (2.5)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
5. 𝑓(3) if 𝑖 0 1 2 3
𝑥𝑖 0 1 2 4
𝑦𝑖 = 𝑓(𝑥𝑖 ) 1 1 2 5
2−1 1.5 − 1 1
1 1 1 =1 =
2−1 4−1 6
5−2
2 2 2 = 1.5
4−2
3 4 5
When 𝒙 = 𝟑,
𝑃3 (3) = 7/2
Then : 𝑓(3) = 𝑃3 (3) = 7/2
Or directly substitute the value x = 3 into
𝑃3 (𝑥) to get 𝑃3 (3)
MUHAMMAD MUSA BIN YUSOF
A17KA0105
6. 𝑓(3) 𝑖 0 1 2 3
𝑓(5) if
𝑥𝑖 0 2 4 6
𝑦𝑖 = 𝑓(𝑥𝑖 ) 1 -1 -1 -1
−1 + 1 0−0
1 2 -1 =0 =0
4−2 6−2
−1 + 1
2 4 -1 =0
6−4
3 6 -1
When 𝒙 = 𝟑, When 𝒙 = 𝟓,
𝑃3 (3) = −9/8 𝑃3 (5) = −7/8
Then : 𝑓(3) = 𝑃3 (3) = −9/8 Then : 𝑓(5) = 𝑃3 (5) = −7/8
𝑓(𝑔) if 𝑖 0 1 2 3
𝑥𝑖 a b c d
𝑦𝑖 = 𝑓(𝑥𝑖 ) P Q R S
𝑅−𝑄 𝑢−𝑡
1 b Q =𝑡 =𝑤
𝑐−𝑏 𝑑−𝑏
𝑆−𝑅
2 c R =𝑢
𝑑−𝑐
3 d S
When 𝒙 = 𝒈,
𝑃𝑛 (𝑔) = _____
Then : 𝑓(𝑔) = 𝑃𝑛 (𝑔) = _____
a) Construct the forward difference table and show that the forward difference of
order four is zero
𝑖 𝑥𝑖 𝑦𝑖 ∆𝑦𝑖 ∆2 𝑦𝑖 ∆3 𝑦𝑖 ∆4 𝑦𝑖
2.7500 − 2.3280
3 0.4 2.3280
= 0.4220
4 0.5 2.7500
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑖 𝑥𝑖 𝑦𝑖 ∆𝑦𝑖 ∆2 𝑦𝑖 ∆3 𝑦𝑖
0.3957 − 0.1101
2 0.1 0.1101
= 0.2856
3 0.3 0.3957
Therefore,
0.5(0.5 − 1) 0.5(0.5 − 1)(0.5 − 2)
𝑃3 (−0.2) = −0.2043 + 0.5(0.1144) + (0.0856) + (0)
2! 3!
= −0.2043 + 0.0572 + (−0.0107) + 0
= −0.1578
𝑖 𝑥𝑖 𝑦𝑖 ∇𝑦𝑖 ∇2 𝑦𝑖 ∇3 𝑦𝑖
0 -0.3 -0.2043
−0.0899 + 0.2043
1 -0.1 -0.0899
= 0.1144
Therefore,
(−0.5)(−0.5 + 1) (−0.5)(−0.5 + 1)(−0.5 + 2)
𝑃3 (0.2) = 0.3957 + (−0.5)(0.2856) + (0.0856) + (0)
2! 3!
= 0.3957 + (−0.1428) + (−0.0107) + 0
= 0.2422
𝑖 𝑥𝑖 𝑦𝑖 ∆𝑦𝑖 ∆2 𝑦𝑖 ∆3 𝑦𝑖
0.6386 − 0.8080
2 0.6 0.8080
= −0.1694
3 0.8 0.6386
Therefore,
0.25(0.25 − 1) 0.25(0.25 − 1)(0.25 − 2)
𝑃3 (0.25) = 0.9799 + 0.25(−0.0621) + (−0.0477) + (−0.0119)
2! 3!
= 0.9799 + (−0.0155) + 0.0045 + (−0.0007)
= 0.9682
𝑖 𝑥𝑖 𝑦𝑖 ∇𝑦𝑖 ∇2 𝑦𝑖 ∇3 𝑦𝑖
0 0.2 0.9799
0.9178 − 0.9799
1 0.4 0.9178
= −0.0621
Therefore,
(−0.25)(−0.25 + 1)
𝑃3 (0.75) = 0.6386 + (−0.25)(−0.1694) + (−0.0596)
2!
(−0.25)(−0.25 + 1)(−0.25 + 2)
+ (−0.0119)
3!
= 0.6386 + 0.0424 + 0.0056 + 0.0007
= 0.6873
𝑖 𝑥𝑖 𝑦𝑖 ∆𝑦𝑖 ∆2 𝑦𝑖 ∆3 𝑦𝑖 ∆4 𝑦𝑖
2.2255 − 1.8221
3 0.6 1.8221
= 0.4034
4 0.8 2.2255
Therefore,
0.25(0.25 − 1) 0.25(0.25 − 1)(0.25 − 2)
𝑃4 (0.05) = 1 + 0.25(0.2214) + (0.049) + (0.0109)
2! 3!
0.25(0.25 − 1)(0.25 − 2)(0.25 − 3)
+ (0.0023)
4!
= 1 + 0.0554 + (−0.0046) + 0.0006 + (−0.0001)
= 1.0513
∴ 𝒇(𝟎. 𝟎𝟓) = 𝑷𝟒 (𝟎. 𝟎𝟓) = 𝟏. 𝟎𝟓𝟏𝟑
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑖 𝑥𝑖 𝑦𝑖 ∇𝑦𝑖 ∇2 𝑦𝑖 ∇3 𝑦𝑖 ∇4 𝑦𝑖
0 0.0 1.0000
1.2214 − 1.0000
1 0.2 1.2214
= 0.2214
Therefore,
(−0.75)(−0.75 + 1)
𝑃4 (0.65) = 2.2255 + (−0.75)(0.4034) + (0.0731)
2!
(−0.75)(−0.75 + 1)(−0.75 + 2)
+ (0.0132)
3!
(−0.75)(−0.75 + 1)(−0.75 + 2)(−0.75 + 3)
+ (0.0023)
4!
= 2.2255 + (−0.3026) + (−0.0069) + (−0.0005) + (−0.0001)
= 1.9154
𝑖 0 1 2 3 4
𝑥𝑖 a b c d e
𝑦𝑖 = 𝑓(𝑥𝑖 ) P Q R S T
𝑖 𝑥𝑖 𝑦𝑖 ∆𝑦𝑖 ∆2 𝑦𝑖 ∆3 𝑦𝑖 ∆4 𝑦𝑖
2 c R S–R=I J–I=M
3 d S T–S=J
4 e T
Therefore,
W(W − 1) W(W − 1)(W − 2) W(W − 1)(W − 2)(W − 3)
𝑃𝑛 (z) = P + W(G) + (K) + (N) + (V)
2! 3! 4!
= _____________
∴ 𝒇(𝒛) = 𝑷𝒏 (𝒛) = ________________
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑖 0 1 2 3 4
𝑥𝑖 a b c d e
𝑦𝑖 = 𝑓(𝑥𝑖 ) P Q R S T
𝑖 𝑥𝑖 𝑦𝑖 ∇𝑦𝑖 ∇2 𝑦𝑖 ∇3 𝑦𝑖 ∇4 𝑦𝑖
0 a P
1 b Q Q–P=G
2 c R R–Q=H H–G=K
Therefore,
W(W + 1) W(W + 1)(W + 2) W(W + 1)(W + 2)(W + 3)
𝑃𝑛 (z) = T + W(J) + (M) + (O) + (V)
2! 3! 4!
= _____________
LINEAR LEAST-SQUARES
***Exercise 4.1
For question 1 – 4, fit the given data using the least square line 𝑦 = 𝐴 + 𝐵𝑥. Calculate the sum
of the squares of errors, S. Shown calculation in four decimal places (4DP).
Let linear least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}5𝑖=0. The unknown A and B can
determine by solving the following linear system
5 5 5
∑1 ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝐴 𝑖=0
5 5 ( )= 5
𝐵
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖 𝑦𝑖
( 𝑖=0 𝑖=0 ) ( 𝑖=0 )
The various summations are evaluated in a tabular form as follow:
𝑖 𝑥𝑖 𝑦𝑖 𝑥𝑖2 𝑥𝑖 𝑦𝑖
0 1.0 1.5 1.0 1.5
1 2.1 3.2 4.41 6.72
2 3.2 3.5 10.24 11.2
3 4.3 3.0 18.49 12.9
4 5.2 3.5 27.04 18.2
5 6.0 4.2 36 25.2
5
Gives
6 21.8 𝐴 18.9
( )( ) = ( )
21.8 97.18 𝐵 75.72
Solve this linear system to get A = 1.7248 and B = 0.3922 𝒚(𝒙) = 𝟏. 𝟕𝟐𝟒𝟖 + 𝟎. 𝟑𝟗𝟐𝟐𝒙
The sum of square errors, S, is evaluated in a tabular form as follows.
𝑆 = ∑ 𝑒𝑖2 1.3298
𝑖=0
MUHAMMAD MUSA BIN YUSOF
A17KA0105
Let linear least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}5𝑖=0. The unknown A and B can
determine by solving the following linear system
5 5 5
∑1 ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝐴 𝑖=0
5 5 ( )= 5
𝐵
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖 𝑦𝑖
( 𝑖=0 𝑖=0 ) ( 𝑖=0 )
Using Calculator [Mode = Statistics] :-
5 5
∑1 = 6 ∑ 𝑥𝑖2 = 1.2911
5
𝑖=0 𝑖=0
∑ 𝑥𝑖 𝑦𝑖 = 2.7402
5 5
𝑖=0
∑ 𝑥𝑖 = 2.31 ∑ 𝑦𝑖 = 6.704
𝑖=0 𝑖=0
6 2.31 𝐴 6.704
( )( ) = ( )
2.31 1.2911 𝐵 2.7402
Solve this linear system to get A = 0.9649 and B = 0.3960 𝒚(𝒙) = 𝟎. 𝟗𝟔𝟒𝟗 + 𝟎. 𝟑𝟗𝟔𝟎𝒙
The sum of square errors, S, is evaluated in a tabular form as follows.
𝑆 = ∑ 𝑒𝑖2 0.0055
𝑖=0
Let linear least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}6𝑖=0. The unknown A and B can
determine by solving the following linear system
6 6 6
∑1 ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝐴 𝑖=0
6 6 ( )= 6
𝐵
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖 𝑦𝑖
( 𝑖=0 𝑖=0 ) ( 𝑖=0 )
Using Calculator [Mode = Statistics] :-
6 6
∑1 = 7 ∑ 𝑥𝑖2 = 171.33
6
𝑖=0 𝑖=0
∑ 𝑥𝑖 𝑦𝑖 = 502.874
6 6
𝑖=0
∑ 𝑥𝑖 = 34.3 ∑ 𝑦𝑖 = 99.02
𝑖=0 𝑖=0
7 34.3 𝐴 99.02
( )( ) = ( )
34.3 171.33 𝐵 502.874
Solve this linear system to get A = - 12.4225 and B = 5.4221 𝒚(𝒙) = −𝟏𝟐. 𝟒𝟐𝟐𝟓 + 𝟓. 𝟒𝟐𝟐𝟏𝒙
The sum of square errors, S, is evaluated in a tabular form as follows.
𝑆 = ∑ 𝑒𝑖2 23.7721
𝑖=0
Let linear least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}7𝑖=0. The unknown A and B can
determine by solving the following linear system
7 7 7
∑1 ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝐴 𝑖=0
7 7 ( )= 7
𝐵
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖 𝑦𝑖
( 𝑖=0 𝑖=0 ) ( 𝑖=0 )
∑1 = 8 ∑ 𝑥𝑖2 = 8.41
7
𝑖=0 𝑖=0
∑ 𝑥𝑖 𝑦𝑖 = 105.313
7 7
𝑖=0
∑ 𝑥𝑖 = 7.3 ∑ 𝑦𝑖 = 93.8
𝑖=0 𝑖=0
8 7.3 𝐴 93.8
( )( ) = ( )
7.3 8.41 𝐵 105.313
Solve this linear system to get A = 1.4348 and B = 11.2769 𝒚(𝒙) = 𝟏. 𝟒𝟑𝟒𝟖 + 𝟏𝟏. 𝟐𝟕𝟔𝟗𝒙
The sum of square errors, S, is evaluated in a tabular form as follows.
𝑖 𝑥𝑖 𝑦𝑖 𝑦(𝑥𝑖 ) 𝑒𝑖 = 𝑦𝑖 − 𝑦(𝑥𝑖 ) 𝑒𝑖2 = (𝑦𝑖 − 𝑦(𝑥𝑖 ))2
0 0.2 5.04 3.6902 1.3498 1.8220
1 0.3 6.83 4.8179 2.0121 4.0485
2 0.6 4.34 8.2009 -3.8609 14.9065
3 0.9 10.25 11.5840 -1.3340 1.7796
4 1.1 13.96 13.8394 0.1206 0.0145
5 1.3 15.76 16.0948 -0.3348 0.1121
6 1.4 18.47 17.2225 1.2475 1.5563
7 1.5 19.15 18.3502 0.7998 0.6397
7
𝑆 = ∑ 𝑒𝑖2 24.8792
𝑖=0
𝑥
𝑦
Let linear least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}𝑛𝑖=0. The unknown A and B can
determine by solving the following linear system
n n n
∑1 ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝐴 𝑖=0
n n ( )= n
𝐵
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖 𝑦𝑖
( 𝑖=0 𝑖=0 ) ( 𝑖=0 )
Using Calculator [Mode = Statistics] :-
n n
∑1 = ∑ 𝑥𝑖2 =
n
𝑖=0 𝑖=0
∑ 𝑥𝑖 𝑦𝑖 =
n n
𝑖=0
∑ 𝑥𝑖 = ∑ 𝑦𝑖 =
𝑖=0 𝑖=0
𝐴
( )( ) = ( )
𝐵
Solve this linear system to get A = ______ and B = ______ 𝒚(𝒙) = 𝑨 + 𝑩𝒙
The sum of square errors, S, is evaluated in a tabular form as follows.
𝑖 𝑥𝑖 𝑦𝑖 𝑦(𝑥𝑖 ) 𝑒𝑖 = 𝑦𝑖 − 𝑦(𝑥𝑖 ) 𝑒𝑖2 = (𝑦𝑖 − 𝑦(𝑥𝑖 ))2
0
1
2
3
4
5
6
7
𝑛
𝑆 = ∑ 𝑒𝑖2
𝑖=0
QUADRATIC LEAST-SQUARES
***Exercise 4.2
For question 1 – 4, fit the given data using the parabolic least square, 𝑦 = 𝐴 + 𝐵𝑥 + 𝐶𝑥 2 .
Calculate the sum of the squares of errors. Shown calculation in four decimal places (4DP).
Let quadratic least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}5𝑖=0. The unknown A, B and C
can determine by solving
5 5 5 5
∑1 ∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝑖=0
5 5 5 𝐴 5
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖3 (𝐵 ) = ∑ 𝑥𝑖 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝐶 𝑖=0
5 5 5 5
𝑆 = ∑ 𝑒𝑖2 1.1134
𝑖=0
MUHAMMAD MUSA BIN YUSOF
A17KA0105
Let quadratic least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}5𝑖=0. The unknown A, B and C
can determine by solving
5 5 5 5
∑1 ∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝑖=0
5 5 5 𝐴 5
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖3 (𝐵 ) = ∑ 𝑥𝑖 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝐶 𝑖=0
5 5 5 5
𝑆 = ∑ 𝑒𝑖2 0.0044
𝑖=0
Let quadratic least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}6𝑖=0. The unknown A, B and C
can determine by solving
6 6 6 6
∑1 ∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝑖=0
6 6 6 𝐴 6
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖3 (𝐵 ) = ∑ 𝑥𝑖 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝐶 𝑖=0
6 6 6 6
𝑆 = ∑ 𝑒𝑖2 19.7249
𝑖=0
Let quadratic least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}7𝑖=0. The unknown A, B and C
can determine by solving
7 7 7 7
∑1 ∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝑖=0
7 7 7 𝐴 7
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖3 (𝐵 ) = ∑ 𝑥𝑖 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝐶 𝑖=0
7 7 7 7
𝑆 = ∑ 𝑒𝑖2 11.7625
𝑖=0
𝑥
𝑦
Let linear least square as 𝑦 = 𝐴 + 𝐵𝑥 to the data {(𝑥𝑖 , 𝑦𝑖 )}𝑛𝑖=0. The unknown A and B can
determine by solving the following linear system
n n n n
∑1 ∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝑖=0
n n n n
𝐴
∑ 𝑥𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖3 (𝐵 ) = ∑ 𝑥𝑖 𝑦𝑖
𝑖=0 𝑖=0 𝑖=0 𝐶 𝑖=0
n n n n
∑1 = ∑ 𝑥𝑖2 = ∑ 𝑥𝑖4 = ∑ 𝑥𝑖 𝑦𝑖 =
𝑖=0 𝑖=0 𝑖=0 𝑖=0
n n n n
∑ 𝑥𝑖 = ∑ 𝑥𝑖3 = ∑ 𝑦𝑖 = ∑ 𝑥𝑖2 𝑦𝑖 =
𝑖=0 𝑖=0 𝑖=0 𝑖=0
𝐴
( ) (𝐵 ) = ( )
𝐶
Solve this linear system to get A = _________ and B = _________ and C = __________
𝒚(𝒙) = 𝑨 + 𝑩𝒙 + 𝑪𝒙𝟐
The sum of square errors, S, is evaluated in a tabular form as follows.
𝑆 = ∑ 𝑒𝑖2
𝑖=0
FIRST DERIVATIVE
Two Point Forward Difference Formula
𝑓(𝑥 + ℎ) − 𝑓(𝑥)
𝑓 ′ (𝑥) =
ℎ
Two Point Central Difference Formula / Three Point Central Difference Formula
𝑓(𝑥 + ℎ) − 𝑓(𝑥 − ℎ)
𝑓 ′ (𝑥) =
2ℎ
SECOND DERIVATIVE
Three Point Central Difference Formula
1
𝑓 ′′ (𝑥) = [𝑓(𝑥 + ℎ) − 2𝑓(𝑥) + 𝑓(𝑥 − ℎ)]
ℎ2
***Exercise 5
1. If 𝑓(𝑥) = 𝑒 𝑥 , approximate 𝑓 ′ (2.3) using the following formula with ℎ = 0.1 and ℎ = 0.01.
𝑓(𝑥 + ℎ) − 𝑓(𝑥)
𝑓 ′ (𝑥) =
ℎ
′ (2.3)
𝑓(2.3 + 0.1) − 𝑓(2.3) 𝑒 2.4 − 𝑒 2.3
ℎ = 0.1 → 𝑓 = = = 10.4899
0.1 0.1
′ (2.3)
𝑓(2.3 + 0.01) − 𝑓(2.3) 𝑒 2.31 − 𝑒 2.3
ℎ = 0.01 → 𝑓 = = = 10.0242
0.01 0.01
𝑓(𝑥) − 𝑓(𝑥 − ℎ)
𝑓 ′ (𝑥) =
ℎ
′ (2.3)
𝑓(2.3) − 𝑓(2.3 − 0.1) 𝑒 2.3 − 𝑒 2.2
ℎ = 0.1 → 𝑓 = = = 9.4917
0.1 0.1
′ (2.3)
𝑓(2.3) − 𝑓(2.3 − 0.01) 𝑒 2.3 − 𝑒 2.29
ℎ = 0.01 → 𝑓 = = = 9.9245
0.01 0.01
𝑓(𝑥 + ℎ) − 𝑓(𝑥 − ℎ)
𝑓 ′ (𝑥) =
2ℎ
′ (2.3)
𝑓(2.3 + 0.1) − 𝑓(2.3 − 0.1) 𝑒 2.4 − 𝑒 2.2
ℎ = 0.1 → 𝑓 = = = 9.9908
2(0.1) 0.2
𝑓(2.3 + 0.01) − 𝑓(2.3 − 0.01) 𝑒 2.31 − 𝑒 2.29
ℎ = 0.01 → 𝑓 ′ (2.3) = = = 9.9743
2(0.01) 0.02
(a)
𝑥 −0.3 −0.1 0.1 0.3
𝑓(𝑥) −0.2043 −0.0899 0.1101 0.3957
𝑓 ′ (𝑥) 0.5720 0.7860 1.2140 1.4280
(b)
𝑥 1.1 1.2 1.3 1.4
𝑓(𝑥) 0.4860 0.8616 1.5975 3.7616
𝑓 ′ (𝑥) 3.7560 5.5575 14.5000 21.6410
Approximate :
(a) 𝑓 ′ (0.6) → using equation 1 to 6
𝑓(𝑥 + ℎ) − 𝑓(𝑥)
𝑓 ′ (𝑥) =
ℎ
𝑓(0.8) − 𝑓(0.6)
=
0.2
= −0.8470
𝑓(𝑥) − 𝑓(𝑥 − ℎ)
𝑓 ′ (𝑥) =
ℎ
𝑓(0.6) − 𝑓(0.4)
=
0.2
= −0.5490
𝑓(𝑥 + ℎ) − 𝑓(𝑥 − ℎ)
𝑓 ′ (𝑥) =
2ℎ
𝑓(0.8) − 𝑓(0.4)
=
0.4
= −0.6980
1
𝑓 ′ (𝑥) = [−𝑓(𝑥 + 2ℎ) + 4𝑓(𝑥 + ℎ) − 3𝑓(𝑥)]
2ℎ
1
= [−𝑓(1) + 4𝑓(0.8) − 3𝑓(0.6)]
0.4
= −0.6350
1
𝑓 ′ (𝑥) = [3𝑓(𝑥) − 4𝑓(𝑥 − ℎ) + 𝑓(𝑥 − 2ℎ)]
2ℎ
1
= [3𝑓(0.6) − 4𝑓(0.4) + 𝑓(0.2)]
0.4
= −0.6683
1
𝑓 ′ (𝑥) = [−𝑓(𝑥 + 2ℎ) + 8𝑓(𝑥 + ℎ) − 8𝑓(𝑥 − ℎ) + 𝑓(𝑥 − 2ℎ)]
12ℎ
1
= [−𝑓(1) + 8𝑓(0.8) − 8𝑓(0.4) + 𝑓(0.2)]
12ℎ
= −0.6825
1
𝑓 ′′ (𝑥) = [𝑓(𝑥 + ℎ) − 2𝑓(𝑥) + 𝑓(𝑥 − ℎ)]
ℎ2
1
= [𝑓(0.8) − 2𝑓(0.6) + 𝑓(0.4)]
0.04
= −1.4900
MUHAMMAD MUSA BIN YUSOF
A17KA0105
4. Given
𝑒 −𝑥
𝑓(𝑥) =
√1 + sin(x)
𝑓(0.4) = 0.5687
𝑓(0.5) = 0.4987
𝑓(0.6) = 0.4387
𝑓(0.7) = 0.3873
𝑓(0.8) = 0.3429
MUHAMMAD MUSA BIN YUSOF
A17KA0105
Approximate :
(a) 𝑓 ′ (0.6) → using equation 1 to 6
𝑏
ℎ
∫ 𝑓(𝑥) 𝑑𝑥 = [(𝑓 + 𝑓𝑛 ) + 2(𝑓1 + 𝑓2 + ⋯ + 𝑓𝑛−1 )]
𝑎 2 0
𝑏−𝑎
Where , ℎ=
𝑛
𝑏
ℎ
∫ 𝑓(𝑥) 𝑑𝑥 = [(𝑓 + 𝑓𝑛 ) + 4(𝑓1 + 𝑓3 + ⋯ + 𝑓𝑛−1 ) + 2(𝑓2 + 𝑓4 + ⋯ + 𝑓𝑛−2 )]
𝑎 3 0
𝑏−𝑎
Where , ℎ=
𝑛
MUHAMMAD MUSA BIN YUSOF
A17KA0105
***Exercise 6.1
1.
3
Approximate the following integral ∫ √𝑥 3 + 1 𝑑𝑥 using the rules below
0
𝑏−𝑎 3−0
𝑓(𝑥) = √𝑥 3 + 1 ℎ= = = 0.3750
𝑛 8
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √𝑥𝑖3 + 1
0 0.000 1.0000
1 0.375 1.0260
2 0.750 1.1924
3 1.125 1.5569
4 1.500 2.0917
5 1.875 2.7553
6 2.250 3.5200
7 2.625 4.3690
8 3.000 5.2915
3
𝐼 = ∫ √𝑥 3 + 1 𝑑𝑥
0
3
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 )]
2 0
0.375
= [6.2915 + 2(16.5113)]
2
= 7.3714
MUHAMMAD MUSA BIN YUSOF
A17KA0105
F = √X 3 + 1
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √𝑥𝑖3 + 1
0 0.000 1.0000
1 0.375 1.0260
2 0.750 1.1924
3 1.125 1.5569
4 1.500 2.0917
5 1.875 2.7553
6 2.250 3.5200
7 2.625 4.3690
8 3.000 5.2915
3
𝐼 = ∫ √𝑥 3 + 1 𝑑𝑥
0
3
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.375
= [9.4765 + 4(9.7072) + 2(6.8041)]
3
= 7.3411
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2.
3
1
Approximate the following integral ∫ 𝑑𝑥 using the rules below
0 √𝑥 3 + 1
1 𝑏−𝑎 3−0
𝑓(𝑥) = 𝑛= = = 10
√𝑥 3 + 1 ℎ 0.3
1
𝑓𝑖 = 𝑓(𝑥𝑖 ) =
𝑖 𝑥𝑖
√𝑥𝑖3 + 1
0 0.0 1.0000
1 0.3 0.9868
2 0.6 0.9068
3 0.9 0.7605
4 1.2 0.6054
5 1.5 0.4781
6 1.8 0.3826
7 2.1 0.3122
8 2.4 0.2597
9 2.7 0.2199
10 3.0 0.1890
3
1
𝐼=∫ 𝑑𝑥
0 √𝑥 3 + 1
3
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 + 𝑓8 + 𝑓9 )]
2 0
0.3
= [1.1890 + 2(4.9120)]
2
= 1.6520
MUHAMMAD MUSA BIN YUSOF
A17KA0105
1
F=
√X 3 + 1
1
𝑓𝑖 = 𝑓(𝑥𝑖 ) =
𝑖 𝑥𝑖
√𝑥𝑖3 + 1
0 0.0 1.0000
1 0.3 0.9868
2 0.6 0.9068
3 0.9 0.7605
4 1.2 0.6054
5 1.5 0.4781
6 1.8 0.3826
7 2.1 0.3122
8 2.4 0.2597
9 2.7 0.2199
10 3.0 0.1890
3
1
𝐼=∫ 𝑑𝑥
0 √𝑥 3 + 1
3
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 + 𝑓9 ) + 2(𝑓2 + 𝑓4 + 𝑓6 + 𝑓8 )]
3 0
0.3
= [1.1890 + 4(2.7575) + 2(2.1545)]
3
= 1.6528
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
𝑒 −𝑡 𝑏−𝑎 2−0
𝑓(𝑡) = ℎ= = = 0.25
√𝜋 𝑛 8
2
𝑒 −𝑡𝑖
𝑖 𝑡𝑖 𝑓𝑖 = 𝑓(𝑡𝑖 ) =
√𝜋
0 0.00 0.5642
1 0.25 0.5300
2 0.50 0.4394
3 0.75 0.3215
4 1.00 0.2076
5 1.25 0.1183
6 1.50 0.0595
7 1.75 0.0264
8 2.00 0.0103
2
1 2
𝐼= ∫ 𝑒 −𝑡 𝑑𝑡
√𝜋 0
2
= ∫ 𝑓(𝑡) 𝑑𝑡
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 )]
2 0
0.25
= [0.5745 + 2(1.7027)]
2
= 0.4975
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
𝑒 −T
F=
√𝜋
2
𝑒 −𝑡𝑖
𝑖 𝑡𝑖 𝑓𝑖 = 𝑓(𝑡𝑖 ) =
√𝜋
0 0.00 0.5642
1 0.25 0.5300
2 0.50 0.4394
3 0.75 0.3215
4 1.00 0.2076
5 1.25 0.1183
6 1.50 0.0595
7 1.75 0.0264
8 2.00 0.0103
2
1 2
𝐼= ∫ 𝑒 −𝑡 𝑑𝑡
√𝜋 0
2
= ∫ 𝑓(𝑡) 𝑑𝑡
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.25
= [0.5745 + 4(0.9962) + 2(0.7065)]
3
= 0.4977
MUHAMMAD MUSA BIN YUSOF
A17KA0105
1 𝑏−𝑎 1−0
𝑓(𝑡) = ℎ= = = 0.1
√1 − sin2 (𝑡) 𝑛 10
1
𝑖 𝑡𝑖 𝑓𝑖 = 𝑓(𝑡𝑖 ) =
√1 − sin2 (𝑡𝑖 )
0 0.0 1.0000
1 0.1 1.0050
2 0.2 1.0203
3 0.3 1.0468
4 0.4 1.0857
5 0.5 1.1395
6 0.6 1.2116
7 0.7 1.3075
8 0.8 1.4353
9 0.9 1.6087
10 1.0 1.8508
1
1
𝐼=∫ 𝑑𝑡
0 √1 − sin2 (𝑡)
1
= ∫ 𝑓(𝑡) 𝑑𝑡
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 + 𝑓8 + 𝑓9 )]
2 0
0.1
= [2.8508 + 2(10.8604)]
2
= 1.2286
MUHAMMAD MUSA BIN YUSOF
A17KA0105
1
F=
√1 − sin2 (𝑇)
1
𝑖 𝑡𝑖 𝑓𝑖 = 𝑓(𝑡𝑖 ) =
√1 − sin2 (𝑡𝑖 )
0 0.0 1.0000
1 0.1 1.0050
2 0.2 1.0203
3 0.3 1.0468
4 0.4 1.0857
5 0.5 1.1395
6 0.6 1.2116
7 0.7 1.3075
8 0.8 1.4353
9 0.9 1.6087
10 1.0 1.8508
1
1
𝐼=∫ 𝑑𝑡
0 √1 − sin2 (𝑡)
1
= ∫ 𝑓(𝑡) 𝑑𝑡
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 + 𝑓9 ) + 2(𝑓2 + 𝑓4 + 𝑓6 + 𝑓8 )]
3 0
0.1
= [2.8508 + 4(6.1075) + 2(4.7529)]
3
= 1.2262
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑏−𝑎 1−0
𝑓(𝑡) = √1 − sin2 (𝑡) 𝑛= = = 10
ℎ 0.1
0 0.0 1.0000
1 0.1 0.9950
2 0.2 0.9801
3 0.3 0.9553
4 0.4 0.9211
5 0.5 0.8776
6 0.6 0.8253
7 0.7 0.7648
8 0.8 0.6967
9 0.9 0.6216
10 1.0 0.5403
1
𝐼 = ∫ √1 − sin2 (𝑡) 𝑑𝑡
0
1
= ∫ 𝑓(𝑡) 𝑑𝑡
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 + 𝑓8 + 𝑓9 )]
2 0
0.1
= [1.5403 + 2(7.6375)]
2
= 0.8408
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑏−𝑎 1−0
𝑓(𝑡) = √1 − sin2 (𝑡) 𝑛= = =8
ℎ 0.125
F = √1 − sin2 (𝑇)
0 0.000 1.0000
1 0.125 0.9922
2 0.250 0.9689
3 0.375 0.9305
4 0.500 0.8776
5 0.625 0.8110
6 0.750 0.7317
7 0.875 0.6410
8 1.000 0.5403
1
𝐼 = ∫ √1 − sin2 (𝑡) 𝑑𝑡
0
1
= ∫ 𝑓(𝑡) 𝑑𝑡
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.125
= [1.5403 + 4(3.3747) + 2(2.5782)]
3
= 0.8415
MUHAMMAD MUSA BIN YUSOF
A17KA0105
6. Approximate the arc length of the curve described by the function 𝑦 = 𝑥 3 , 0 < 𝑥 < 2 , the
length is given by
2
∫ √1 + 9𝑥 4 𝑑𝑥
0
𝑏−𝑎 2−0
𝑓(𝑥) = √1 + 9𝑥 4 ℎ= = = 0.25
𝑛 8
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √1 + 9𝑥𝑖4
0 0.00 1.0000
1 0.25 1.0174
2 0.50 1.2500
3 0.75 1.9615
4 1.00 3.1623
5 1.25 4.7930
6 1.50 6.8237
7 1.75 9.2418
8 2.00 12.0416
2
𝐼 = ∫ √1 + 9𝑥 4 𝑑𝑥
0
2
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 )]
2 0
0.25
= [13.0416 + 2(28.2497)]
2
= 8.6926
MUHAMMAD MUSA BIN YUSOF
A17KA0105
F = √1 + 9X 4
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √1 + 9𝑥𝑖4
0 0.00 1.0000
1 0.25 1.0174
2 0.50 1.2500
3 0.75 1.9615
4 1.00 3.1623
5 1.25 4.7930
6 1.50 6.8237
7 1.75 9.2418
8 2.00 12.0416
2
𝐼 = ∫ √1 + 9𝑥 4 𝑑𝑥
0
2
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.25
= [13.0416 + 4(17.0137) + 2(11.2360)]
3
= 8.6285
MUHAMMAD MUSA BIN YUSOF
A17KA0105
7. Approximate the arc length of the curve described by the function 𝑦 = 𝑒 𝑥 , 0 < 𝑥 < 2 , the
length is given by
2
∫ √1 + 𝑒 2𝑥 𝑑𝑥
0
𝑏−𝑎 2−0
𝑓(𝑥) = √1 + 𝑒 2𝑥 𝑛= = = 10
ℎ 0.2
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √1 + 𝑒 2𝑥𝑖
0 0.0 1.4142
1 0.2 1.5786
2 0.4 1.7960
3 0.6 2.0785
4 0.8 2.4399
5 1.0 2.8964
6 1.2 3.4674
7 1.4 4.1767
8 1.6 5.0530
9 1.8 6.1317
10 2.00 7.4564
2
𝐼 = ∫ √1 + 𝑒 2𝑥 𝑑𝑥
0
2
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 + 𝑓8 + 𝑓9 )]
2 0
0.2
= [8.8706 + 2(29.6182)]
2
= 6.8107
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑏−𝑎 2−0
𝑓(𝑥) = √1 + 𝑒 2𝑥 𝑛= = =8
ℎ 0.25
F = √1 + 𝑒 2X
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √1 + 𝑒 2𝑥𝑖
0 0.00 1.4142
1 0.25 1.6275
2 0.50 1.9283
3 0.75 2.3413
4 1.00 2.8964
5 1.25 3.6308
6 1.50 4.5919
7 1.75 5.8408
8 2.00 7.4564
2
𝐼 = ∫ √1 + 𝑒 2𝑥 𝑑𝑥
0
2
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.25
= [8.8706 + 4(13.4404) + 2(9.4166)]
3
= 6.7888
MUHAMMAD MUSA BIN YUSOF
A17KA0105
8. The solid of revolution obtained by rotating the region under the curve
𝑥 2
𝑦 = 1+( ) , 1≤ 𝑥 ≤2
2
about the x-axis has volume are given by
2
𝑥 2 2
𝐼 = ∫ 𝜋 [1 + ( ) ] 𝑑𝑥
1 2
Approximate the value of 𝐼 using
𝑥 2 2 𝑏−𝑎 2−1
𝑓(𝑥) = 𝜋 [1 + ( ) ] ℎ= = = 0.125
2 𝑛 8
𝑥𝑖 2 2
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = 𝜋 [1 + ( ) ]
2
0 1.000 4.9087
1 1.125 5.4441
2 1.250 6.0753
3 1.375 6.8132
4 1.500 7.6699
5 1.625 8.6586
6 1.750 9.7937
7 1.875 11.0907
8 2.000 12.5664
2
𝑥 2 2
𝐼 = ∫ 𝜋 [1 + ( ) ] 𝑑𝑥
1 2
2
= ∫ 𝑓(𝑥) 𝑑𝑥
1
ℎ
≈ [(𝑓 + 𝑓8 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 )]
2 0
0.125
= [17.4751 + 2(55.5455)]
2
= 8.0354
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
X 2
F = 𝜋 [1 + ( ) ]
2
𝑥𝑖 2 2
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = 𝜋 [1 + ( ) ]
2
0 1.000 4.9087
1 1.125 5.4441
2 1.250 6.0753
3 1.375 6.8132
4 1.500 7.6699
5 1.625 8.6586
6 1.750 9.7937
7 1.875 11.0907
8 2.000 12.5664
2
𝑥 2 2
𝐼 = ∫ 𝜋 [1 + ( ) ] 𝑑𝑥
1 2
2
= ∫ 𝑓(𝑥) 𝑑𝑥
1
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.125
= [17.4751 + 4(32.0066) + 2(23.5389)]
3
= 8.0241
MUHAMMAD MUSA BIN YUSOF
A17KA0105
9. You are an Architect and plan to build parabolic exist where their equation is given by
𝑦 = 0.1𝑥(30 − 𝑥) meter
Where 𝑦 is the height and 𝑥 in meter. Approximate the length of curve, L, given by
30
𝑑𝑦 2
𝐿 = ∫ √1 + ( ) 𝑑𝑥
0 𝑑𝑥
Using
𝑏 − 𝑎 30 − 0
𝑓(𝑥) = √1 + (3 − 0.2𝑥)2 ℎ= = =3
𝑛 10
F = √1 + (3 − 0.2X)2
𝑖 𝑥𝑖 𝑓𝑖 = 𝑓(𝑥𝑖 ) = √1 + (3 − 0.2𝑥𝑖 )2
0 0 3.1623
1 3 2.6000
2 6 2.0591
3 9 1.5620
4 12 1.1662
5 15 1.0000
6 18 1.1662
7 21 1.5620
8 24 2.0591
9 27 2.6000
10 30 3.1623
30
𝐼 = ∫ √1 + (3 − 0.2𝑥)2 𝑑𝑥
0
30
= ∫ 𝑓(𝑥) 𝑑𝑥
0
ℎ
≈ [(𝑓 + 𝑓10 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 + 𝑓9 ) + 2(𝑓2 + 𝑓4 + 𝑓6 + 𝑓8 )]
3 0
3
= [6.3246 + 4(9.3240) + 2(6.4506)]
3
= 56.5218
MUHAMMAD MUSA BIN YUSOF
A17KA0105
𝑥 𝑓(𝑥)
0 0.0000
0.1 2.1220
0.2 3.0244
0.3 3.2568
0.4 3.1399
0.5 2.8579
0.6 2.5140
0.7 2.1639
0.8 1.8358
0.8
Evaluate ∫0 𝑓(𝑥) 𝑑𝑥 using
ℎ
≈ [(𝑓 + 𝑓8 ) + 2(𝑓1 + 𝑓2 + 𝑓3 + 𝑓4 + 𝑓5 + 𝑓6 + 𝑓7 )]
2 0
0.1
= [1.8358 + 2(19.0789)]
2
= 1.9997
ℎ
≈ [(𝑓 + 𝑓8 ) + 4(𝑓1 + 𝑓3 + 𝑓5 + 𝑓7 ) + 2(𝑓2 + 𝑓4 + 𝑓6 )]
3 0
0.1
= [1.8358 + 4(10.4006) + 2(8.6783)]
3
= 2.0265
MUHAMMAD MUSA BIN YUSOF
A17KA0105
GAUSSIAN QUADRATURE
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎)
𝑥=
2
𝑥 = 𝑎 → 𝑡 = −1 dx 𝑏 − 𝑎
and then { and =
𝑥=𝑏 → 𝑡=1 dt 2
1
1 1
∫ 𝑔(𝑡) 𝑑𝑡 = 𝑔 (− )+𝑔( )
−1 √3 √3
1
5 3 8 5 3
∫ 𝑔(𝑡) 𝑑𝑡 = 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )
−1 9 5 9 9 5
MUHAMMAD MUSA BIN YUSOF
A17KA0105
***Exercise 6.2
Evaluate the given integration using the method proposed. Show all calculation in 4 DP.
1
2
1. ∫ 𝑒 −𝑥 𝑑𝑥
0
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (1 − 0)𝑡 + (1 + 0) 𝑡 + 1
𝑥= = =
2 2 2
𝑥 = 𝑎 = 0 → 𝑡 = −1 dx 𝑏 − 𝑎 1 − 0 1
and then { and = = =
𝑥=𝑏=1 → 𝑡=1 dt 2 2 2
1
2
then 𝐼 = ∫ 𝑒 −𝑥 𝑑𝑥
0
1 𝑡+1 2
−( ) 1
=∫ 𝑒 2 ( ) 𝑑𝑡
−1 2
1 1 −(
𝑡+1 2
)
= ∫ 𝑔(𝑡) 𝑑𝑡 , where 𝑔(𝑡) = 𝑒 2
2 −1
1 5 3 8 5 3
𝐼 = [ 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )]
2 9 5 9 9 5
1 5 8 5
= [ (0.9874) + (0.7788) + (0.4551)]
2 9 9 9
= 0.7468
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
2𝑥
2. ∫ 𝑒 −cos 𝑑𝑥
0
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (2 − 0)𝑡 + (2 + 0) 2𝑡 + 2
𝑥= = = =𝑡+1
2 2 2
𝑥 = 𝑎 = 0 → 𝑡 = −1 dx 𝑏 − 𝑎 2 − 0
and then { and = = =1
𝑥=𝑏=2 → 𝑡=1 dt 2 2
2
2𝑥
then 𝐼 = ∫ 𝑒 −cos 𝑑𝑥
0
1
2 (𝑡+1)
= ∫ 𝑒 −cos 𝑑𝑡
−1
1
2 (𝑡+1)
= ∫ 𝑔(𝑡) 𝑑𝑡 , where 𝑔(𝑡) = 𝑒 −cos
−1
5 3 8 5 3
𝐼 = 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )
9 5 9 9 5
5 8 5
= (0.3867) + (0.7468) + (0.9599)
9 9 9
= 1.4119
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
2
3. ∫ 𝑥 2 𝑒 −x 𝑑𝑥
0
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (2 − 0)𝑡 + (2 + 0) 2𝑡 + 2
𝑥= = = =𝑡+1
2 2 2
𝑥 = 𝑎 = 0 → 𝑡 = −1 dx 𝑏 − 𝑎 2 − 0
and then { and = = =1
𝑥=𝑏=2 → 𝑡=1 dt 2 2
2
2
then 𝐼 = ∫ 𝑥 2 𝑒 −x 𝑑𝑥
0
1
2
= ∫ (𝑡 + 1)2 𝑒 −(t+1) 𝑑𝑡
−1
1
2
= ∫ 𝑔(𝑡) 𝑑𝑡 , where 𝑔(𝑡) = (𝑡 + 1)2 𝑒 −(t+1)
−1
5 3 8 5 3
𝐼 = 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )
9 5 9 9 5
5 8 5
= (0.0483) + (0.3679) + (0.1351)
9 9 9
= 0.4289
MUHAMMAD MUSA BIN YUSOF
A17KA0105
3
4. ∫ 𝑒 𝑥 sin(x) 𝑑𝑥
1
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (3 − 1)𝑡 + (3 + 1) 2𝑡 + 4
𝑥= = = =𝑡+2
2 2 2
𝑥 = 𝑎 = 1 → 𝑡 = −1 dx 𝑏 − 𝑎 3 − 1
and then { and = = =1
𝑥=𝑏=3 → 𝑡=1 dt 2 2
3
then 𝐼 = ∫ 𝑒 𝑥 sin(x) 𝑑𝑥
1
1
= ∫ 𝑒 (𝑡+2) sin(𝑡 + 2) 𝑑𝑡
−1
1
= ∫ 𝑔(𝑡) 𝑑𝑡 , where 𝑔(𝑡) = 𝑒 (𝑡+2) sin(𝑡 + 2)
−1
5 3 8 5 3
𝐼 = 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )
9 5 9 9 5
5 8 5
= (3.2044) + (6.7188) + (5.7525)
9 9 9
= 10.9483
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
5. ∫ √𝑥 3 − 1 𝑑𝑥
1
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (2 − 1)𝑡 + (2 + 1) 𝑡 + 3
𝑥= = =
2 2 2
𝑥 = 𝑎 = 1 → 𝑡 = −1 dx 𝑏 − 𝑎 2 − 1 1
and then { and = = =
𝑥=𝑏=2 → 𝑡=1 dt 2 2 2
2
then 𝐼 = ∫ √𝑥 3 − 1 𝑑𝑥
1
1
𝑡+3 3 1
= ∫ √( ) − 1 ( ) 𝑑𝑡
−1 2 2
1 1 𝑡+3 3
= ∫ 𝑔(𝑡) 𝑑𝑡 , where 𝑔(𝑡) = √( ) −1
2 −1 2
1 1 1
𝐼= [𝑔 (− ) + 𝑔 ( )]
2 √3 √3
1
= [0.8817 + 2.1732]
2
= 1.5275
1 5 3 8 5 3
𝐼 = [ 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )]
2 9 5 9 9 5
1 5 8 5
= [ (0.6145) + (1.5411) + (2.3921)]
2 9 9 9
= 1.5201
MUHAMMAD MUSA BIN YUSOF
A17KA0105
4
6. ∫ √𝑥 2 − 4 𝑑𝑥
2
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (4 − 2)𝑡 + (4 + 2) 2𝑡 + 6
𝑥= = = =𝑡+3
2 2 2
𝑥 = 𝑎 = 2 → 𝑡 = −1 dx 𝑏 − 𝑎 4 − 2
and then { and = = =1
𝑥=𝑏=4 → 𝑡=1 dt 2 2
4
then 𝐼 = ∫ √𝑥 2 − 4 𝑑𝑥
2
1
= ∫ √(𝑡 + 3)2 − 4 𝑑𝑡
−1
1
= ∫ 𝑔(𝑡) 𝑑𝑡 , where 𝑔(𝑡) = √(𝑡 + 3)2 − 4
−1
5 3 8 5 3
𝐼 = 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )
9 5 9 9 5
5 8 5
= (0.9759) + (2.2361) + (3.2012)
9 9 9
= 4.3083
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2
sin 𝑡
7. ∫ 𝑑𝑡
0 𝑡
(𝑏 − 𝑎)𝑥 + (𝑏 + 𝑎) (2 − 0)𝑥 + (2 + 0) 2𝑥 + 2
𝑡= = = =𝑥+1
2 2 2
𝑡 = 𝑎 = 0 → 𝑥 = −1 dt 𝑏 − 𝑎 2 − 0
and then { and = = =1
𝑡=𝑏=2 → 𝑥=1 dx 2 2
2
sin 𝑡
then 𝐼=∫ 𝑑𝑡
0 𝑡
1
sin(𝑥 + 1)
=∫ 𝑑𝑥
−1 𝑥+1
1
sin(𝑥 + 1)
= ∫ 𝑔(𝑥) 𝑑𝑥 , where 𝑔(𝑥) =
−1 𝑥+1
5 3 8 5 3
𝐼 = 𝑔 (−√ ) + 𝑔(0) + 𝑔 (√ )
9 5 9 9 5
5 8 5
= (0.9916) + (0.8415) + (0.5518)
9 9 9
= 1.6054
MUHAMMAD MUSA BIN YUSOF
A17KA0105
POWER METHOD
***Exercise 7.1
4 1 2
1. 𝐴 = (1 0 1) , 𝐯 (0) = (1 , 1 , 1)𝑇
2 1 2
1
𝐯 (𝑘+1) = 𝐴𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚4 − 𝑚3 | = |5.34 − 5.34| = 0.00 < 𝜀 = 0.05
Therefore,
𝜆1 ≈ 𝑚4 = 5.34
2 1 1
2. 𝐴 = (1 3 2) , 𝐯 (0) = (1 , 0 , 1)𝑇
1 2 5
1
𝐯 (𝑘+1) = 𝐴𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚4 − 𝑚3 | = |6.63 − 6.62| = 0.01 < 𝜀 = 0.05
Therefore,
𝜆1 ≈ 𝑚4 = 6.63
3 1 1
3. 𝐴 = (1 1 4) , 𝐯 (0) = (1 , 1 , 1)𝑇
1 4 1
1
𝐯 (𝑘+1) = 𝐴𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚4 − 𝑚3 | = |5.75 − 5.77| = 0.02 < 𝜀 = 0.05
Therefore,
𝜆1 ≈ 𝑚4 = 5.75
1 2 0
4. 𝐴 = (2 3 1) , 𝐯 (0) = (0 , 1 , 0)𝑇
0 1 1
1
𝐯 (𝑘+1) = 𝐴𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚4 − 𝑚3 | = |4.45 − 4.43| = 0.02 < 𝜀 = 0.05
Therefore,
𝜆1 ≈ 𝑚4 = 4.45
1 2 3
5. 𝐴 = (2 1 3) , 𝐯 (0) = (1 , 1 , 0)𝑇
3 3 −1
1
𝐯 (𝑘+1) = 𝐴𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚5 − 𝑚4 | = |5.31 − 5.34| = 0.03 < 𝜀 = 0.05
Therefore,
𝜆1 ≈ 𝑚5 = 5.31
1. Find the dominant eigenvalue 𝜆1 and corresponding eigenvector 𝐯1 of the following matrix
𝐴 using shift power method with shifting factor 𝑝. Show the calculation in two decimal
places (2 DP) and use 𝜀 = 0.05.
3 0 1
(a) 𝐴 = (0 3 2) , 𝐯 (0) = (0 , 0 , 1)𝑇 , 𝑝=1
1 2 3
𝐵 = 𝐴 − 𝑝𝐼 = 𝐴 − (1.00)𝐼
3 0 1 1 0 0
= (0 3 2) − 1.00 (0 1 0)
1 2 3 0 0 1
2 0 1
= (0 2 2)
1 2 2
1
𝐯 (𝑘+1) = 𝐵𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚4 − 𝑚3 | = |4.24 − 4.22| = 0.02 < 𝜀 = 0.05
Therefore,
𝜆1 = 𝜆𝐵 + 𝑝 = 4.24 + 1.00 = 5.24
3 −1 0
(b) 𝐴 = (−2 6 −2) , 𝐯 (0) = (0 , 1 , 0)𝑇 , 𝑝=2
0 −1 3
𝐵 = 𝐴 − 𝑝𝐼 = 𝐴 − (2.00)𝐼
3 −1 0 1 0 0
= (−2 6 −2) − 2.00 (0 1 0)
0 −1 3 0 0 1
1 −1 0
= (−2 4 −2)
0 −1 1
1
𝐯 (𝑘+1) = 𝐵𝐯 (𝑘) , 𝑘 = 0, 1, 2, …
𝑚𝑘+1
Stop the iteration when |𝑚3 − 𝑚2 | = |5.00 − 5.00| = 0.00 < 𝜀 = 0.05
Therefore,
𝜆1 = 𝜆𝐵 + 𝑝 = 5.00 + 2.00 = 7.00
2. All the eigenvalues of the following matrix 𝐴 are in same sign with |𝜆1 | > |𝜆2 | > |𝜆3 |. Find
the smallest eigenvalue in modulus 𝜆3 and corresponding eigenvector 𝐯3 of the following
matrix 𝐴 by shifted power method starting with 𝐯 (0) and using shifting factor 𝑝 = 𝜆1.
Hence, find eigenvalue 𝜆2 . Show the calculation in two decimal places (2 DP) and use
𝜀 = 0.05.
2 1 1
(a) 𝐴 = (1 3 2) , 𝐯 (0) = (1 , 0 , 1)𝑇 , 𝜆1 = 6.63 let 𝑝 = 𝜆1 = 6.63
1 2 5
𝐵 = 𝐴 − 𝑝𝐼 = 𝐴 − (6.63)𝐼
2 1 1 1 0 0
= (1 3 2) − 6.63 (0 1 0)
1 2 5 0 0 1
−4.63 1 1
=( 1 −3.63 2 )
1 2 −1.63
Stop the iteration when |𝑚3 − 𝑚2 | = |−5.28 + 5.28| = 0.00 < 𝜀 = 0.05
Therefore,
𝜆1𝐵 = 𝑚3 = −5.28
But 𝜆1𝐵 = 𝜆3 − 𝜆1 → 𝜆3 = 𝜆1 + 𝜆1𝐵
= 6.63 + (−5.28)
= 1.35
𝜆1 + 𝜆2 + 𝜆3 = trace(𝐴)
6.63 + 𝜆2 + 1.35 = 2 + 3 + 5
𝜆2 = 2.02
MUHAMMAD MUSA BIN YUSOF
A17KA0105
2 1 1
(b) 𝐴 = (1 6 4) , 𝐯 (0) = (0 , 1 , 1)𝑇 , 𝜆1 = 10.76 let 𝑝 = 𝜆1 = 10.76
1 4 7
𝐵 = 𝐴 − 𝑝𝐼 = 𝐴 − (10.76)𝐼
2 1 1 1 0 0
= (1 6 4) − 10.76 (0 1 0)
1 4 7 0 0 1
−8.76 1 1
=( 1 −4.76 4 )
1 4 −3.76
Stop the iteration when |𝑚3 − 𝑚2 | = |−9.02 + 9.02| = 0.00 < 𝜀 = 0.05
Therefore,
𝜆1𝐵 = 𝑚3 = −9.02
But 𝜆1𝐵 = 𝜆3 − 𝜆1 → 𝜆3 = 𝜆1 + 𝜆1𝐵
= 10.76 + (−9.02)
= 1.74
𝜆1 + 𝜆2 + 𝜆3 = trace(𝐴)
10.76 + 𝜆2 + 1.74 = 2 + 6 + 7
𝜆2 = 2.50
MUHAMMAD MUSA BIN YUSOF
A17KA0105
4 2 −1
(c) 𝐴 = ( 2 3 1 ) , 𝐯 (0) = (0 , −1 , 1)𝑇 , 𝜆1 = 5.50 let 𝑝 = 𝜆1 = 5.50
−1 1 2
𝐵 = 𝐴 − 𝑝𝐼 = 𝐴 − (5.50)𝐼
4 2 −1 1 0 0
= ( 2 3 1 ) − 5.50 (0 1 0)
−1 1 2 0 0 1
−1.5 2 −1
=( 2 −2.5 1 )
−1 1 −3.5
Stop the iteration when |𝑚5 − 𝑚4 | = |−5.19 + 5.15| = 0.04 < 𝜀 = 0.05
Therefore,
𝜆1𝐵 = 𝑚5 = −5.19
But 𝜆1𝐵 = 𝜆3 − 𝜆1 → 𝜆3 = 𝜆1 + 𝜆1𝐵
= 5.50 + (−5.19)
= 0.31
𝜆1 + 𝜆2 + 𝜆3 = trace(𝐴)
5.50 + 𝜆2 + 0.31 = 4 + 3 + 2
𝜆2 = 3.19