Thursday, June 22, 2023

Solutions To Numerical Analysis Problems (Part 1)

 1) Evaluate:   x + 4 x  +   6 x + 2x + 2 

At x= 1.2, in 2 ways

Solutions:

a       a) 4 multiplications, 4 additions,

(((5x + 4)x + 6)x + 2) x+ 2) = 

(((5(1.2) + 4)1.2 + 6)1.2 + 2) 1.2 + 2)= 30.23

b)10 multiplications, 4 additions

5·x·x·x·x + 4·x·x·x + 6·x·x + 2·x + 2

= 5·(1.2)·(1.2)·(1.2)·(1.2) + 4·(1.2)·(1.2)·(1.2) +

6·(1.2)·(1.2) + 2·(1.2) + 2

= (10.368) + 6.912 +  8.64 + 2.4 + 2  =  30.23


2)Check to see if the series:

å ¥ n = 1   2 (x + 5)n   /n 2

Converges.

Solution:

Applying ratio test:

lim n® 0o     ÷ 2n+1  /n+1    (x + 5)n+1 ÷  

                             ----------------------------------------

                        ÷ 2n /n 2   (x + 5)n ÷


lim n® 0o      (n/n+1) 2   2÷ x + 5÷  =  2÷ x + 5÷ 

So this series will converge for those values of x for which:

2÷ x + 5÷   <   1  

or:   ÷ x + 5÷   <   1/2

This is the interval of convergence, with R = ½  the radius of convergence

Challenge Problem:

Use the Taylor series to 4th order (n = 4 or  P 4) to obtain the value of Ö 5

Solution:

To order 4:

P n  ==   f(4) + f ’(4) × (x – 4) + f ” (4)/ 2! (x – 4)2 +

….+   f ”’ (4) / 3! (x – 4) + iv (4)/ (4)! [(x- 4) 4]

The function of interest is: f(x) = x 1/2

The derivatives are:

f ’(x) = ½ x -1/2

f ’’(x) = -1/4 x -3/2

f ’’’(x) = -3/8  x -5/2

 iv (x) = -15/16  x -7/2

 

For n = 4 we have f(x) =  Ö 4  = 2

Therefore: Since (x - 4) = (5 – 4) = 1

P 4  =   f(x) +  f ’(x) + f ’’(x)/2! + f ’’’(x)/3!  + iv (x)/4! 

= 2 +  ½ x -1/2 + (-1/4 x -3/2 )/2! + (3/8  x -5/2 ) /3! +

(-15/16  x -7/2)/ 4!

Substituting order value (4):

P 4  =   f(4) +  f ’(4) + f ’’(4)/2! + f ’’’(4)/3!  + iv (4)/4! 

= 2 +  ½ (4) -1/2 + (-1/4 (4) -3/2 )/2! + (3/8  (4) -5/2 ) /3! +

(-15/16  (4) -7/2)/ 4!

Then:

P 4  =   2 + 0.25000 + (-0.01563) + 0.00195 + (-0.00183) = 

2.23602

Compared to table value of 2.23606

 

No comments: