numerical integration

numerical integration - 8.7 Numerical Integration Sometimes...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 8.7 Numerical Integration Sometimes we cannot calculate an integral explicitly, but need to know its numerical value. So we try to get good approximations to its actual value. There are many ways to do this, and we shall outline some in this section. Let us assume that f is continuous on [0,61 and that we want to get an approximate values for b frmm a We subdivide the interval [0, 6] into n equal intervals of length «bi—E. So we write {(1, l = [$0,331] U [$1,$2l U [$2,273] U U [mu—1,33n] , where each interval [iii—1J5] has length x5 . "7 8 Let us approximate the area under the graph of J” from 13,--1 to an, that is, let us approximate a: i f(:1:)d.:z:. mi — 1 We present five different ways to do this. Below, the symbol 9-: means approxi- mately equal to. (I) The Left Endpoint Rectangle Linen f (331:4) ($i — {ti—1): f($iu1) 6—0:. 12 . £<KC~1> Ill 94 (II) The Right Endpoint Rectangle f fwd-r mi) (95,; — m) = f (we) b; (I; 112 ' Cm: (III) The Midpoint Rectangle 1'". f($)d$ 3i w1 f (xi—12+$1)($a—$s—1)=f (mi—12+mi) 5:10- llE 95 (IV) The Trapezoid 2:5 mm win-1 51”. (mi—1) +f (2%)] (211' — $5_1) = % [f($i._1)+ f (3‘)] b II? (V) The Parabola We find a parabola, that' IS a quadratic polynomial y: 032 + bw—l— c, thatpws —0} through the points (maul, f (mg_1)), (M, 3' (M9), (3;, f (m;)). Then we calculate the area. under that parabola, and use it as an approximation to 1:; fix) 4m : :12“ “13MB mi—l Ell Now We add the approximations over each individual piece I r: :1 f (3;) dc: to get an approximation to the total integral 1: f (1:) (£91. When we add up all the pieces, in each of the five methods above, we get: (I) Left Endpoint Rule b—a. n Ln = [f(n=o) +f ($1) +f ($2) + + f ($124)]- (II) Right Endpoint Rule 13— Rn: ’n’: (111) Midpoint Rule .. b —'a 220 + :21 11:1 + 2:2 2:2 + $3 1071—1 + urn M n H 2 M 2 M 2 )+-—-+f(*~——2 )l- (IV) 'Ik-apezoidal Rule “ U ($1) + f (922) + 1‘ (mg) + + f (an- b—e T"- 211. (V) Simpson’s Rule (from the Parabola) b fwd-0) +f($n) sn— -0. +2Ef(w1)-+f(m2)+---+f(wn~1)]+ =6? +4“(20%)+r(ee)+r<flea)+«-+f(%fl)l [r (ms) + 211991) + 2f (x2) + 2r (ms) + + 2r (m) + f (mun. Example Approximate 21 m2:/ —d:z, 123 by applying the rules above-to f (2:) = i on [(1, b] m [1,2] with n = 5. Solution Here Then our points are 6 7 8 9 - {$0,$1,$2,$3,$4,$5} 2 {113, 3:37 3:2} - Let’s substitute in the rules (I) Left Endpoint Rule 97 L5 = b:Ef($o)+f($1)+f(w2)+---+f(w4)] g[we+f(;)+r(-:->+f<%>] 1 5 5 5 5 _ E[1+E+?+§+§]_0'7456“' (11) Right. Endpoint Rule (2—0. 5 U (ml) +r (x2) + +r ($5)] .51— [1(3) HG) +1” (2) +1" (—2-) +f(2)] 1 5 5 5 5 1 [ §+§+§+§]_0.6456m ll Rs 5 6 (III) Midpoint Rule Ms b:{rct’zwclm”(fizzfigwm+434?» he)+r<:—:>+rez)+f(%>+r<-:—z>1 10 19 1” 104.3]:(15919... [fi+13+fi+fi 19 H 1 3 1 3 (IV) Trapezoidal Rule T5 = 1’ I5“ [1‘ ($0) + 21‘ (x1) + 21132) + 21133) + 21' ($4) + 1‘ ($501 - 1 s 7 8 9 = 1.6[f(1)+2f(-5—)+2f(g)+2f (-5-)+2f (3)+f(2)] 1 10 10 10 10 1 = E[1+_6,+_7.+§+3+§]=0.6956m (V) Simpson’s Rule 98_ 59 u 30 [ +2 ”(131)+f(m2)+f(x3)+f($4)]+ +4[11%)+f(fl%fl)+f(fli§fl)+f(£3%4)+f(n%a)] f (130) + 1’ ($5) ] 1 [ +2[f(‘"’) filwfieww i : -——— — + .. _ _ 3" we flea-fie if aha-2)] 1+l = i +2[[-g~+gig+g]] =06932 3“ +4[[i—2+-i-°+i—°+%9+i—°ll Note that on a calculator, 1112 = 0.69134... so Simpson’s Rule is best. Error Estimates If we are going to use thefie rules, we need to have an wtimate of the error we incur when using them. In a similar way to the way we obtained the Lagrange form of the remainder in Taylor polynomials, one can prove the following esti- mates: (I) Error in Trapezoidal Rule E: [bf(:r:)d1:—Tn b = f m) an: — “’27: [f(wo) + 2f (55.) +21%) +2f ($3) + +2r(a:._1) + mo] 3 . : —(61;T::) f”(C): for some c'between a, and I). Then if M is a number such that [f"(:z:){ S M for all a: 6 [(1,1)] , we obtain (be af‘ 13315 WM (II) Error in Simpson’s Rule 99 U] in IE n ff(w)dw—sn b _ b—a j;f(x)dmw 6n _ (b — (1)5 2880n4 for some c between a and b. Then if M is a number such that f($o) + f(I'n) +2 [f ($1) + f ($2) + + f (sun—1)] + +4 [feewrea—xaweea) +---+f('~r;+%)] f“) (c), ‘f(4) ($)| g Mfor allx E [0'35]: we obtain S (b — “)5 IE"| g 2880n4 M" Example Estimate the error in the Trapezoidal and Simpson’s rule for 2 1112 =/ ldaz. 1 m Solution Here I)"- a = 2 — 1 = I, and 1 f (x) = E: so 2 f” (m) = ‘5 -—-> we» s 2,9: 6 [1,21 Then we have the bound M = 2 011 “ml, so Also 24 , f“) (m) = 5 => If“) (m)| 5 24,21: 6 [1,2]. Then we have the bound M = 24 on I f(4) I, so 5 S < (b —- a} = 1 ”EM ‘ 2880214 24 120n4' Clearly Simpson’s gives better accuracy, though it involves evaluating the func— tion at more points. . 100 ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern