Chapter One
Chapter One
Chapter One
CHAPTER ONE
Introduction
The solution of most practical problems in science and engineering involves two
successive stages:
x2 x3
E.g: e x 1 x . . .
2 ! 3!
x2
Now if e x 1 x , the truncation error is given by
2!
x2 x3 x4
e x 1 x ...
2! 3! 4!
xx Ex
2. The relative error x in x is defined by x if x 0 .
x x
Note: 1. The absolute error doesn’t show how good a measurement or calculation is.
2. Relative errors can be stated directly or as percentages.
3. The actual value x lies in the interval [ x E x , x E x ]
calculated by
f ( xh) f ( x)
f ( x ) .
h
Example 4: Find the largest interval in which x must lie in order to approximate 2
The significant digits of a number are all its digits except zeros which appear to the left
of the first non-zero digit.
xx
if k is the largest nonnegative integer for which 5x10 k .
x
Example 1: Let x 3.29 and x 3.2 . To how many significant digits does x
approximate x ?
Example 2: Given a relative error of x 0.5 . How many significant digits are there in
the approximation?
Example 3: Given x 3.2 . What are the worst possible approximations of x which are
Note: when a number is rounded, all the digits in the rounded number are considered
to be correct.
When we are solving a problem numerically, we will only have access to approximate
values and not actual values. Thus, we quantify error for such cases as follows:
x 0.d1 d 2 d 3 ... 10 n
Example: Given two numbers x 0.88909 10 4 and y 0.8887 10 4 . Compute x y using
decimal floating point approximation with 4 significant digits in the mantissa in each of
the following cases:
f ( x0 ) f
f ( x) f ( x0 ) f ( x0 )( x x0 ) ( x x0 ) ( x0 )( x x0 ) ...
2! 3!
Taylor’s Theorem:
f ( x) Pn ( x) Rn ( x)
where
f ( x0 ) f f (n)
Pn ( x) f ( x0 ) f ( x0 )( x x0 ) ( x x0 ) 2 ( x0 )( x x0 ) 3 ... ( x0 )( x x0 ) n &
2! 3! n!
f ( n 1 )
Rn ( x ) ( z )( x x0 ) n 1 for some z between x0 and x .
( n 1) !
Here,
f (x) by Pn (x) .
Example: Let f ( x) e x . Then
(a) Find the third order Taylor polynomial approximation of f about x=0 and use it
to approximate the value of e.
(b) Use the remainder term to find an upper bound on the truncation error.
1.6. Error Propagation
(i) Functions of a single variable
f ( x ) f
f ( x) f ( x ) f ( x )( x x ) (x x)2 ( x )( x x ) 3 ...
2! 3!
f ( x) f ( x ) f ( x )(x x )
f ( x) f ( x ) f ( x )(x x )
f ( x) f ( x ) f ( x ) x x
f ( x) f ( x ) x
each 1 i n , then
f f f f
F x1 x2 x3 ... xn
x1 x2 x3 xn
i.e. the right hand side expression gives the maximum absolute error in F.
Note that all the partial derivatives are evaluated at the point ( x1 , x2 , x3 , . . . , xn ) .
6
Example 1: Given x 2.5 0.01 . Estimate the resulting error in f ( x) x 3 .
5x 2 y
Example 2: Find the maximum error in F where F .
z3
Given x 1 0.001 , y 2 0.002 and z 3 0.003 .
F
Example 3: The strain in an axial member of a square cross-section is given by
h2 E
E =Young’s modulus, Pa
Given F 72 0.9 N , h 4 0.1mm , E 70 1.5 GPa .
1 ( x y ) x y
2 ( x y ) x y
3 ( x. y ) x y y x
x x y y x
4
y
2
y
Proof:
f f
1. Let f ( x, y ) x y . Then 1
x y
f f
( x y ) f x y x y
x y
7
i.e. the absolute error in the sum of two numbers is the sum of the absolute errors in two
numbers.
f f
3. Let f ( x, y ) x . y . Then y and x
x y
f f
( x . y ) f x y y x x y
x y
( x. y ) ( x. y ) y x x y x y x y
x. y x. y x. y x y x y
i.e. the relative error in the product of two numbers is the sum of the relative errors in
two numbers.