Professional Documents
Culture Documents
1 00 1 000
f (x) = f (x0 ) + f 0 (x0 )(x x0 ) + f (x0 )(x x0 ) 2 + f (x0 )(x x0 ) 3 · · ·
2! 3!
where x0 = 0
f (x) = e 2x ! f (0) = 1
f 0 (x) = ( 2)e 2x ! f 0 (0) = 2
f 00 (x) = ( 2)2 e 2x ! f 00 (0) = ( 2)2
0
f (x) = ( 2) e3 2x ! f 000 (0) = ( 2)3
iv
f (x) = ( 2) e 4 2x ! f iv (0) = ( 2)4
Maclaurin series approx of f (x)
2x 22 2 23 3 24 4
e ⇡1 2x + x x + x + ···
2! 3! 4!
b) (4 marks) Use the expansion to estimate e 0.2 with at least 4 correct significant
figures. As part of your answer, add terms one at a time until the
relative percentage error is less than the stopping criterion for the
desired accuracy .
Solution:
Stopping criteria for three significant figure accuracy "s = 0.5 ⇥ 102 3% =
0.05%
Page 2 of 9
MTH 510 Midterm Test - (Solutions)
9 2. Solve the system of equation using Naive Gauss Elimination with partial pivoting.
Marks
2 32 3 2 3
0 2 5 x1 1
42 1 15 4x2 5 = 415
3 1 0 x3 2
Page 3 of 9
MTH 510 Midterm Test - (Solutions)
Backward substitution Ux = d
2 32 3 2 3 14.5
5 6 10 x1 0 x1 = (6x2 10x3 )/5 = 5(3.6) = 0.8056
40 4 3 5 4 5 4 5
x2 = 0 =) x2 = ( 3x3 )/(4) = 0.20833
0 0 3.6 x3 1 x3 = 1/3.6 = 0.2777
2 3
0.8056
A 1
=4 0.2083 5
0.2777
Page 4 of 9
MTH 510 Midterm Test - (Solutions)
6 4. Using Newton Raphson’s method find the root of the non-linear equation
Marks
x
e = ln x 1
with three significant digits accuracy. Start with initial guess x0 = 2.5.
f (xi ) e xi ln(xi ) + 1
xi+1 = xi = xi
f 0 (xi ) e xi 1/xi
First iteration starting with initial guess x0 = 2
The specified error for 3 significant digit accuracy "s = 0.5 ⇥ 102 3
% = 0.05%
Page 5 of 9
MTH 510 Midterm Test - (Solutions)
2 32 3 2 3
1 15 2 x1 2
40 2 6 5 4 x2 5 = 4 8 5
5 1 0 x3 1
using the initial trial vector x0 = [0 0 1]T . Iterate until all component-wise approx-
imate percentage relative errors fall below 5%.
Solution:
The coefficient matrix is not SDD, rearrange the rows;
2 32 3 2 3
5 1 0 x1 1
4 1 15 25 4 x2 5 = 4 2 5
0 2 6 x3 8
Now the coefficient matrix is strictly diagonal dominant and therefore should con-
verge for any initial starting vector.
(1) 1 0.2 0
x1 = = 0.2; ✏x1 = 100% = 100%
5 0.2
(1) 2 + 0 + 2(1) 4 (0.2667 0)
x2 = = = 0.2667; ✏x2 = 100% = 100%
15 15 0.2667
(1) 8 + 2(0) 1.3333 1
x3 = = 1.3333; ✏x3 = 100% = 0.25%
6 1.3333
⇥ ⇤
2nd Iteration with x(1) = 0.2 0.2667 1.3333
Page 6 of 9
MTH 510 Midterm Test - (Solutions)
Iteration 0 1 2 3
x1 0 0.2 0.2533 0.2649
x2 0 0.2667 0.3244 0.3398
x3 1 1.3333 1.4222 1.4415
" x1 100 21.1 4.4
" x2 100 18 4.5
" x3 0.25 6 1.3
The maximum component relative error max |"axi | < "s = 5%, stop!! the iteration.
The solution x = [0.2649 0.3398 1.4415]T with a maximum component wise er-
ror of 4.5% after 3 iterations.
Page 9 of 9