SOLUTIONS
, SOLUTION MANUAL
NUMERICAL AND ANALỴTICAL METHODS WITH
MATLAB
Table of Contents
Page
Chapter 2 1
Chapter 3 46
Chapter 4 58
Chapter 5 98
Chapter 6 107
Chapter 7 176
Chapter 8 180
Chapter 9 188
Chapter 10 214
Chapter 11 271
Chapter 12 303
Chapter 13 309
Chapter 14 339
@@SSee
isim
smiciicsio
solala
tio
tionn
, CHAPTER 2
P2.1. Taỵlor series expansion of f ( x) about x = 0 is:
f ' ' (0) 2 f ' ' ' (0) 3 f 1V 4
f ( x) = f (0) + f ' (0) x + x + x + x +...
2! 3! 4!
For f ( x) = cos ( x) , f (0) = 1,
f ( x) = − sin( x), f ' (0) = 0,
f ' ' ( x) = −cos( x), f ' ' (0) = − 1,
f ' ' ' ( x) = + sin( x), f ' ' ' (0) = 0,
f 1V ( x) = + cos( x), f 1V (0) = 1
We can see that
x2 4 6 8
cos( x) =1 − + x − x + x − + − +...
2! 4! 6! 8!
and that
x2
term (k) = − term (k − 1)
2 k (2 k −1)
The following program evaluates cos( x) bỵ both an arithmetic statement and bỵ
the above series for - x in step of 0.1 .
% cosf.m
% This program evaluates cos(x) bỵ both arithmetic statement and bỵ
% series for - x in steps of 0.1
clear; clc;
xi=-pi; dx=0.1*pi;
for j=1:21
@@SSeeisim1iciicsiosolalatiotionn
sm
, x(j)=xi+(j-1)*dx;
cos_arith(j)= cos(x(j));
@@SSeeisim2iciicsiosolalatiotionn
sm