






































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







































Numerical analysis is the study of approximation techniques applicable in solving problems in engineering, physical sciences, computer science and social sciences. The result obtained using these techniques differs from the actual result with a quantity known as an error i.e. if x *is the approximate result, x is the actual result and e is the error then e x x *. The error e can arise from one or more of the following
i. Number representation ii. Simplification of the method iii. Data used iv. Type of the computing device used v. Human mistakes TYPE OF ERRORS
There exist a number of different types of errors namely:
e eabs r
Note: The maximum relative error can be written as abs
r ebs x e
e e
max (^) * where x * is the
absolute value of the approximate value x *
Proof: Let x be the actual vale and x *be its approximate value then x x x *^ x *or
inequality x x * ebs abs
abs abs x e
e x
e
(^) * then abs
r abs x e
e e
max (^) *
after the decimal point e.g. 3.1423 is a number which is correct to 4 decimal places. The maximum round off error in a value correct to n decimal places is given by 0. 5 10 n
Theorem
Let x be a number which is correct to n significance figures if the first significance figure is K
then the maximum relative error in x is given by 1 10
max 1 er (^) K n
Proof:
Case 1: Suppose that x is correct to zero decimal places if k is the first significance figure and the number is correct to zero decimal places i.e. x kd 1 d 2 .......... d (^) n 1 if dis , i 1 , 2 ...... n 1 are
replaced by zeros then x k 10 n ^1 n abs
abs abs
r abs k e
e x e
e e
max for a number
correct to zero decimal places 2 10 1
max 0. 5 max^0.^5 eabs er k n (^1) k n (^1) for any
positive number k ,^1111 10
max^1 10
n n r n r n k
e k
k k e
Case 2: suppose that the approximate value x is correct to m decimal places and (^) k is the first significant figure i.e. x kd 1 d 2 ...... d (^) n 1 m. dn 2 ....... dn 1 kd 1 d 2 ........ dn 1 10 m replacing all di , i 1 , 2 , n 1 with zeros then x k 10 n ^1 10 m maximum absolute error in x is
1 1 1 10 1 max^1 10
(^) n m m n n abs n
m abs
r abs k
e x e k k k
e e
Example
Compute the maximum relative error in the approximate value x 4. 2357
Solution: The given value is correct to five significance figure n 5 and first significant figure
is k 4 5 1 4 2. 5 105 4 10
max 1 er
PROPAGATED ERROR IN ARITHEMATIC OPERATIONS
i. Addition and subtraction
NB: The maximum relative error in the quotient *
y x is approximated by
*^2
x y y
x
y
x y
Consider a function of one real variable x say f x then if x *is the approximate value of the actual value x having an error x then the error in the functional value computed at the
about x *by Taylor’s expansion yields
f x f x *^ x x * f x * ^1 x x *^2 f x * or
f x f x *^ xf x * ^1 x^2 f x * substituting 2 in 1 yields
f xf x *^ ^1 x^2 f x * if x is a very small value this can be approximated
Example
Given the function 21 x^2 f x e determine the maximum absolute error in the computed value f 1. 23
Solution
For x *^ 1. 23 the maximum absolute error is x 0. 5 10 ^2
23 1. 23 2 0. 135
232 (^) f e
thus if f is the maximum absolute error in (^) f 1. 23 then f 0. 5 10 ^2 0. 135 0. 001
NB: The above maximum absolute error given in A can be generalized to a function of more than one independent variables as follows, let f x 1 , x 2 ........., x n be a function of n real
variables xi , i 1 , 2 ......... n if x 1 * , x * 2 .......... x * n are the approximate values of x 1 , x 2 ,........, xn with
respective errors e (^) 1 , e 2 ......... en then the maximum absolute error in the functional value
computed at the approximate values is given by
n i i (^) x f e f
Example 2
Given that 2
(^23)
3 1 1
2 1 ,^2 , 3 2 3 x
x x x
(^) f x x x x x determine the maximum absolute error computed at
x 1 1 0. 02 , x 2 3 0. 01 and x 3 2 0. 005
Solution
For the given values the approximate values are x 1 * 1 , x * 2 3 and x 3 * 2 with respective absolute errors e 1 0. 02 , e 2 0. 01 and e 3 0. 005 , for the given function
(^31) , 3 , 2
3 2 121 123 21 3
(^21) , 3 , 2
2 3 22
3 (^21)
1 32 1 2
(^11) , 3 , 2
2 3 21
1 (^21)
3 2 23 1 1
1 * 2 *^ * 3
1 * * 2 * 3
x x x
x x x
x x x
x
xx x x x f x
f
x
x x x xx f x
f
x
x x x x x x f x
f
If f is the maximum absolute error in f 1 , 3 , 2 then
f 0. 02 7 0. 014. 22 0. 00511. 667 0. 241
Definition: let R E be the rate of growth of the error E in a given arithmetic operation then if
i. R E CE where C is a constant then the arithmetic procedure is said to be a linear error growing procedure or the method is said to be stable ii. R E Cn E where C is a constant and n the number of steps in the procedure the method is said to be unstable FINITE DIFFERENCES
Consider n 1 equally spaced points x (^) i , fi , i 0 , 1 , 2 .......... n i.e. x (^) i 1 xi h where h is equal to a constant then the difference between two consecutive functional values i.e.
.. fn fn 1 fn 1 fn 2 fn fn 1 xn fn PROPERTIES OF FINITE DIFFERENCE TABLES
The following are the properties of a finite difference table:
Example
Construct a finite difference table for the data given below
x 2.0 2.2 2.4 2. f x^ 0.3010^ 0.3424^ 0.3802^ 0. Solution
The given data is equally spaced thus its finite difference table is
Difference order x f x 1 2 3
NB: From this table the difference are decreasing in magnitude rapidly thus the data is for a well behaved function further differences of order two when multiplied by 10 ^4 are almost equal to a constant thus round off error in the functional values can be neglected.
EXERCISE
i. Compute the maximum absolute and relative errors in each of the following a) 2. 134 0. 67 3. 2 b) 4. 12 3. 67 . 0. 867 c) Functional value of 5 2
x x
f x x computed at 1. 25
d) Functional value 2
3 1
2 3 2
x
x x x
f x x x x x computed at
x 1 1 0. 04 , x 2 3 0. 006 , x 3 2 0. 023 ii. Construct the finite difference table for each of the following and state whether the round off error can be neglected i. x 2.00 2.15 2.30 2.45 2. f x^ 1.260^ 1.291^ 1.320^ 1.348^ 1. ii. 0. 2 0. 1 0. 5 21 x^3 e iii. Compute the maximum absolute error in total cost of the material required to construct a cylindrical closed tank whose radius is 2.^45 m and height is 2.^6 m if the cost of the material is K £ 2. 065 per square meter. TYPES OF FINITE DIFFERENCE OPERATORS There exists three different types of finite difference operators all of which are defined in terms of the shift operator denoted by E which moves a factional in an equally spaced data to the next functional value i.e. considered an equally spaced data x (^) i , fi , i 0 , 1 , 2 .......... n then Ef (^) 0 f 1 , Ef 1 f 2 .............,. Efn 1 fn in general Efi fi 1
which implies that applying the shift operator E to fi k times moves the functional value k steps forward. FORWARD FINITE DIFFERENCE OPERATOR
This operator denoted by in terms of the shift operator is defined as E 1 successive application of this operator to a functional value fi ,^ i ^0 ,^1 ,^2 ,.......... n in an equally spaced data
xn 1 fn 1 xn fn
Example 2
Given the equally spaced data x (^) i , fi , i 0 , 1 , 2 ,........ n express
a) (^) ^5 fi in terms of functional values b) f 6 in terms forward finite differences at x 1
Hence given the data below
x 0.1 0.2 0.3 0.4 0. f x^ 1.010^ 1.041^ 1.094^ 1.174^ 1. Without constructing the finite difference table determine the value of the fourth order forward finite difference at x 0 0. 1
Solution
a) By definition E 1 ^5 fi E 1 ^5 f i expanding the right hand side by the binomial expansion yields
b) f^ 6 ^ f 1 5 E^5 f 1 ^ ^1 ^5 f 1 f 6 ^5 f 1 ^5 ^4 f 1 ^10 ^3 f 1 ^10 ^2 f 1 ^5 f 1 f 1
Let f 0. 1 f 0 , f 0. 2 f 1 , f 0. 3 f 2 , f 0. 4 f 3 and f 0. 5 f 4 then ^4 f (^) 0 E 1 4 f 0 E^4 f 0 4 E^3 f 0 6 E^2 f 0 4 Ef 0 f 0 or ^4 f 0 f 4 4 f 3 6 f 2 4 f 1 f 0 1. 284 4 1. 174 6 1. 094 4 1. 041 1. 010 0. 002
Given the data below determine ^4 f 1 without constructing the finite difference table x 1.0 1.5 2.0 2.5 3.0 3.
values of x
fi fi fi 1 which is said to be the first order backward finite difference at xi
NB:
i. If i 0 then f 0 f 0 f 1 since f 1 is not in the data then the back finite difference at the first tabulated point is defined in other words the operator cannot be applied to the first point of the tabulated points ii. f 1 (^) f 1 f 0 which is the first order backward finite at (^) x 1 or the first order forward finite difference at x 0 in general fi , i 1 , 2 ............. n is the first order backward finite difference at xi or the forward first order finite difference at xi 1 iii. kth order backward finite difference at xi is given by
i k k i i k
ik k k k k ik k i k k i
k k i
f kf kk f f
f E f E E f E f E kE kk E f
1 2
1 1 2
to compute k^ fi k functional values before fi are required thus the operator is applicable only when xi is near the last tabulated point
Example: Express
i. ^4 fi in terms of the functional values ii. f 9 in terms of the backward finite differences at x 12
Solution
i. By definition
1 1 4 4 4 4 6 4 1 4 6 4
i i i i i i
i i E E E E f f f f f f
E E E f E E f
Exercise
iii. 0
1 0
n (^2) f fn f k i^
iv. f (^) i^2 fi fi 1 f i
v. ^ 1
i i
i i i i i
i g g
g f f g g
f
vi. 1
i i
i i f f
f f
FINITE DIFFERENCE OF POLYNOMIALS
Definition: A polynomial of degree n in the independent variable x denoted by pn x is given
by (^) pn x a 0 xn a 1 xn ^1 a 2 xn ^2 ............. a n where n is a positive integer and a 0 is said to be the leading coefficient of the polynomial.
Theorem
Consider a polynomial of degree n in the independent variable x with equal spacing h then the nth order finite difference of the polynomial is a constant proportional to hn and is given by a (^) 0 n! hn where a 0 is the leading coefficient of the polynomial and the high order differences equal to zero.
Proof
Let (^) p (^) n x a 0 xn a 1 xn ^1 a 2 xn ^2 ............ a n then if h is the equal spacing in the values of x
then the first order finite difference of pn ^ x at x is given by
.......... ........... 1
2 1 0
0 1 1 0 1 1 anhx p x
p x p x h p x a x h a x h a ax ax a n n
n n n n n n n n n
The second order finite difference of pn ^ x is given by
and (^) 2 it can be noted that the kth finite difference can be written as
kp (^) n x a 0 n n 1 n 2 ........ n k 1 h kxn k^ pn k 1 x .......... ..... 3 replacing k by n in 3 yields np (^) n x a 0 n n 1 n 2 .......... .. 1 hnx^0 p 1 x a 0 n! hn p 1 x ......... 4 since
polynomials of negative degrees do not exists then npn x exists if p 1 x 0 and is given by
n^ p (^) n x a 0 n! h^ n , and the higher order finite differences equal to zero.
Example
The sales s x in thousands Kenya pounds from x hundreds bottle of baby shampoo sold is established to be given in the data below
x 1.2 1.4 1.6 1.8 2.0 2. s x^ 2.730^ 6.530^ 11.946^ 19.362^ 29.200^ 34. Determine the degree and the leading coefficient for the polynomial appropriate to approximate s x
Solution
Given data is equally spaced thus the finite difference of the same is
x f x f ^2 f ^3 f ^4 f ^5 f
As the 4th^ order finite differences tends to a constant then (^) s x can be approximated with a
Exercise
From this table it is noted that
i. Number of non-zero values in the columns of the finite differences increases with the increasing order of the difference ii. High order differences has alternating signs of different magnitude iii. The coefficients of the error (^) in the (^) nth order differences is the some as the binomial coefficients in the expansion of 1 x ^ n iv. Maximum finite difference in magnitude for difference of a given order is directly opposite the function value with an error
NB: If f *is the functional value with an error then the correct functional value is given by f f *
Example
Find and correct the error in the data given below hence state the degree of the polynomial appropriate to approximate the data
x 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5. f x^ 125.000^ 132.651^ 140.608^ 148.877^ 157.464^ 166.357^ 175.616^ 185.193^ 195.
Solution
As the data is equally spaced the finite difference table is as given below
x f x f ^2 f ^3 f ^4 f ^5 f
Then f x f s f A x x
f x f x x
f f i i i
i i i
i i ................. 1
(^1)
is said to be the linear forward
interpolation polynomial.
Example
The data in the table below give the total daily cost y in Kenya pounds of producing x dozens of chocolate chips cookies at different production levels
x 50 100 150 200 250 300 y 80 180 280 380 480 580 Approximate the cost of producing 120 dozens
Solution
Given data is equally spaced thus the finite difference table for the data is
x f x f ^2 f^ ^3 f ^4 f ^5 f 50 80 100 100 180 0 100 0 150 280 0 0 100 0 0
From the table the first order finite differences equal to a constant thus y can be approximate by a linear interpolation polynomial i.e. y yi s yi ........ 1 since x 120 is in between 100
and 150 the letting xi 100 then 0. 4 , 100 5
i (^) h i yi y s x x
substituting these in 1 yields y 120 180 0. 4 100 K £ 220
Exercise
(^) i i i i i
i i i
i i
f h
f x f f ch f c
f h f x a bh f b
f x a f
2 (^22) 2 2
1 1