Lecture notes on Numerical methods

lecture notes on numerical methods in engineering and sciences, lecture notes numerical methods for partial differential equations, lecture notes for statistics and numerical methods pdf free download
Prof.EvanBaros Profile Pic
Prof.EvanBaros,United Kingdom,Teacher
Published Date:26-07-2017
Your Website URL(Optional)
Comment
th B.Tech 4 Semester MATHEMATICS-IV UNIT-1 NUMERICAL METHOD We use numerical method to find approximate solution of problems by numerical calculations with aid of calculator. For better accuracy we have to minimize the error. Error = Exact value – Approximate value Absolute error = modulus of error Relative error = Absolute error / (Exact value) Percentage error = 100 X Relative error The error obtained due to rounding or chopping is called rounding error. For example π = 3.14159 is approximated as 3.141 for chopping (deleting all decimal) or 3.142 for rounding up to 3 decimal places. Significant digit: It is defined as the digits to the left of the first non-zero digit to fix the position of decimal point. For example each of following numbers has 5 significant digits. 0.00025610, 25.610, 25601, 25610 Solution of Equations by Iteration: Intermediate value Theorem: If a function f(x) is continuous in closed interval a,b and satisfies f(a)f(b) 0 then there exists atleast one real root of the equation f(x) = 0 in open interval (a,b). 2 Algebraic equations are equations containing algebraic terms ( different powers of x). For example x -7x+6=0 Transcendental equations are equations containing non-algebraic terms like trigonometric, exponential, x logarithmic terms. For example sin x – e = 0 A. Fixed point iteration method for solving equation f(x) = 0 Procedure Step-I We rewrite the equation f(x) = 0 of the form x = h(x), x=g(x), x = D(x) We find the interval (a,b) containing the solution (called root). Step-II We choose that form say x = h(x) which satisfies I h΄(x) I 1 in interval (a,b) containing the solution (called root). Step-III We take x = h(x ) as the successive formula to find approximate solution (root) of the n+1 n equation f(x) = 0 Step-III Let x=x be initial guess or initial approximation to the equation f(x) = 0 0 Then x =h(x ) , x =h(x ) , x =h(x ) and so on.We will continue this process till we get solution (root) of 1 1 2 2 3 3 the equation f(x) = 0 up to desired accuracy. Convergence condition for Fixed point iteration method If x=a is a root of the equation f(x) = 0 and the root is in interval (a, b). The function h΄(x) and h(x) defined by x = h(x) Is continuous in (a,b) .Then the approximations x =h(x ) , x =h(x ) , x =h(x ) ....... 1 1 2 2 3 3 converges to the root x=a provided I h΄(x) I 1 in interval (a,b) containing the root for all values of x. Problems 3 1. Solve x - sin x -1 =0 correct to two significant figures by fixed point iteration method correct up to 2 decimal places. 3 Solution: x - sin x -1 =0........ ......... ........ ........ ...(1) 3 Let f(x) = x -sin x -1 f(0) = -1, f(1)= - 0.8415, f(2)=6.0907 As f(1)f(2) 0 by Intermediate value Theorem the root of real root of the equation f(x) = 0 lies between 1 and 2 Let us rewrite the equation f(x) = 0 of the form x = h(x) 1/3 -1 3 x= (1 + Sin x) = h (x) and x = Sin (x - 1)= h (x) 1 2 We see that I h ΄(x) I 1 in interval (1,2) containing the root for all values of x. 1 1/3 We use x = (1 + Sin x ) as the successive formula to find approximate solution (root) of the n+1 n equation (1). Let x =1.5 be initial guess to the equation (1). 0 1/3 1/3 Then x = (1 + Sin x ) = (1 + Sin 1.5) = 1.963154 1 0 1/3 1/3 x = (1 + Sin x ) = (1 + Sin 1.963154) = 1.460827 2 1 1/3 1/3 x = (1 + Sin x ) = (1 + Sin 1.460827) = 1.440751 3 2 1/3 1/3 x = (1 + Sin x ) = (1 + Sin 1.440751) = 1.441289 4 3 which is the root of equation (1) correct to two decimal places. Newton Raphson Method Procedure Step-I We find the interval (a,b) containing the solution (called root) of the equation f(x) = 0 . Step-II Let x=x be initial guess or initial approximation to the equation f(x) = 0 0 Step-III We use x =x - f(x ) / f΄(x ) as the successive formula to find approximate solution (root) n+1 n n n of the equation f(x) = 0 Step-III Then x , x , x ............ and so on are calculated and we will continue this process till we get 1 2 3 root of the equation f(x) = 0 up to desired accuracy. 2. Solve x - 2sin x - 3 = 0 correct to two significant figures by Newton Raphson method correct up to 5 significant digits. Solution: x - 2sin x - 3 = 0........ ......... ........ ........ ...(2) Let f(x) = x-2sin x - 3 f(0) = -3, f(1)= -2 - 2 Sin 1 , f(2)= -1 - 2 Sin 2 ,f(3)= - 2 Sin 3, f(4)= 1- 2 Sin 4 f(-2)= -5 + 2 Sin 2 ,f(-1)= -4 + 2 sin 1 As f(3)f(4) 0 by Intermediate value Theorem the root of real root of the equation f(x) = 0 lies between 3 and 4 Let Let x =4 be the initial guess to the equation (2). 0 Then x = x - f(x ) / f΄(x ) = 2- f(2)/ f΄(2) = 3.09900 1 0 0 0 = x = x - f(x ) / f΄(x ) - 1.099- f(- 1.099)/ f΄(- 1.099) = 3.10448 2 1 1 1 x = x - f(x ) / f΄(x ) = 3.10450 3 2 2 2 x = x - f(x ) / f΄(x ) = 3.10451 4 3 3 3 which is the root of equation (2) correct to five significant digits. Secant Method Procedure Step-I We find the interval (a,b) containing the solution (called root) of the equation f(x) = 0 . Step-II Let x=x be initial guess or initial approximation to the equation f(x) = 0 0 Step-III We use x = x - (x - x )f(x ) / f(x ) - f(x ) as the successive formula to find n+1 n n n-1 n n n-1 approximate solution (root) of the equation f(x) = 0 Step-III Then x , x , x ............ and so on are calculated and we will continue this process till we get 1 2 3 root of the equation f(x) = 0 up to desired accuracy. x 3 . Solve Cos x = x e correct to two significant figures by Secant method correct up to 2 decimal places. x Solution: Cos x = x e ........ ......... ........ ........ ...(3) x Let f(x) = Cos x – x e f(0) = 1, f(1)= Cos 1 – e = - 2 .178 As f(0)f(1) 0 by Intermediate value Theorem the root of real root of the equation f(x) = 0 lies between 0 and 1 Let Let x = 0 and x = 1 be two initial guesses to the equation (3). 0 1 Then xxf (x )1 0f (1) 2.178 1 0 1 xx 1 1 0.31465 2 1 f (x ) f (x ) f (1) f (0) 3.178 1 0 0.31465 f(x )= f (0.31465)= Cos (0.31465) - 0.31465 e = 0.51987 2 xxf (x ) 0.314651f (0.31465 ) 2 1 2 xx 0.31465 0.44672 3 2 f (x ) f (x ) f (0.31465 ) f (1) 2 1 xxf (x ) 3 2 3 xx 0.64748 4 3 f (x ) f (x ) 3 2 xxf (x ) 4 3 4 xx 0.44545 5 4 f (x ) f (x ) 4 3 which is the root of equation (3) correct to two decimal places. 4 4. Solve x - x - 7 = 0 correct to two significant figures by Newton- Raphson method correct up to 6 significant digits. 4 Solution: x - x - 7 = 0........ ......... ........ ........ ...(4) 4 Let f(x) = x - x - 7 f(0) = -7, f(1)= -7 , f(2)= 5 As f(1)f(2) 0 by Intermediate value Theorem the root of real root of the equation f(x) = 0 lies between 1 and 2 Let Let x = 1.5 be the initial guess to the equation (2). 0 Then x = x - f(x ) / f΄(x ) = 1.5 - f(1.5)/ f΄(1.5) = 1.78541 1 0 0 0 = x = x - f(x ) / f΄(x ) 1.7854- f1.7854)/ f΄(1.7854) = 1.85876 2 1 1 1 x = x - f(x ) / f΄(x ) = 1.85643 3 2 2 2 x = x - f(x ) / f΄(x ) = 1.85632 4 3 3 3 which is the root of equation (2) correct to 6S. INTERPOLATION Interpolation is the method of finding value of the dependent variable y at any point x using the following given data. x x x x x .. .. .. x 0 1 2 3 n y y y y y .. .. .. y 0 1 2 3 n This means that for the function y = f(x) the known values at x = x , x , x ,........., x are respectively 0 1 2 n y = y ,y , y ,.........,y and we want to find value of y at any point x. 0 1 2 n For this purpose we fit a polynomial to these datas called interpolating polynomial. After getting the polynomial p(x) which is an approximation to f(x), we can find the value of y at any point x. Finite difference operators Let us take equispaced points x , x , x ,........., x 0 1 2 n i.e. x = x + h, x = x + h, ......................, x = x + h 1 0 2 1 n n - 1 Forward difference operator Δ y = y - y n n + 1 n Backward difference operator  y = y - y n n n - 1 Central difference operator δy = y - y i i + 1/2 i – ½ Shift Operator E y = y i i+1 Newton’s Forward difference Interpolation formula Let us take the equi-spaced points x , x = x + h, x = x + h, ......................, x = x + h 0 1 0 2 1 n n - 1 Then Δ y = y - y is called the first Forward difference n n + 1 n i.e. Δ y = y - y , Δ y = y - y and so on. 0 1 0 1 2 1 2 Δ y = Δ y - Δ y is called the second Forward difference n n + 1 n 2 2 i.e. Δ y = Δ y - Δ y , Δ y = Δ y - Δ y and so on. 0 1 0 1 2 1 Newton’s Forward difference Interpolation formula is 2 3 Pn (x) = y + p Δ y + p(p – 1)/2 Δ y + p(p – 1) (p – 2)/3 Δ y 0 0 0 0 n + ...................... + p(p – 1) (p – 2).......(p-n-1)/n Δ y 0 Where p = (x - x0)/h Problems 5. Using following data find the Newton’s interpolating polynomial and also find the value of y at x=5 x 0 10 20 30 40 y 7 18 32 48 85 Solution Here x = 0, x = 10, x = 20, x = 30, x = 40, 0 1 2 3 4 x - x = 10 = x - x = x - x = x - x 1 0 2 1 3 2 4 3 The given data is equispaced. As x= 5 lies between 0 and 10 and at the start of the table and data is equispaced, we have to use Newton’s forward difference Interpolation. Forward difference table 2 3 4 x y Δ y Δ y Δ y Δ y 0 7 11 10 18 03 14 02 20 32 05 10 19 12 30 51 17 36 40 87 Here x = 0, y = 7, h= x - x = 10-0 = 10 0 0 1 0 2 Δ y = 11 , Δ y =3 , 0 0 3 4 Δ y = 2, Δ y =10 0 0 p = (x - x )/h = (x - 0)/10 = 0.1x 0 2 3 P (x) = y + p Δ y + p(p – 1)/2 Δ y + p(p – 1) (p – 2)/3 Δ y n 0 0 0 0 4 + p(p – 1) (p – 2)(p-3)/4 Δ y 0 = 7 + 0.1x (11) + 0.1x(0.1x - 1)/2 (3) + 0.1x(0.1x - 1) (0.1x - 2)/3 (2) + 0.1x(0.1x - 1) (0.1x - 2) (0.1x - 3)/4 (10) 2 3 2 = 7 + 1.1x + (0.01x - 0.1x)1.5 + (0.001x - 0.03x +0. 2x)/3 4 3 2 + 0.416 ( 0.0001x - 0.006x +0. 11x -0.6x) 4 3 2 P (x) = 0.0000416 x - 0.0022 x +0.05x + 1.26 x +7 n Is the Newton’s interpolating polynomial To find the approximate value of y at x=5 we put x=5 in the interpolating polynomial to get 4 3 2 y(5)=P (5) = 0.0000416 (5) - 0.0022 (5) +0.05(5) + 1.26 (5) +7 = 14.301 n 6. Using following data find the Newton’s interpolating polynomial and also find the value of y at x=24 x 20 35 50 65 80 y 3 11 24 50 98 Solution Here x = 20, x = 35, x = 50, x = 65, x = 80, 0 1 2 3 4 x - x = 15 = x - x = x - x = x - x 1 0 2 1 3 2 4 3 The given data is equispaced. As x= 24 lies between 20 and 35 and at the start of the table and data is equispaced, we have to use Newton’s forward difference Interpolation. Here x = 20, y = 3, h= x - x = 35 - 20 = 15 0 0 1 0 2 Δ y = 8 , Δ y = 5 , 0 0 3 4 Δ y = 8, Δ y = 1 0 0 p = (x - x )/h = (x - 20)/15 = 0.0666 x - 1.333333 0 Forward difference table 2 3 4 x y Δ y Δ y Δ y Δ y 20 3 8 35 11 05 13 08 50 24 13 01 26 9 65 50 22 48 80 98 2 3 P (x) = y + p Δ y + p(p – 1)/2 Δ y + p(p – 1) (p – 2)/3 Δ y n 0 0 0 0 4 + p(p – 1) (p – 2)(p-3)/4 Δ y 0 = 3 + 8 (0.0666 x - 1.333333) + 5(0.0666 x - 1.333333) (0.0666 x - 2.333333)/2 + 8 (0.0666 x - 1.333333) (0.0666 x - 2.333333) (0.0666 x - 3.333333) /3 + (0.0666 x - 1.333333) (0.0666 x - 2.333333) (0.0666 x - 3.333333) (0.0666 x - 4.333333) /4 2 = 3 + 0.53333333 x - 10.666666 + 0.01111x -0.16666666 x + 7.777777 + (0.5333333 x - 10.66666) (0.0666 x - 2.333333) (0.011111 x - 0.5555555) + (0.0666 x - 1.333333) (0.0666 x - 2.333333) (0.011111 x - 0.5555555) (0.01666 x - 1.083333) Is the Newton’s interpolating polynomial To find the approximate value of y at x = 24 we put x = 24 in the interpolating polynomial to get 2 y(24) = P (24) = 3 + (0.53333333)24 - 10.666666 + 0.01111(24 ) – (0.16666666)24 + 7.777777 n + (0.5333333(24) - 10.66666) (0.0666 (24) - 2.333333) (0.011111 (24) - 0.5555555) + (1.59999 - 1.333333)( 1.59999 - 2.333333) (0.266666 - 0.5555555) (0.399999 - 1.083333) Newton’s Backward difference Interpolation formula Let us take the equi-spaced points x , x = x + h, x = x + h, ......................, x = x + h 0 1 0 2 1 n n - 1 Then  y = y - y is called the first backward difference n n n - 1 i.e.  y = y - y ,  y = y - y and so on. 1 1 0 2 2 1 2  y =  y -  y is called the second backward difference n n n - 1 2 2 i.e.  y =  y -  y ,  y =  y -  y and so on. 1 1 0 2 2 1 Newton’s backward difference Interpolation formula is 2 3  Pn (x) = y + p y + p(p + 1)/2 y + p(p + 1) (p + 2)/3 y n n n n n  + ...................... + p(p + 1) (p+ 2).......(p +n - 1)/n y n Where p = (x - x )/h n 7. Using following data to find the value of y at x = 35 x 0 10 20 30 40 y 7 18 32 48 85 Solution : Here x = 0, x = 10, x = 20, x = 30, x = 40, 0 1 2 3 4 x - x = 10 = x - x = x - x = x - x 1 0 2 1 3 2 4 3 The given data is equispaced. As x= 35 lies between 3 0 and 40 and at the end of the table and given data is equispaced ,we have to use Newton’s Backward difference Interpolation. Here x = 35, x = 40, y = 87, h= x - x = 10-0 = 10 n n 1 0 2  y = 36 , y = 17 , n n 3 4  y = 12, y =10 n n p = (x - x )/h = (35 - 40)/10 = -0.5 n Backward difference table 2 3 4 x y Δ y Δ y Δ y Δ y 0 7 11 10 18 03 14 02 20 32 05 10 19 12 30 51 17 36 40 87 2 3 P (x) = y + p y + p(p + 1)/2  y + p(p + 1) (p + 2)/3  y n n n n n 4 + p(p + 1) (p+ 2)(p +3)/4  y n = 87 + (-0.5) (36) + (-0.5) (-0.5+1) (17) /2 + (-0.5) (-0.5+1) (-0.5+2) (12) /3 + (-0.5) (-0.5+1) (-0.5+2) (-0.5+3) (10) /4 = 87 – 18 – 0.25(8.5) - 0.25(18)/6 – 0.25(15)(2.5)/24 = 65.734375 This is the approximate value of y at x=35 y(35)=P (35) = 65.734375 n Inverse Interpolation The process of finding the independent variable x for given values of f(x) is called Inverse Interpolation . 8. Solve ln x = 1.3 by inverse Interpolation using x= G(y) with G(1)=2.718 ,G(1.5)= 4.481 , G(2)= 7.387 ,G(2.5)= 12.179 and find value of x Forward difference table 2 3 y x Δ y Δ y Δ y 1 2.718 1.763 1.5 4.481 1.143 2.906 0.743 2 7.387 1.886 4.792 2.5 12.179 Here y = 1, h=y - y = 1.5 - 1 = 0.5 0 1 0 2 x = 2.718, Δ x = 1.763 , Δ x = 1.143 , 0 0 0 3 Δ x = 0.743 0 p = (y - y )/h = (1.3 - 1)/0.5 = 0.6 0 Newton’s Forward difference Interpolation formula is 2 3 Pn (y) = x + p Δx + p(p – 1)/2 Δ x + p(p – 1) (p – 2)/3 Δ x 0 0 0 0 = 2.718 + 0.6 (1.763)+ 0.6(0.6-1)1.143/2 + 0.6(0.6-1) (0.6-2)0.743/6 = 3.680248 Lagrange Interpolation (data may not be equispaced) Lagrange Interpolation can be applied to arbitrary spaced data. Linear interpolation is interpolation by the line through points (x ,y ) and (x ,y ) 1 1 0 0 Linear interpolation is P (x)= l y + l y 1 0 0 1 1 Where l = (x- x ) /( x - x ) and l = (x- x ) /( x - x ) 0 1 0 1 1 0 1 0 Quadratic Lagrange Interpolation is the Interpolation through three given points (x ,y ) , (x ,y ) and 2 2 1 1 (x ,y ) given by the formula 0 0 P (x)= l y + l y + l y 2 0 0 1 1 2 2 xxxxxxxxxxxx 2 1 2 0 1 0 Where l , l and l 0 1 2 xxxxxxxxxxxx 0 2 0 1 1 2 1 0 2 1 2 0 9. Using quadratic Lagrange Interpolation find the Lagrange interpolating polynomial P (x) 2 and hence find value of y at x=2 Given y(0) = 15, y(1) = 48, y(5) = 85 Solution : Here x = 0, x = 1, x = 5 and y = 15, y = 48, y = 85 0 1 2 0 1 2 x1 - x0 = 1 ≠ x2 - x1 = 4 The given data is not equispaced. 2 x xx x x 5 x1x 6x 5 2 1 l 0 x xx x0 501 5 0 2 0 1 2 x xx xx 5x 0x 5x 2 0 l 1 x xx x1 51 0 4 1 2 1 0 2 x xx xx1x 0x x 1 0 and l 2 x xx x515 0 20 2 1 2 0 2 2 2 x 6x 5x 5xxx yl yl yl y 15 48 85 0 0 1 1 2 2 5 4 20 2  4.75x 37.75x15 Which is the Lagrange interpolating polynomial P (x) 2 2 Hence at x=2 the value is P (2) = - 4.75(2 )+37.75(2)+15 = 71.5 2 General Lagrange Interpolation is the Interpolation through n given points (x ,y ), (x ,y ) , 0 0 1 1 (x ,y )....................... , (x ,y ) given by the formula 2 2 n n P (x)= l y + l y + l y + ................ + l y n 0 0 1 1 2 2 n n xx................xxxx n 2 1 Where l 0  xx ................xx xx 0 n 0 2 0 1 x x................x xx x n 2 0 l 1  x x ................x x x x 1 n 1 2 1 0 x x.................. .x xx x n 1 0 l 2 x x.................x xx x 2 n 2 1 2 0 ......... ........... x x.................. .x xx x n1 1 0 and l n  x x .................x x x x n n1 2 1 2 0 10. Using Lagrange Interpolation find the value of y at x=8 Given y(0) = 18, y(1) = 42, y(7) = 57 and y(9) = 90 Solution : Here x = 0, x = 1, x = 7, x = 9 and y = 26, y = 40, y = 75, y = 90 0 1 2 3 0 1 2 3 x - x = 1 ≠ x - x = 6 1 0 2 1 The given data is not equispaced.  x x x x x x8 98 781 7 1 3 2 1 l 0 x xx xx x0 90 701 63 9 0 3 0 2 0 1 x xx xx x8 98 78 0 8 1 3 2 0 l 1 x xx xx x1 91 71 048 6 1 3 1 2 1 0 x xx xx x8 9818 0 56 2 3 1 0 l 2 x xx xx x7 9717 084 3 2 3 2 1 2 0 x xx xx x 8 7818 0 56 7 2 1 0 and l 3  x x x x x x 9 7 91 9 0 144 18 3 2 3 1 3 0 1 1 2 7 yl yl yl yl y18425790 0 0 1 1 2 2 3 3 9 6 3 18  2 7 38 35 82 Which is the value of y at x=8 Newton divided difference Interpolation (data may not be equispaced) Newton divided difference Interpolation can be applied to arbitrary spaced data. The first divided difference is f x , x = (y - y )/ (x - x ) 0 1 1 0 1 0 f x , x = (y - y )/ (x - x ) 1 2 2 1 2 1 The second divided difference is f x , x - f x , x 1 2 0 1 f x , x , x  0 1 2 x x 2 0 f x , x - f x , x 2 3 1 2 f x , x , x  1 2 3 x x 3 1 The third divided difference is f x , x , x - f x , x , x 1 2 3 0 1 2 f x , x , x , x  0 1 2 3 xx 3 0 The nth divided difference is f x , x , x ,......., x - f x , x , x ,......., x 1 2 3 n 0 1 2 n-1 f x , x , x , x ,......., x  0 1 2 3 n xx n 0 Newton divided difference Interpolation formula is Y = y + (x-x ) f x , x + (x-x ) (x-x ) f x , x , x + ............ 0 0 0 1 0 1 0 1 2 + (x-x ) (x-x ) .......... (x-x ) f x , x , x ,............,x 0 1 n-1 0 1 2. n Problems 11. Using following data find the Newton’s divided difference interpolating polynomial and also find the value of y at x= 15 x 0 6 20 45 y 30 48 88 238 Newton’s divided difference table First divided Second divided Third divided x y difference difference difference 0 30 (48-30)/6=3 6 48 (8-3)/11=0.45 (88-48)/5=8 (0.1 -0.45)/26 = -0.0136 11 88 (10-8)/20=0.1 (238-88)/15=10 26 238 Y = y + (x-x ) f x , x + (x-x ) (x-x ) f x , x , x 0 0 0 1 0 1 0 1 2 + (x-x ) (x-x )(x-x ) f x , x , x ,x 0 1 2 0 1 2. 3 = 30 + 3x + x(x-6) (0.45) + x(x-6)(x-11)( -0.0136) The value of y at x= 15 = 30 +3(15) +15(9)(0.45)+ 15(9)(4)(-0.0136) = 128.406 NUMERICAL DIFFERENTIATION When a function y = f(x) is unknown but its values are given at some points like (x , y ), (x y ), 0 0 1, 1 .......... (x , y ) or in form of a table, then we can differentiate using numerical differentiation. n n Sometimes it is difficult to differentiate a composite or complicated function which can be done easily in less time and less number of steps by numerical differentiation. We use following methods for numerical differentiation. (i) Method based on finite difference operators (ii) Method based on Interpolation (i) Method based on finite difference operators Newton’s forward difference Interpolation formula is 2 3 Pn (x) = y + p Δy + p(p – 1)/2 Δ y + p(p – 1) (p – 2)/3 Δ y + .................... 0 0 0 0 where p = (x - x )/h 0 Newton’s backward difference Interpolation formula is 2 3 Pn (x) = y + p y + p(p + 1)/2  y + p(p + 1) (p + 2)/3  y n n n n n + ...................... + p(p + 1) (p+ 2).......(p +n - 1)/n  y n where p = (x - xn)/h Using forward difference the formula for numerical differentiation is 2 3 y΄ (x ) = (1/h) Δy - Δ y /2 + Δ y /3 + .................... 0 0 0 0 2 2 3 4 y΄΄ (x ) = (1/h ) Δ y - Δ y + (11/12) Δ y .............. 0 0 0 0 Using backward difference the formula for numerical differentiation is 2 3 y΄ (x )= (1/h)  y +  y /2 +  y /3 + .................... n n n n 2 2 3 4 y΄΄ (x )= (1/ h )  y +  y + (11/12)  y ................ n n n n If we consider the first term only the formula becomes y΄ (x ) = (1/h) Δy = (y - y )/ h 0 0 1 0 2 2 2 y΄΄ (x ) = (1/h ) Δ y = (Δ y - Δ y )/ h 0 0 1 0 2 2 = (y - y )-(y - y ) / h = y - 2y + y / h 2 1 1 0 2 1 0 12. Using following data find the first and second derivative of y at x=0 x 0 10 20 30 40 y 7 18 32 48 85 Solution Here x = 0, x = 10, x = 20, x = 30, x = 40 0 1 2 3 4 Forward difference table 2 3 4 x y Δ y Δ y Δ y Δ y 0 7 11 10 18 03 14 02 20 32 05 10 19 12 30 51 17 36 40 87 Here x = 0, y = 7, h= x - x = 10-0 = 10 0 0 1 0 2 Δ y = 11 , Δ y =3 , 0 0 3 4 Δ y = 2, Δ y =10 0 0 p = (x - x )/h = (4 - 0)/10 = 0.4 0 2 3 4 y΄ (x0) = (1/h) Δy0 - Δ y0 /2 + Δ y0 /3 - Δ y0 /4 + .................... =0.1 11 – 3/2 + 2/3 – 10/4 = 0.7666 2 2 3 4 y΄΄ (x ) = (1/h ) Δ y - Δ y + (11/12) Δ y .............. 0 0 0 0 = (1/100) 3 - 2 + (11/12) 10 = 0.10166 (ii) Method based on Interpolation Linear Interpolation y(x ) - y(x ) y y 1 0 1 0  y (x ) 0 x x x x 1 0 1 0 Quadratic Interpolation y΄ (x ) = ( -3y + 4 y – y ) /(2h) 0 0 1 2 y΄ (x1) = (y2 - y0 ) /(2h) y΄ (x ) = ( y - 4 y + 3 y ) /(2h) 2 0 1 2 The second derivative is constant i.e. same at all points because of quadratic interpolation and the interpolating polynomial is of degree two. Hence we must have y΄΄(x ) = ( y -2 y + y ) /(2h) 0 0 1 2 y΄΄ (x ) = ( y -2 y + y ) /(2h) 1 0 1 2 y΄΄ (x ) = ( y -2 y + y ) /(2h) 2 0 1 2 Problems 13. Using following data find the value of first and second derivatives of y at x=30 x 10 30 50 y 42 64 88 Solution Here x = 10, x = 30, x = 50, h= x - x = 30 - 10 = 20 0 1 2 1 0 y = 42, y = 64, y = 88 0 1 2 Linear Interpolation y(x ) - y(x ) y y 64 42 1 0 1 0  y (x ) 1.1 0 x x x x 3010 1 0 1 0 Quadratic Interpolation y΄ (x ) = ( -3y + 4 y – y ) /(2h) = -3(42) + 4 (64) – 88 /40 = 1.05 0 0 1 2 y΄ (x ) = (y - y ) /(2h) = (88 - 42 ) / 40 = 1.15 1 2 0 y΄ (x ) = ( y - 4 y + 3 y ) /(2h) = ( 42 - 256 + 264 ) / 40 = 1.25 2 0 1 2 y΄΄(x ) = ( y -2 y + y ) /(2h) = ( 42 - 128 + 88 ) / 40 = 0.05 0 0 1 2 14. Using following data find the value of first and second derivatives of y at x=12 x 0 10 20 30 40 y 7 18 32 48 85 Solution Here x = 0, x = 10, x = 20, x = 30, x = 40, 0 1 2 3 4 Forward difference table 2 3 4 x y Δ y Δ y Δ y Δ y 0 7 11 10 18 03 14 02 20 32 05 10 19 12 30 51 17 36 40 87 Here x = 0, y = 7, h= x - x = 10-0 = 10 0 0 1 0 2 Δ y = 11 , Δ y =3 , 0 0 3 4 Δ y0 = 2, Δ y0 =10 p = (x - x )/h = (x - 0)/10 = 0.1x 0 2 3 P (x) = y + p Δ y + p(p – 1)/2 Δ y + p(p – 1) (p – 2)/3 Δ y n 0 0 0 0 4 + p(p – 1) (p – 2)(p-3)/4 Δ y 0 = 7 + 0.1x (11) + 0.1x(0.1x - 1)/2 (3) + 0.1x(0.1x - 1) (0.1x - 2)/3 (2) + 0.1x(0.1x - 1) (0.1x - 2) (0.1x - 3)/4 (10) 2 3 2 = 7 + 1.1x + (0.01x - 0.1x)1.5 + (0.001x - 0.03x +0. 2x)/3 4 3 2 + 0.416 ( 0.0001x - 0.006x +0. 11x -0.6x) 4 3 2 y= P (x) = 0.0000416 x - 0.0022 x +0.05x + 1.26 x +7 ...........................(1) n Differentiating (1) w.r. to x we get 3 2 y΄= 0.0001664 x - 0.0066 x +0.1 x + 1.26 .................................... (2) y΄(12) = 1.7971392 at x =12 Differentiating (2) w.r. to x we get 2 y΄΄= 0.0004992 x - 0.0132 x +0.1 y΄΄(12) = 0.0134848 at x =12 NUMERICAL INTEGRATION b f (x) dx Consider the integral I =  a Where integrand f(x) is a given function and a, b are known which are end points of the interval a, b Either f(x) is given or a table of values of f(x) are given. Let us divide the interval a, b into n number of equal subintervals so that length of each subinterval is h = (b – a)/n The end points of subintervals are a=x , x , x , x , ............. , x = b 0 1 2 3 n Trapezoidal Rule of integration Let us approximate integrand f by a line segment in each subinterval. Then coordinate of end points of subintervals are (x , y ), ( x , y ) , (x , y ), ............. ,( x , y ). Then from x=a to x=b the area under 0 0 1 1 2 2 n n curve of y = f(x) is approximately equal to sum of the areas of n trapezoids of each n subintervals. b f (x) dx So the integral I = = (h/2) y + y +(h/2) y + y +(h/2) y + y 0 1 1 2 2 3  a + .................. +(h/2) y + y n-1 n = (h/2) y + y + y + y + y + y + .................. + y + y 0 1 1 2 2 3 n-1 n = (h/2) y + y + 2(y + y + y + .................. + y ) 0 n 1 2 3 n-1 Which is called trapezoidal rule. ba 2  h f( ) The error in trapezoidal rule is where a θ b 12 Simpsons rule of Numerical integration (Simpsons 1/3rd rule) b Consider the integral I = f (x) dx  a Where integrand f(x) is a given function and a, b are known which are end points of the interval a, b Either f(x) is given or a table of values of f(x) are given.

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.