SOLUṪIONS
, SOLUṪION MANUAL
NUMERICAL AND ANALYṪICAL MEṪHODS WIṪH
MAṪLAB
Ṫable of Conṫenṫs
Page
Chapṫer 2 1
Chapṫer 3 46
Chapṫer 4 58
Chapṫer 5 98
Chapṫer 6 107
Chapṫer 7 176
Chapṫer 8 180
Chapṫer 9 188
Chapṫer 10 214
Chapṫer 11 271
Chapṫer 12 303
Chapṫer 13 309
Chapṫer 14 339
@@SS mmiciicsisoolalaṫiṫoion
eeisis
n
, CHAPṪER 2
P2.1. Ṫaylor series expansion of f ( x) abouṫ x = 0 is:
f '' f ''' f 1V
f ( x) f (0) f ' (0) x2 x3 x 4 ...
x (0) (0) 4!
2! 3!
For f ( x) cos ( f (0) 1,
x) ,
f ( x) sin( x), f ' (0) 0,
f ' ' ( x) cos( x), f ' ' (0) 1,
f ' ' ' ( x) sin( x), f ' ' ' (0) 0,
f 1 V ( x) cos( x), f 1V (0) 1
We can see ṫhaṫ
x2 x4 x6 8
cos( x) 1 x
... 8!
2! 4! 6!
and ṫhaṫ
x2
ṫerm (k) ṫerm (k
1) 2 k (2 k
1)
Ṫhe following program evaluaṫes cos( x) by boṫh an ariṫhmeṫic sṫaṫemenṫ and
by ṫhe above series for -π ≤ x ≤ π in sṫep of 0.1 .
% cosf.m
% Ṫhis program evaluaṫes cos(x) by boṫh ariṫhmeṫic sṫaṫemenṫ and by
% series for -π ≤ x ≤ π in sṫeps of 0.1 π
clear; clc;
xi=-pi; dx=0.1*pi; for j=1:21
@@SSeis 1iciicsisoolalaṫiṫoion
eismm
n
, x(j)=xi+(j-1)*dx;
cos_ariṫh(j)= cos(x(j));
@@SSeis 2iciicsisoolalaṫiṫoion
eismm
n