B-1
Appendix B Taylor Series Expansion
Appendix B Taylor Series Expansion ……………………………………………………………………………….……1
Problem B-1.
cos( ) !!
…….xxx
124
24
For h = 0.1
x = x0 + h = 0 + 0.1 = 0.1
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
Problem B-2.
sin( ) !!
…….xx
xx
35
35
For h = 0.1
xh
f
(x0+h)
one ter
m
f
(x0+h)
two terms
f
(x0+h)
three terms True value
0.1 0.1 1.00000000 0.99500000 0.99500417 0.99500417
0.2 0.2 1.00000000 0.98000000 0.98006667 0.98006658
0.3 0.3 1.00000000 0.95500000 0.95533750 0.95533649
B-2
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
Problem B-3.
exxx
12
2
!…….
For h = 0.1
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
xh
f
(x0+h)
one ter
m
f
(x0+h)
two terms
f
(x0+h)
three terms True value
0.1 0.1 0.10000000 0.09983333 0.09983342 0.09983342
0.2 0.2 0.20000000 0.19866667 0.19866933 0.19866933
xh
f
(x0+h)
one ter
m
f
(x0+h)
two terms
f
(x0+h)
three terms True value
0.1 0.1 1.00000000 1.10000000 1.10500000 1.10517092
0.2 0.2 1.00000000 1.20000000 1.22000000 1.22140276
0.3 0.3 1.00000000 1.30000000 1.34500000 1.34985881
B-3
Problem B-4.
fx x x x f
( ) = ( ) = 16
32
3510 2

Referring to Eq. B-1 in the textbook, the value of the function, f(x), can be approximated by:
f(x0 + h)| 16 + 5h + 3h2 + h3
where x0 = 2
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
Problem B-5.
fx x x x f
fx x x x f
( ) = ( ) = -38
( ) = 5 (2) = -76
542
43
56 2
20 2


Referring to Eq. B-1 in the textbook, the value of the function, f(x), can be approximated by:
f(x0 + h)| -38 – 76h – 39h2 + 5h4 + h5
xh
f
(x0+h)
one ter
m
f
(x0+h)
two terms
f
(x0+h)
three terms
f
(x0+h)
four terms True value
2.1 0.1 16.0000 16.5000 16.5300 16.5310 16.5310
2.2 0.2 16.0000 17.0000 17.1200 17.1280 17.1280
2.3 0.3 16.0000 17.5000 17.7700 17.7970 17.7970
B-4
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
Problem B-6.
fx x x f
( ) = ( ) = 2.92893
205
56 2

.
. .
.
) ………………………………………………………….. ( …….
n(n)
fx f
()2
Referring to Eq. B-1 in the textbook, the value of the function, f(x), can be approximated by:
f(x0 + h)| 2.92893 + 2.23223h + 1.27097h2 – 0.05524h3 + 0.01726h4
where x0 = 2
For h = 0.1
xh
f
(x0+h)
one ter
m
f
(x0+h)
two terms
f
(x0+h)
three terms
f
(x0+h)
four terms
f
(x0+h)
five terms True value
2.1 0.1 -38.00000 -45.60000 -45.99000 -45.98950 -45.98949 45.98949
2.2 0.2 -38.00000 -53.20000 -54.76000 -54.75200 -54.75168 54.75168
Problem B-7.
The following is a computer program in FORTRAN to evaluate the Taylor series expansion for
cos(x) using one term, two terms, and three terms.
f(x0+h) = 1224
24

xx
where x0= 0.0
C******************************************************
PROGRAM TAYLOR8
H=0.1
xh
f
(x0+h)
one ter
m
f
(x0+h)
two terms
f
(x0+h)
three terms
f
(x0+h)
four terms
f
(x0+h)
five terms True value
2.1 0.1 2.928930 3.152153 3.164863 3.164807 3.164809 3.164312
2.2 0.2 2.928930 3.375376 3.426215 3.425773 3.425800 3.423802
B-6
Problem B-8.
The following is a computer program in FORTRAN to evaluate the Taylor series expansion for ex
using one term, two terms, and three terms.
C******************************************************
PROGRAM TAYLOR9
H=0.1
WRITE(*,1)
1 FORMAT(1X,’ X 1 TERM 2 TERMS 3 TERMS ‘)
Problem B-9.
The following is a computer program in FORTRAN to evaluate the Taylor series expansion:
f(x0+h) = -38 – 76h – 39h2 +5h4 + h5
where x0= 2
C******************************************************
PROGRAM TAYLOR10
H=0.1
B-7
Problem B-10.
The following is a computer program in FORTRAN to evaluate the Taylor series expansion
f(x0+h) = 2.92893 + 2.23223h + 1.27097h2 – 0.05524h3 + 0.01726h4
where x0= 2
C******************************************************
PROGRAM TAYLOR11
H=0.1
DO 10 I=1,10
FX1=2.92893
FX2=FX1+2.23223*H
FX3=FX2+1.27097*H**2