You are on page 1of 7

Solution to Exercises

Lecture slides Week 4 Chapter 3


Week 4 Exercise 1

The Maclaurin series expansion for sin x is;

x3 x5 x7
sin x  x     
3! 5! 7!
Starting with the simplest version, sin x = x, add terms one at a
time to estimate sin ( / 3). After each new term is added, compute
the true and approximate percent relative errors.
Use your pocket calculator to determine the true value (considered
6 decimal point of true value). Add terms until the absolute value
of the approximate error estimate falls below an error criterion
confirming to two significant figures.

2
Solution use
.3 Use the stopping criterion:  s  0.5  1022 %  0.5%
 s  (0.5  10(2- n) )% (3.7)
True value: sin(/3) = 0.866025… Where n number of significant figures

zero order:

  
sin    1.047198
3 3

0.866025 1.047198
t   100%  20.92%
0.866025

first order:

 
sin   1.047198
 / 3  0.855801
3

3 6

0.855801 1.047198
 t  1.18% a   100%  22.36%
0.855801
3
second order:

 
sin   0.855801
 / 3  0.866295
5

3 120

0.866295 0.855801
 t  0.031% a   100%  1.211%
0.866295

third order:

 
sin   0.866295
 / 3  0.866021
7

3 5040

0.866021 0.866295
 t  0.000477% a   100%  0.0316%
0.866021

Since the approximate error is below 0.5%, the computation can be terminated.
4
Week 4 Exercise 2

(a) Approximate the function f ( x)  3 x by a Taylor


polynomial of degree 2 using the base at x = 8.
(b) Use zero-through third order Taylor series expansion
to predict f(3) for

f ( x)  25 x 3  6 x 2  7 x  88

using a base point at x = 1. Compute the true percent


relative error for each approximation.

5
Week 4 Solution Exercise 2 (a)
Approximate the function by a Taylor polynomial of degree 2
f ( x)  3 x using the base at x = 8.

1 1 2
( )
𝑓 𝑥 =2+ ( )
𝑥 −8 − ( 𝑥 − 8)
12 2 88
Week 4 Solution Exercise 2 (b)
True value: f(3) = 554.
(b) Use zero-through third order Taylor series expansion to predict f(3) using a
zero order: base point at x = 1. Compute the true percent relative error for each
approximation.
f (3)  f (1)  62 f ( x)  25 x 3  6 x 2  7 x  88
554  (62)
t   100%  111 .191%
554

first order:

f (3)  62  f ' (1)(3  1)  62  70(2)  78  t  85.921%

second order:

f " (1) 138


f (3)  78  (3  1) 2  78  4  354  t  36.101%
2 2

third order:

( 3)
f (1) 150
f (3)  354  (3  1) 3  354  8  554  t  0%
6 6

Thus, the third-order result is perfect because the original function is a third-order
7
polynomial.

You might also like