Lecture Note
University
California State UniversityCourse
Mathematics (MATH)Pages
20
Academic year
2023
yung dump
Views
0
UNIT-II 1 INTERPOLATION AND APPROXIMATION LAGRANGIAN POLYNOMIALS y f(x) = = (x-x)(x-22)(x-x3) Yo (x6-t1) (Xo-X2) (No-X3) + (x-xo) (r-12) (x-x) y, (x,-xo) (x,-22) (24-3(3) + (x->10) (2-21) (x-x3) Y2 (22-x6) (x2-x) (22-03) + (x-lo) (x-x) (x-x2) (x- In (x3-xo) (23-x4) (xg-12) (2n-26) O.Find the polynomial fox) by using Lagrange's formula and hence find f(3) for Xo 2 x2 23 x 2 5 12 147 2 3 f(x) yo y, Y2 43 Soln: By Lagrange's interpolation formucla, we have y. fla) = (x-x1) (x-x2) (x-x3) yo (20-21) ( xo-12) (x6-x3) + (x-xo) (x-x2) (x-13) 4, (24-X0) (x-x2) (x-xs) + (x-10) (x-x1) (x-x3) Y2 + (x-xo) (xs-x2) 43 (x-x1) (r-x2) (212-20) (22-X1) (x2-X3) (xs-xo) (23-x4) (0-1)(0-2)(0-5) (2-1) (x-2)(x-5) (2) + (x-0) (1-0) (1-2)(1-5) x-2) (2-5) (3) + (2-0)(2-1)(2-5) (x-9(x-1)(x-5) (12) (x-0) (x-1) (147) + (5-0) (5-1) (5-2) x(x-2)(x-5) (3) + (C-D(x-5) -6 (12) (x-1) (x-2)(x-5) (2) + 4 = (-10) + x(x-1) (x-2) (147) to 3(3-1)(3-5) (12) 3(3-2)(3-5) (3) + -6 y = f(3) = (3-1) (3-2) (3-5) (2) + 4 -10 + 3(3-1)(3-2) (147) 60
y = (2)(D(-2) (-10) (3)( ()(-2) 4 (3) + 3(2)(-2) (-6) (12) + (3) (2)(1) (147) 60 MO = 4 10 (2) - 4 6 (3) + 2(12) + to(47) 18-18 + 24 + 147 TO 10 =35 day Find the third degree polynomial txx) satisfying the following data r 1 3 5 y 24 120 336 720 som! Lagrange's interpolation formula is The y = f(x) = (%6-X2)(20-23) Yo + (x-10)(2-2))(x-xs) 4, (Xonte) (x-x1)(x-x3) Y2 + (x->10) l x-x4) (x-x2) Y3 + (a-xo) (2xx) (22-23) (75-xo) (23rtl) (x3-22) = (x-3) (x-5)(x-7) (24) + (x-D(x-5)(2-7) (3-1)(3-5)(3-7) (120) + (x-1)(x-3)(x-7) (5-1)(5-3)(5-7) (336) (22-10) (1-3) (1-5) (1-7) + (x-1) (r-3)(x-5) (720) (7-1)(7-3)(7-5) +15 = + = + = +15[x9-9x4+23x-15] = [ -12-15-21+15] of + [15-19 + [ 105 - 525 +441-225] 2 2 = f14) = 43 + +6(42) + 11(4) +6 = 64 + 96 +44 +6 = 210
3 using Lagrange's interpolation formala find f(4) given that 3 flo)= 2, f(1)=3, f(2)=12, ((15)=3587. = sohi- Given I 2 15 723123587 By Lagrange's formula f(x) = (x-x1) (x-x2) (x-x3) yo + (x-10) (2-x3) 9, (x-x2) J= (310-X1) (xo-x2) (%--3) 2-20) (21-22) (x1-23) + (x->6) - (x-4)(x-x3) Y2 + (x-ro) (2-x)(x-x2) Y3 (22-x) (x2-x)((X2-23) (23-X0) (23-21)(23-22) y= = f(4) = (4-1)(4-2)(4-15) (2) + (4-0) (4-2) (4-15) (3) (0-1) (0-2) (0-15) (1-9)(1-2)(1-15) + (4-0)(4-1)(4-15) (12) + (4-0) (4-1) (4-2) 3587 (2-0) (2-1) (2-15) (15-0) (15-1)(15-2) = (3) (2) (-11) (2) (4) (1) (2)(-11) (-1)(-14) + (4)(3)(-11) (2)(1)(-15) (12) + (-1)(-2)(-15) + (4)(3)(2) (3587) (15)04)(13) 86088 = 132 - 264 + 1584 26 + 2730 30 14 =78 of Find the missing term in the following table using Lagrange's interpolation a 0 1 2 3 4 y 439- - 81 Schn By Lagrange's interpolation formula Y= f(x) = (x-x)(x-xe)(x-x,), yot (2-20)(2-72)(x-23) y, (26-x4) (20-12) (26-23) + (a-xo) (x-x4) (x-x3) 1/2 + (x-xo) (x-x1)(x-x2) Y3 (22-76) (x3-x) (x3-x) (r3-X2)
set No =0 Y== X = 1 4 3 3 X2 =2 42 = 9 X3=4 Y3=81 y= f(x) = (x-1)(x-e)(x-4) (1)+ (x-0)(x-2)(x-4) (3) (0-1)(0-2)(0-4) (1-0)(1-2)(1-4) (x-c) (r-1)6-4) (9) + (2-0)(2-1)(x-2) (81) (2-0) (2-1)(2-4) (4-9)(4-1)(4-2) = (3-1)(3-2)(3-4) (1)+ (3-0) )(3-2)(3-4) (3) + (2)(2)(1) (a) (3-0) (3-1)(3-4) f(3) (-1)(-2)(-4) (1) C-1) (-3) (3-0)(3-1) (3-2) (81) + (4)(3)(2) (2)CHL-1) (1) + (3)(i)(-1) (3) + (3)(2)(-1) (2)(1)(-2) (9)+ (4)(3)(2) (3) (2)(1) (81) = (-1)(-2)(-4) (1)(-1)(-3) = -2 (1)-31+27 + 81 -8 2 4 = 4 -3+22+81 = 31 5 Find the parabola of the form y=ax2+bx+c passing through the points (0,0) (1,1) and (2 20) Sohn:- we use Lagrange's interpolation termula 9=flx) = (x-1)(x-2). + (0-1)(c--) (1-0) (1-2) (R-0) (2-1) = 0-x(x-2) - + 10x(x-1) y = 9x2-8x
Enverse interpolation 5 Taking y as Independent Variable x = to + (4-yo) (4-42)---(Y-Y) x (y-yo) + (y-yo) - (y-yn-1) in (yn-o) - . This is called formula of invorsion interpolation 1 Find the age corresponding to the annuity value 13.6 given the table. Age(x): 30 35 40 45 50 Annuity 15.9 14.9 14.1 13.3 12.5 value(y) Sohn:- (13-6 - 14.9) (13.6-14.1)(13-6-13-3) (13.6-12.5) 30 x = (15-9-149) (15-9-14-1) (15.9-13-3) (15-9-12-5) (13-6-15-9) (13-6-14-1) (13.6-13-3) (13.6 12.5) x35 + (14.9-15-9) (14-9-14-1) (14-9-13.3) (14.9-12.5) (13.6-15-9) 13.6-14-9) (13.6-13-3) (13.6-12.5) x40 + (14+1-159)(14.1-14-9) (14.7-13.3) (14.1-12.5) (13-6-15-9)(13-6-14-9) (13.6-14.1) (13.6-12.5) x45 + (13.3-15-9)(12:3-14-9) 13.3-14-1) (13.3-12.5) (13-6-15-9)(13-6-14-9) (13-6-14.1) (13.6-13-3) x 50 + (12.5-15-9) ( 12.5-14.9) (12.5-14.1) (12.5-13-3) in x(4=13.6)=43 Q do using 2 Find the value of o given flo) = 0.3887 where Ha) - // since the table o 2) 23 25 (6(0) 0.3706 0.4068 0.4433 Schn- NOW take flo) as independent and o as dependent
yflo) 0.3706 0.4068 0.4433 o: 21 23 25 (y-0.4068) (4-0.4433) x21 t (23) Q = (0.3706-0.4068) (0-3706-014433) (0.4068-0.3706)(0.4068-04433) (y-0.3706) (9-0.4068) x25 + (9=0.3887) = (0-3887-0.4068) ( 0.3887-0-4433) x21 (0.3706-0.4068)(0.3706-04433) - + (0.3887-0:3706) ( 0.3887-0.4433) 23 (0.4068-0.3706) (0-4068-0.4433) (0.3887-0.3706) 0.3887-0.4068) x25 + (0.4433-0.3706) ( 0-4433-0-4068) = 7.885832 + 17.202739-33.086525 = 22.0020 DIVDED DIFFERENCES TABLE > second divided Third divided Argument Entry divided 4 f(x) First difference difference x fol) difference 42 (1) 43 f(a)) xo f(a)) 6(26,2) 604) f(766,21,212,2(3) x *(24,x2) 92 fire) (124 x2 93) $ 122, 23) f(24,22,213,244) X3 flrs) (1x3,x4) x4 f(14) 4 Form the divided difference table for the following data:- 1 2 4 7 12 (6(2) /22 / 30 82/106 206
soh! 7 The divided difference table is as follows: & f(x) 4612) 400 4 fex) 4+6(2) I 22 30-22 =8 2-1 26-8-6 2 30 4-1 -3.6-6 82-30 0 26 7-1 4-2 8-26 0.51+1.6 4 82 = -3.6 12-1 106-82 7-2 = 8 1.5+36 0.19 -20.51 7-4 12-2 20-8 7 106 =1.5 12-4 206-106 =r 12-7 12 206 2 show that (1/a) = - abcd I bed soln:- If f(x) = 1/x f(a) = 1/a f(a,b) = 4(1)a) = 1/6-1/20 b b-a ab fla,h,c) = b(b,c)-t(a)5) c-a = it + 1/6 = abc ( (ii) = abc 1 c-a f (a, b, C, d) = f(b,c, d) - f(a,b,c) = bcd & - abc 1 = abed 1 and abcd I d-a - d- a 4 3 (1/2) = - abed bed Newton's divided difference formula (o1) Newton's interpolation for un equal intervals f(x) = f(x) + (x-x) f (xo,x) +(x-xo) (x-x) f (xo, 0,24 + + (2-)6) - (x-x) (x- In-1) f (xo,
1 using Netwon's divided difference sormula, find uls) given u(1) = -26, uc2)=12, 414) = 256, ul6) = 844. sohn:- we form the divided difference table since the Intervals are unequal a ww 4 ur) 4arr 4' GIX) 1 -26 12+26 2-1-38 2 12 122-38 4-1 43-28 256-12 4-2 122 6-1 =3 4 256 294-122 6-2-43 844-256 6-4-294 6 844 By Newton's divided difference interpolation formula f(x) = f(x)) + (x-xo) $1.70, x,|+(x-xo)(x-21) f xo, x)(2) + Here 40c) = a (r)o) Hx-xo) ul to, +/x-10) (x+x) u xo, x1,3(2) Xo=1, x, =2, Ag = 4, r3= 6 4(xo) = - 26, 4(10,04) 38 4170, 11,012) = 28, u (No, 94, x2, N3) 03 alx) = -26+ (x-1)38 6-1) ((x-2)28+(p(-1)(2-2)(2-4)3 4(3) = -26 + (2) (38) +(2) (1) (28) +(2) (1) (-1)(3) = - 26 +76 +56 -6 u(3) = 100. 2 Find f(x) as a polynomial in x for the following data by Newton's divided difference formula x -4 - o 2 5 for 1245 33 5 9 1335
80m 9 + r f(x) Afex 4f(x) Afix) -4 1245 33-1245 1-04-47-204 -1 33 -28-the 0-(-4) 5-33 10-94 2-28 2-(-4) 0-(-1) 2-(-28) 1341==3 0 5 =10 5-(-4) 2-(-1) 9-5=2 88-10 2-0 5-C-17=13 2 9 442-2 5-0 1335-9 5-2-2442 5 1335 Newton's divided difference interpolation Bormula for By = 6(xo)+(x-xo) (1xo,24) +(x-xo) (x-x) f(xo, t (x-xo) f(xo, x4) Here Xo = -4 x,=-1 x2=0 x3=2 2425 f(xo) = 1245 ((76,2) = -404 6(x0,24,x(2) = 94 6(x0, 21, 22, x3) =-14 = 3 f(x) = 1245 f + (x+4) ("++1)(x) (x-2) (3) = 1245 -404X-1616 + -14 [x2+52+4] 1245-4042 -1616 + 94x2. 707+376-1423 - -7022-56x _10xt42-8] = flox 14x3 +24% +10x +5 +3x4 + 15x3-24a -24x =
3 using Newton's divided difference formula find the missing value from the table. x 1 2 4 5 6 14 15 5 - 9 Soln:- a fox 4fix) 4fex) for 1 14 15-14 =1 2-1 2 15 -5-1 =-2 4+1 742 15/4 5-15 -5 4-2 6-5-14-14 4 5 2+5 6-2-14 9-5-2 =2 6-4 69 f(x) = f(x)) + (x-x) f(xx,x4) +(x-xo) (x-x) 6(20,24,22) +(x-%)(2-14)(9)-X2) + = 14+(a-1)(1) +(2-1)(x-2)(-2) +(+1-1)(1-2)(x-4)(34) = 14+x -1 -2(x-1) (x-2) + 6(51=13+5-2(4)(3) = + (4)(3)(1) = 18-24+9=3 INTERPOLATION WITH A CUBIC SPLINE Fermula:- b." (xx-1) (2(i-x)3 (fi(21) filz)= (a-xi-1) 6(xi-2(-1) 6121-X2-1) + f(xi-1) - (ai-x) ai-2i-1 6 + f(xi) (x-xi-1) (c) - xi-di-1 6
11 This equation contains only two unknowns - bue second delivatives at the end of each interest. These unknowns Can be evaluated using the following equation. (xi-x2-1) f" (xi-1) + 2 6 = [ (xi+1)-t(a)) + xi-di-1 6 _ [ 2 1 From the following table ri xi+1 ti-1 2 3 x Comput y(1.5) and y'(1) y 18-8 -1 18 using cubic Spline Soln! (ai (2) = + di-xi-1 6 - (2-1) 6"(1) +2(3-1) t"(2) + (3-2) 8" (3) = (3-2) 6 (18+1) + 2-1 $ 1-8+1] + 6(-7) at the end points, f"(2)==18 From(1) we get f(x)= ot to f"(2) (x-1)2 + (2-x) t (2-1) to 18(2-1)3 + (-8).(2-2) + [-1-3 [x-1] = 3(x-1)3 - s = = 3x3-92"+13-15 332-92-8
4(1.5) = 6(1.5) = y' f'cal) = i'll) = f'(1)=1 4 this Another method S(x) = in [(Gi-x)3 Mi-1 + (x-x(-1) mi] +1/1/2020 (x1-x) [ 9:-1-42 ML-1] + th (x-xi-1) [ 4: - "3/4 mi] Mc-1 +4 mi + Mi+1 = h2 for i=1,2,3..(nn) 1 From the following table: x 1 2 3 -8 -1 18 compute Y(1.5) and y'(1) using cubic Sprine sohn Here h=l, and n=2 also assume Mo=0 and M2 =0 we have Mi-1 +4mi + Mi+1 = -2% 4 yi+1] for i= 21,2nro(4-1) From this Mo + 4M, + M2 = 6[%-2y,+1y] 4m, = 6[-8-2(-1)- +18] = 72 M1=18 S(x) = 1 [ (ai-x) Mi-1 + 6h + 1/4 (" -- For < x 5 2 putting (=1 we get sla). = 1/ [18l2-1)3] + (2-x) (8)-4(x-1) = 3(x-1)3 +4x -12 = 3x -92 +13x-15
B = y'(1) =4. 2 Given the points and (x, o) satisfying the function Y= since determine the value of y(x/6) using the cubic spline approximation. *: T/2 X 1 0 schn Here h=Ty2 n= 2, also assume Mozo M2=0 we have Mi-1 +4Mi + Miti = 6 h2 -2Y +Yi+1] for is 1,2,000(4-1) From this Mo +4M, + M2 = 6 [0-2+0] = -48 (1)2) 2 4M, -48 R2 M1=-48 12 17 T2 = 2 in the interval [0, 3/2], the national cubic spline is given by 5,1x)= 6(T/2) [ (2c-0)3 (") + (7) [%-x] 1-1 1- = 3K = 3/Th -12 R2 xs] + 3k = 1/k [ x8] +32 = 3/2 x +3/2x]
+ = NEWTON FORWARD AND BACKWARD DIFFERENCE FORMULA Forward interpolation formula yir) = Yo + "if Dyo + 4(u-1) 2% + u(4-1)(4-2) A3yo 2 ! 3! where 4=x-x h r using Newton's forward Interpolation formula, find the polynomia for satisfying the following data. Have evaluate y at x25. 4 6 8 10 8 10 Sohn:- we form the difference table Ay d2y 43y x y (Yo) (4) 3-1=2(A)6) 5-2=3(12-00) *16 (y)3 8-3=5(A41) (22) 8 (22)8 There are only 4 data given.Hence the polynomial will be degree 3. y (x) = Yo + "If u Ayo + u/u-1) 2! A2 yo + u(4-1)(n-2) 3! 43% where u = x-ro Herexo =4, h= 6-4= 2 [difference] h 91x) = 1 + (x-4) (2) + (2)(4) 2 (3) t (x-4 x-l) 2 ( x-8) 2 (-b) 2! 3! = 1 x x - 4 + (x-4)(x-6) (3) + (x-4)(2-6)(2-8) (-6) 8 (8)(6) = x-3+ = x-3 + -10%+24] -1/8 [lx -10x+24) (a-8)]
15 = = - = y(5) = 1/8 (-5)+19(5)2-106 (5)+192] = +1 (125 7475 - 530 +192] / = /[]2] y(5) = 1.5. 2 A third degree polynomial passes through the points (0,-1)(1),1) (2, 1) and (3,-2) using Newton's forward interpolation formula find the Po Cynomial. Hence find the value at 1.5 Som we form the difference table x y Ay Ry 4y (20) 0 (4)-1 1+1=2(Ayo) 0-2=-2(A)6) (24) 1 (41) 1-1 =0 ( 4 y ) -3+2=-((A%) (ae) 2 (42) -3-0=-3(133) (23)3 (Y3)-2 There are only 4 data given. Hence the polynomial of degrees y(x) = t 4(4-1) 21 240 + 4/4-1)(4-2) 43yo S! where 4=2-10 h 90=0,421-021 (difference) Liker 2 + rx 3!
= -1 + x(x-1) - t c -1 x2 x - 1/6 x [x2-3x +2] = -x2 +3x -1 - +2x] = 1/6 [-6x"+182-6-2"+12" + + -ex] = -6] = y(1.5) = [(1.5)3 + 3(1.5)d - 16(1.5) +b] = +b] = -165-7-875] y (1.5) = 1.3125 3 From the data given below, find the number of students whose weight is between 60 to 70. weight in Lbs: 0-40 40-60 60-80 80-100 100-120 250 120 100 to 50 No. ofstudents: som Difference table a y (No.of Ay A2y Asy A4y weight Students) Below 40 250 120 Below 60 370 -20 100 -10 Below 80 470 20 -30 70 10 Below 100 540 -20 50 Below 120 590
17 set us calculate the number of students whose weight is less than 70. we will use forward difference formula u = x-xo = 70.40=1.5 h 20 y(70) = Yo tu Ayo + alu-1) 2%+ 2 250 + (1.5) ( (120) + (1.5) (0.5) (-20) + (15)(0.5)(-0.5) 6 (-10) = 2 + (1.5) (0.5)(-0-5)(-1-5) (20) 24 = 250+180 180-7.5+0.625 + 0.46875 = 423.59 = 424. Number of students whose weight is between bo and 70 = = Newton's backward interpolation formula y Yn + Vonyn + v(v+1) #Yy + V(V+1) 3! (v+2) 33yn+ V(V+1)(V+2)(V+3) 4! = 1! 2! D4Y + where V= x-an h 1 use Newton's backward difference formula to construct an interpolating polynomial of degree 3 for the data. 61-0.75) = Lo.07181250, 6(-0-25) = 0.33493750 f(0)=1.10100. Hence find f (-1/3) Schu:- Newton's backward difference formula is Yix) = Y3 + Y/ + v(v+1) D2Y3 + V(V+1)(VT2) D3Y3 2! 31 where V= x-x3 h
Here we for the difference table x y my viy sy (20)(-0-75) % -0.07181250 0.0470625 yo (x1)-0.5 -0.024750 0.312625 (3).20.09375 4/2 0.3596875 (x2)-0.25 0.33493750 43 (2)3)0-400375 (x3) o (743)0.7660625 1.10100 Here x3=0 h=0.25 V= 0.25 x = x =4x (/4) y(x) = 1.10100 + 4x (0.7660625) f 4x(4x+1) 2 (0.406375) + 4x(4x+D)4x42) (0.09375) 6 = 1-10100 + 3.06425 + -0.81275x 4)(+1) +0.06252(4X+D)4242) = 1.101+3.064252 +0.81275x + 0.0625x [ 16x2 +12% +2] =1.101 + 3.06425x + 3.251x2 +0.81275.x tx3 + 0.75x2 40.125X. To find b(-)s). y(-x)=(-x) +(4.001) ( s/2 + 4.002 (-1/3/+1.101 = 1/a) -4.002 ( ys) + 1.401 = 0.174518518 Ans 2 From the following table find the value of tan (0.28) x 0.10 0.15 0.20 0.25 0.30 Y=banx 0.1003 0.1511 0.2027 0.2533 0.3093
2 Idm: let us form she difference table x y Ay A2y A3y 44y o'lo 0.1003 0.0508 0.15 0.1511 0.0008 0.0002 0.0516 0-0002 0.20 0.2027 0.0010 0.25 0.0526 0.0004 0.2553 0.0014 0.0540 0.30 0.3093 since 0-28 lies in the end of the table, let us use Newton's backward interpolation formula f(x) = Yn + V 1 : yn + V(v+1) 2 + v(v+1) (V+2) 3yn + V(V+1)(V+2)U+3) 2! 3! 4! where V= x-xn = 0.28-0.30 = -0.04 [ : (n=0.30] h 0.05 y = 0.3093 + (-0.4) (0.0540) + (-0.4) (-0.4+1) (0.0014) 1 ! 2! + (-0.4) (-0.4+1) (-0.4+2) (0.0004) 3! T (-0.4) (-0.4+1)(-0.4+2) (-0.4+3) (0.0002) 4! y = 0.309-0.0216 - 0.000168 - 10,0000256-0.00000832 y = 0.28720.
UNIT-III Il Numerical Differentiation and Integration Derivatives From Difference tables - divided differences and Finite Differences Newton's forward difference formula Newton's forward difference interpolation formula is y ( x o u h ) = y(x) = Yo + usy + u(4-1) 42 Yo + u(4-1) (4-2) A3yot 2 ! 31 where y(x) is a polynomial of degree n in x and u x-sto = h dy = (dz) = ti AYo - -42yo + 1/3 33yo - 1/4 44%++--] day) = dx2 x=xo his h2 [42%- 43yo + 1/2 44% 1 d3y day ) = his [ 43y- 3/2 44yo+---] x=00 Newton's back ward difference formula Newton's backward difference formula is y(x) = = Yn + VDyn + V(V+1) 2! vey + V(v+1)(4+2) 31 where V= x-xo h ( dx ) x x x r = 1/2 [Dyn + + / d2y dxe ) = 1/2 [ 2 y n +v3y + 1/2 ] a=xn 1 d3y days) = 13 [0syn + 3/2 04 Yn+ ] x=tn Derivative using stirling formula The stirlings formula is you) = Yo +1/2/20 [AY +AYn-1] + 42 2 424-1 + n-3 12 [A'y - + 33y-2]. + 44-42 44 4-2 + 24
INTERPOLATION AND APPROXIMATION
Please or to post comments