0% found this document useful (0 votes)
54 views

Numerical Integration

Uploaded by

Gyanendra Roka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
54 views

Numerical Integration

Uploaded by

Gyanendra Roka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 29
Unit 5: Numerical Integration, (8 hours) SA 5:2, 3.3 5.4 5.5 5.6 Integration Definite integral and area computation Trapezoidal rule Estimation of errors Simpson's rules Estimation of errors Chapter Numerical Integration Definite Integral and Area Computation ‘The area bounded by regular plane figure such as triangle, quadrilateral, cirele ete. can be calculated by using formulae. But the area bounded by the curve of a function cannot be calculated by such method. The area bounded by the curve can be calculated by using definite integral. Lety = f(x) be a curve and if F(x) is an integral of f(x), ie, f f(x) dx = F(x), then the difference of the value of integral F(x) for two different values of independent variable x, ie. F(b) ~ F(a) for x=a to x= b is called the definite . integral of f{x) over the interval [a, b] and denoted by f f{x)dx , Le. Jf fox)dx = FQ) — F(@), the values x = a and x = b are respectively called the lower and upper limi y =f) 120 ...Applied Mathemati “To calculate the approximate area bounded by CUrVe, We Use ditfeey, Here, we discuss trapezoidal and Simpsons rules. Aig, 5.1 Trapezoidal Rule Let f be defined on the closed interval [a, b]. Let us consider thy enclosed by the curve f(x), the ordinates = b and the x-axis ay in the following figure. 8 show y fs) fx) Hex 1055-1) D co) 4x, Al ax | ax | ax | ax | ax | ax, | dx | ax Ls x mora xy a Mob Letus divide [a,b] into m equal parts, each of length Ax = Hoy Ky Xap ons Xe ty Xe Her tx), fh crite be pea nego a = bythe pi Hotei) fsa) se a 1 Xe Tespectively. By joining tt consecutive points f), fi), fs) On the graph, we get a trapennids. Te ‘area under the curve is approximated by the sum of the areas of these ® trapezoids. e eta Here, area of trapezoid ABCD (Ist trapezoid) in the figure = 7 sum of parallel sides * Perpendicular dist. between parallel sid®S 1 7 Ul) + a] ax ‘Now, area under the curve = sum of n trapezoids ji : = laa) + x) dx + Fox) + A a ot Le 89 -z~A ‘Numerical Integration...121 Usa) + 20081) + 2864-1) Fxg] AR bea OE fle) + Aba) + + 20a) + fhe] reef) x =F lc) + 2x1) + 202) +. + 2A 1) + AE) h anh aayan=iyor2y $292 +2 + Ya Estimation of Error The trapezoidal error or error relative to trapezoidal rule is the difference between the actual value of the integral ffx) and. the coresponding approximated value obtained from trapezoidal rule, With the application of techniques of calculus, itis estimated in the following way: Erin pei le! 20, here Mi he argent of Fn he ceed traf, Evaluate using Trapezoidal rule {- 42%z,n= 4. Also estimate error. 1 Solution: Here,n=4,a=1,0=2 bea 2-1 25 Here, dividing the intervals (1, 2] into 4 equal sub-intervals of length 0.25, we get 1, 1.25} [1.25, 1.5}, (15, 1.75} (1.75, 21. 1 “The values ofthe funtion y= (8) =p a the end points ofthe sub- intervals are given below: End poins [gel pets [eS [ap=ts Tue? w= 05 |, o.4444 | yo=0.4000 | y= 03636 | ye= 0333 122... Applied Mathematics Now, by using trapezoidal rule, we have 2 SE Poor rapt 29,499 1 125, TY (05+ 204444 + 04000 +03636 44355 = 0.125 (0.5 +2 * 1.208 +0333) 125 x 3.2493, 4061625, 2 Tex MPO =TE yt M-= Maximum value of |" (x) |erbap | iat ates nah Tpeg?* 0.25 = 0.0013, 2 Boat ing acl ale negra f= tn 1 absolute error from the actual value, Solutio Here, n= 4 and length of each sub interval (h 'm order to divide the interval [1, 2] into four sub-intervals, we have! Consider ive pints x= 1, xy = 1.25, xp = 15,5 = 15,5472 a Evaluating the values of fx) at these points we get the following wt Exdpoinsot | xy=1 | x,=125] amis we? sibineral tw=3 | 190000 | os4oo0 | ossaas | 0.32650 | 028° By using the trapezoidal rule, we have UMxo)+ 2fx1)+ 209) + 2ft5) + faa] Numerical Integration...123 025, [1.00000 + 0.64000 + 0 44444+0.32650) + 0.25000} 0.125 [4.07188] = 0.508985 = 0.509 (rounding off the digits.) 2 To estimate the error, we should find the actual value of integral f°. Now, error " rade Using raezidal ae evaluate 8, When n= 2, h= (0.5; and three points to be considered are xp = 0, x; = 0.5 and x, = | and the values of the function at these points are tabulated below: end points [xo=0 |xi=05 | m= 1 08 05 1 yee ee S11 416405) 715 Ans A Approximate the valu using trapezoidal rule for fe dxyn=2. 1 Solution: Here, h | 128 Applied Mathematics Clearly, three points - 1,0, 1 divide the interval [1,1] ino crrimerale cach of length h= 1 The values ofthe function se 2! ona 1 are shown in the following table. End points |xo=—1 x=0 x= 1 Vee el eat Pea By trapezoidal rule, we have J eaed Je dx=F yet 291+ ya) aflernied] 1 Lee+2+1 (e+1F ales | BITS i Using rapenada rate evaluate ix xn =2. Solution: Here, n=2,, values of the function f{x) = sin at these points are given, a ~ x! ai End poins | xy=0 fix)=ysinx | 0 084 1 ing trapezoidal rule Accor 2 JP? vane ox Bae) +20: + faa 32°F 0+2 «084+ 1) Ease = 0.3928 x 2.68 = 1.052 Ans Using trapezoidal rule, evaluate f (Gx? 4x) dx, Solutio Here,n=3,a=0,b=3, 0) Let us consider four points x9 = 0, x; 5X27 2, X53. The values of the function y = 3x2 4x at these poins are tabulated below. Endpoints | x9=0 | x x53 y o [-1 | 4 15 “According to trapezoidal rule 2 b J OX 4n) dx = (0291 +292 +9) (0+2C1) 424415} 421 =105 Ans oh 248415) 9521 =105 Ans. Given 1=f' = ax, n= 4, estimate the value of [using Trapezoidal rule. Solution: Here, the length of each sub-interval is “Z = 1. In order to Aivide the interval (0, 4 into four subintervals each of Tenth b we have to consider five pons % = 0, x)= 1," 2,1" 3,34 4 The values of the function y = f{x) = x° at these points are tabulated below, End points_[s0=0 ysx 0 1 8 27 64 m2 [es [ued 1325. Applied Mathematls — Non: bysing te topo rue, 6 Sve 1 few aBiyot20rty:t yt ¥d Biyyt2yt2ye+20 + yd [0+2(1+8+27)+ 64] 1 ji+6 1 =7* 136=68 Ans, PRI ax, Evaluate using trapezotdal rule the integral f jy,+=5- Soluti Here, n=5,a=0, bea Here, 4 sub-intervals of length 0.20 each should be considered, s0 we hhave to consider five points x= 0, xi = 0.20, x2= 0.40, x5 = 0.60, 24 O80 andy 1. The al of finn y= 9 = heat es a acti i Endpoints | 3 =0 | x,=020 | x=040 ] x=060 | x=080 | = 0.71429 | o.aso0 | 0.5556 | 050000 Now, using trapezoidal rule, we have dx oh eiax 2 Dot 201+ ty +¥)+ 95] 029, = "511.0000 + 2(0.83333 + 0.71429 + 0.62500 + 0.55556) + 0.50000] 0.1 [1.50000 +2 2.72818) 0.1 [1.50000 + 5.45636) =011 x 6.95636 = 0.695636 Ans, ampate an approximate value of { (+x) by using the composite trapezoid rule with three points, Them comparing with the actual value afthe integral, find the error. Solution: ‘There are three end points ofthe intervals, son=2. Here, a=0,b=1, ‘ are 0, 0.5, | and values ofy a these points are given in the following table: x 0 [os [a y= [1 | 08 | os Using the composite trapezoidal re, we Have Sites B fyo+2yity2} 95 eox08+0s} =ors Actual value= fuses (tax), = 171854 ~ 0.775 = 0.104 Ans. Error= Using the trapezoidal rule, compute J2 ex 1) axwith 4 intervals. Find {he absolute error of approximation from its actual value, Solution: Herea=0,b=2,0=4 5 and 5 points to be considered are Xo = 0, X1 = La 4 0.5, x2= 1.0, x3 = 1.5, X42 ‘The value of integrand corresponding to each points are tabulated below. fesiees | ocn|nes wpa [ras [y=2e-1 Sparse 2 128 Applied Mathemat ‘Now, using trapezoidal rule, we have fee) éx=4pot201+ ty) +d ° Bp 142C05+1+35)+7] 0.25[-1+2*4+7] 0.25% 14=35 Ans. eed ° 10 2353-35-07 lane sing compote traperidal ule the integral sn xin =4 Solution: Sie, n 4g ofeach biter) = P=2 BO the fv oats io be coe 9 3/4, xq = 1 which divide the interval (0, x} into four sub-intervals valu the values ofthe function, we get the following table ‘We can divide the interval [0, n] into 4 sub-intervals ‘of equal length cach F namely [0, 14), [n,n], [2,34], [3n/4, End points of Jxs=0 =n [uaa [or subinterval Ax) = sin x int Pua 0.00000 |infa [1.00000 [raja [0.00000 Using wapenoidal rue, we have eoten Pais Us) +2) + ft) + ft) + fd] =F) to00000 +2 . @)wi+ 1)= 1.896 Ans, ) + 0.000001 een Nett Apply rapezoldal rule to evaluate the integral oT aforn= 4.Give the answer correct up-to 3 places of decimal, Solution: Since n= 4, length of each sub-interval (h) = ne) 205 we have to consider five points x) =-0, x1 = 0.5, x2 = 1.0, x5 = 15, X4 = 2.0 which divide the interval [0, 2}, into four sub-intervals, Evaluating the values ofthe function, we will gt the following table: Endpoint ]x=0 | x1=05]xg=10 |x 15 | x=20 1.00000 | 0.94117 | 0.50000 | 0.16494 | 0.05662 981 momraset710 5000 +0165 +085 = (0.25) [427104] = 1.06776 ~ 1.067 (by chopping off extra di 106776 = 1.068 Ans. ‘Approximation from its actual value. Solution: Here, n=4,a=0,b=1 Hrs subintervals of eth 025 each sold be cose we have to considered five points x= 0, x1 = 025, x2 = 0:50, 33, 130... Applied Mathematics y= 100. Te value of the function y= £0) Tx at hese points ae {abulated below. Endpoint [9=0 _[x1=025 [2-05 |x9=075 |xy=1 7 }1.00000 [0.80000 [0.66666 }0.57143 [0.50000 YA Tex, Tow, by using vapezoial le, we have : iB abiyg tay + 2904295 +94 2B yrayitntytyd =0.125{1.00000 + 2(0.80000 +0.6666640.57143) + 0.50000] 0.125 [1.00000 + 2 x 2.03809 + 0.50000] 128» 557618 = 0.69702 piey ~ log +) ~og (141) —Hog (+0) =log2-0= 0.9314 Truc ror = actual vale pprorimate vale) =|0.69314--0.69702| = 0.00388 Ans. IE ‘Now, actual value of integral Using trapezadal ue evaluate [75 for n= 4 correct 3 plas of decimal, Solution: Since n= 4, length of each sub-interval(h) = ©=2) 22 have 10 coir five pins x4 = 0, x = 0, x= 10, x = 15 X4 = 20 which divide the interval [0,2], into four subintervals Evaluating the values ofthe funtion, we will get the following able: End point | xo=0 05,we x= 10 x=20 fa)=—1, | 100000] 0.94117 | 0.50000 [0.16894 | 0.05882 Tt Pees By the trapez il rule, ‘2_dx_ oh Joa Fa +2) +209) +20) + 7 1.00000+2(0.941 1740.50000 + 0.16494) + 0.05882} = (025) (4.27104) (06776 = 1.067 (by chopping off extra digit) By rounding off the pe OT 4d 106776 = 1.068 Ans. erro Solution: Here, n =4 and length of each sub-interval (h) Inorder to divide the interval [1,2] into four subintervals, we have to consider five points xo = 1, X1 = 1.25, Xp = 1.5, 43 = 1.75, x4 = 2. Evaluating the values of f{x) at these points we get the following table Endpomwor | w=! funt2s [w=15]u-175] =2 sxb-inerval 1 Fro0000 | oto00 | oaases | 022650 | 025000 fore. By using the trapezoidal rule, 2 tsa) + 2x) + 280) + 2F 09) + x] 9.25 1 pongo + 2.64000 + 0444444032650) + 0.25000] 125 [4.07188] = 0.508985 ~ 0.509 (rounding off the digits) ‘To estimate the error, we should find the actual value of integral LP atei=05 rf F 5 so eat ane oneal | $F -[- Now, error =0.509—0.5]=0.009 Ans. 10, setpoint a Using trapeznidal rule compute xa with 4 intervals Find absolute eror of approximation from its actual value, Using trapezoidal rule compute fs with 3 intervals, Find yy absolute error of approximation from is actual value, Using trapezoidal rule compute fea with 4 intervals, Find the absolute err of approximation from its actual value. Using tapezia rae compute J Gx? 4x) dx with 3 iterate Fag the absolute error of approximation from is actual value, Using trapezoidal rule, evaluate dx with n - Estimate the error of Approximation from its actual value. alte sng pez lth intepral sin xd, n= ‘Approximate the value using trapezoidal rule for Set dxn=2 Fvaluate using Trapezoidal le f 2S y= 4, Alo estimate erat 1 Using trapezoidal rule evaluate f THES for n= 4 comes to 3 plac of decimal. : we ‘Numerical Integration..133, NSWER SHER! 2.375, 0 3.42, 0.667 4.105, 15 jt 2e 7, 425, 0.25 5, 0469702, 0.00388 6.1.896 7.1082 49,0.4061625, 0 10. 1.068 52 simpsons nue To approximate the integral “9 b J fs) &x5 we take a set of three points and fit with a part of the yarabola whose equation is of the formy= Ax? + Bx +C. The area under the curve from tox his given by 4 , ‘as Be oy] Seats per ode -[AE BE sox] | = Fl2ah’ + 6C]. Since the eurve passes the points (-h (0, and (h 2) $0 We have ‘Yo= Ah?~Bh+C, yi ‘and y2= Ah? + Bh +C yeoyi= Aly Bh and ys ys= Ah? + Bh ra Adding, yo* ya 2ys Hence, area = Hit ys—2)+ 69 b Hoot anit] Proceeding similarly to the successive pieces of the curve y = f(x) between x=.and x= taking the sum ofall, we get the Simpson's ule as| Yoel) #202 + Ye oct Yor] ® St) dx Ago ty +401 +54 >. where nis even and h rule its to be noted that n should be even, Lethe Ma PrP megaton must be divided info an even number of equal gp, intervals. Estimation of Error ‘Simpson's error relative to Simpson's 3 1 rule is the difference between actual b value of the integral f(x) dx and the corresponding approximated value a chained from Simpson's rule Error (Simpson's 3 1 rule where M is the largest value of f"() inthe closed in [01 Note: Simpson's re canbe used only when the numberof sub-inerval is 4 ‘even, But the Simpson's’ rule can be used when umber of sub-interval i odd as well as even which is given as follows: Sf) d= Poy 39.3924 90) b Evaluate using Simpson's rule f° ‘3, n= 4, Also, estimate error. ee Solution: Since n= 4,length ofeach sub-interval = "8 = 3=1 _ 95, ‘Here, dividing the interval [1, 3] into 4 ‘sub-ir ls, we get UWS} 015.2, 2,25),(25,3), | ee nee ‘The value of End Points 1 ‘¥F atthe end points of sub METS] ued | wes] med fed= zt] F601] fe) 0.4444 m3) =0.25| ts) = 016] x) = 0-1" By Simpson's rule, ee ie Here, (9) =P ‘M= maximum value of| fx) |in [1,3] occurs atx: ie Melon Now,a=1,b=3,n=4 penta Gan 20 _ 32120 T80n? =" 1804)" “180% 256 f compa F274 Simp ro A compart 0 ie ee, n=4, Then, h=P=2=45% 125 “The five points xy = 0, X; = 0.25, x2 = 0.5, x3 ='0.75 and x,~ 1 divide the interval [0, 1] into four sub-intervals of length 0.25 each, bt gto nal ie gin The values of y = following table End Point [%=0 [x=025 [m=05 | x5=0.75 | xy=1 1 oss [08 064 [os ‘Simpson's rule, h 3 9251 44x94 4208 +4% 064405) Lot 4yi + 292+ Aya + Yad <2 9424-0785 An 136 .. Applied Mathematics. 1 Actual value= 3-32 dx 0 at ={un"x * = tan! ~tan0 rating Pasan2 oo rash ppesinta vale wig Sings rule wp 3 pl of decimals. (i Calculate an error bound for the approximation. Determine the error. Is it within the bounds? Solution: @ Here, In order to partion the interval {- 1, 4] into two subintervals we Ihave to conider three 1,31 1.5 and x5=4, The values ofthe funtion fx) =x’ at these points ae tabulated below. End points aad fx) =x 64 By Simpson's rule, we have J a pe We = fl) + fC) + 2) 25 Be i+4x3.375 +64) = 73 x165 =63.750 f'Q@)eae £"G)= 6x £"@) £%(@): M=|f"(3)|=0, forall xin (1,4), Rarer tegration 7 Ani ‘bour (b— ‘pper bound for enor is M PAP 9, 4+ DE 0. 180 (2) - ‘The error =| exact value ~. -Approximates value| _ =|63.75 -63.25|=0 Thus the error = 0= error bound. Hence, the errors within the bound. Ans. ‘Simpson's rule to, f pps Simpson's rule o approximate the value of fe" dx dx with n=3. Solution: Here, f(x) =e énx End point maa y=e" fax 75.6894 So gang ‘Now, by using Simpson's rule, we have f eeoxds = By tay. 43+) 3 [0 +3 x 5.1214-+3 x 22.0659 + 75.6894] = F115.3642 + 66.1977 + 75.6894] 3 cis.asia S896 Am, Using Simpsor Solution: i oul SR acu 02. 2n=2 eho x; = 0.1, x2= | divide the interval [0, 0.2] into two sub-intervals. The values ofthe integrand y =_[T—2x? at each of the end points ofthe sub-intevals are given below. End points [=O] x50. YouT| yi =0.989040494 | ya = 0959166305 y=Vi-2e Here a= 0, b: ou ‘Three points x9 x02 138 ..Applied Mathematics 1 By Simpson's 5 rule, : h i =x? da=3 [yo + Ay + Yad = +4 x 0989949494 + 0.959166305) =x 5918964281 =0.197298809 Ans, 02 Fi he approsinate vate of f YTB? dn =2, wig Simp o rule, Solution: Herea=0, Thre points xy x4 = 0.1, x2= 1 divide the interval [0, 0.2} into ‘wo sub-intervals. The values ofthe integrand y =-J1—2x? at each of the end points of the sub- intervals are given below. End points [xy=0] _xi=0.1 x02 y=Vi-2¢ |y=0] y= 0.989949404 V2= 0959166305 | Dimon f T= Ae dx =F Lye ys ya] 1 ="7 Ul +4 0,989949494 + 0.959166305] % 5.918964281 = 0.197298809 Ans. Using Simpson's rule, evaluate 2. Solution: Here,n=4,a=0, ‘Numerical Integration...139, ‘The end points of 4 subvintervals of [0, 1} are x= 0, x1 = 0.25, x2 055, x3 = 0.75, x4 = 1.00, The values of y = 1 Tegat each of the end points ofthe intervals are given below: End point |x=0 [xj =025 [xp 15] x= 075 ]xy= 10 yay | 100000] 80000" 0.68667 Jo37143 fos0000 By using Simpson's rule, we have 3 U0 + Ay + yp + ys + yg) 025 “5 [1.00000+4x 0.80000 + 2 x 0,66667+ 4 x 0.57143) + 0.50000] 693255 Ans. : Aerie 4x ing Simp leith = Solution: Here, a b=2,y=fy=2,h ‘The end points are 0, 0.5, 1, 1.5 and 2. x Jo| os [1] 15 [2 ye2 | 1 | 14142 [2 | 2.8284 | 4 1 Now, using Simpson's 3 rule, we have 2 fre Fouran 42, tay tyd) 95 (1 + ay. 4142-+ 200 + 450.8288) 05 25,9704 = 4.3284 Ans Using Simpson's rule, evaluate ((2x—1)*dxym= 4. . Solution: Here, a=0,b=2,n=4 fed Mathematics sare 0, : ofthe fancion are shown nthe following tbe me oO 05 i 1s 2 x yeax-¥| 1 & i 4 9 1 ‘Now, by using Simpson's 3 rule, we have h festa By ay ty) +2 + yd oy saorgeaxt es) 8 s16+249 'n order to patton the interval 1,5] into four sub-intervals, each of length * we have to consider the five points x= 1, Bvaluting the values of function y_ End points | x9=1 1 1 By Simpson's rule, we have Sta Be 4 +29 49,494 1 S3U44* 164.2% 81 44x 256+ 625] BU +64 162+ 1024 +625) 1 * 1876 = 625.33 Ans, _——— an Using Simpson's 4 le, eva ate: | ae ds, h=025, Solution: Hoe a0, 6~1,h=025, Ths the endpoint ofthe intervals ae 0.25, 050, 0.75, 1 The values of the integrand at each end point of the intervals are given below: = oT 025 [050 | 075] 1 y=Vi+2x? t 1.06066 | 1.22474 [1.45773 | 1.73205 7 Al, TERK 3 bo + 40H + yo) + 290-494) =9F5 1+4(.06066-+1.4573)42m1.2247441.73205] = 0.08333{1 + 10.07356 + 2.44948 + 1.73205] 2712 Ans. Ie igen trac Paaclac ae on jeaghitica htc gy bEPOE=O pape pa eng uae length b=, we fav o conser sve points x= 0, 2.33 = aie Basu Fae n ts noi) tte points are tabulated below: End point | x)= 0 xan 3 [272 4)=sinx | 0.0000 0.000] 8 1.0000] 2 | os000 | 0.0000 By Simpson's rule, we have SGsins. dbx= Bs) + 4081) + 21082) + 4105) + 20a) + 46x) + A(x.) =

You might also like