numerical integration - the department of mathematics at · pdf file ·...
TRANSCRIPT
Numerical Integration
Lesson 3
Last Week• Defined the definite integral as limit of Riemann
sums.
The definite integral of f(t) from t = a to t = b.
LHS:
RHS:
Last Time• Estimate using left and right hand sums and
using area with a grid
If f(x) ≥ 0, then
represents the area underneath the curvef between x = a and x = b.
Example:Estimate:
I estimate about 4boxes.
Area of each box? 1
So Area = =4
Note: you have to dealwith “partial” boxes.
Area Below the AxisFor a general function:
TotalChange:
NOTE:Total Area=
A1+ A
2
Integral of a rate of change is the total change
Find the area under the graph of y =x2 on theinterval [1, 3] with n = 2 using left rectangles.
AL = 1*(1+4) = 5Is this estimate an under or over estimate?(Hint: Consider the graph of the function with
the rectangles.) This is an underestimate
Repeat the estimate with right rectangles.AR = 1*(4+9) = 13, overestimate
Find the average of the two estimates. (5+13)/2 = 9
Group work last time
Rectangles(review)
• How can we improve these estimates?
Estimating Integrals: Trapezoidal andSimpson’s Rule
The Trapezoid Rule• The Trapezoid Rule is simply the average of
the left-hand Riemann Sum and the right-hand Riemann Sum.
• Averaging the two Riemann Sums gives anestimate that is more accurate than eithersum alone.
A Trapezoid
Notice that the area of the trapezoid is the average of the areas of the left and right rectangles
Using SubintervalsDivide the interval into subintervals:
Then we get:
A Formula
Factor out ∆x/2:
Combine duplicate terms:
Factor out ∆x/2:
A Formula: Trapezoidal Rule
Example
Approximate using n = 8 subintervals.∆x = (4-0)/8 = 1/2 x0 = 0 x1 = 0.5 x2 = 1
Riemann Sums?Left-Hand Sum:
Right-Hand Sum:
Average: 21.5 Same as Trapezoidal rule!
Actual answer:
Pictures:The estimate is pretty good!
Better Approximations
• Trapezoidal uses straight lines: small linesNext highest degree would be parabolas…
Simpson’s RuleMmmm…
parabolas…Put a parabola across eachpair of subintervals:
So n must be even!Simpson's Rule is even more accurate than the Trapezoid Rule.
Simpson’s Rule Formula
Like trapezoidalrule Divide by 3
instead of 2
Interiorcoefficientsalternate:
4,2,4,2,…,4
Second from start and end
are both 4
ExampleEstimate using Simpson’s Rule and n = 4.Here, ∆x = (4-0)/4 = 1.
Exact answer!
Simpson’s Rule: QuadraticsBecause Simpson’s rule uses parabolas,
it is exact for any quadratic (or lower) polynomial,with any choice of n.
(So use n = 2 for quadratics!)
Tables
• Functions may be represented as tables• With evenly spaced data, we can still
use the Trapezoid and / or Simpson’srule.
• If the number of subintervals is odd, wecan only use the Trapezoid rule.
Example:2–1347W(t)420–2–4t
Estimate .
Here, ∆x = ______. ∆x = 2
3 subintervals:use trapezoidal rule.
Example:
0807573828254500Width (ft)987654321Meas. #
Estimate surface area of a pond: Measurements across aretaken every 20 feet along the width:
First: What is ∆x? ∆x = 20 ft PictureMethod?
There are 8 subintervals, so we use Simpson’s rule.
ft2
Area:
Example: Follow Up
Surface area: 10,413.3 ft2
If average depth is 10 ft, and we want to start with 1 fishper 1,000 cubic feet of water, how many fish are needed?(Hint: Start by finding volume.)
Volume: (10,413.3 ft2)(10 ft) = 104,133 ft3.
We need about 104 fish.
Review• The Trapezoid Rule is nothing more than the
average of the left-hand and right-handRiemann Sums. It provides a more accurateapproximation of total change than either sumdoes alone.
• Simpson’s Rule is a weighted average thatresults in an even more accurateapproximation.
Summary• Formula for the Trapezoid rule (replaces
function with straight line segments)• Formula for Simpson’s rule (uses
parabolas, so exact for quadratics)• Approximations improve as ∆x shrinks• Generally Simpson’s rule superior to
trapezoidal• Used both from tabular data
Group work1. Use Trapezoidal rule and Simpson’s rule with 2subintervals to estimate the following integral:
!2
20
3+ 2(2
3)+ 4
3"# $%
= 80.
!2
30
3+ 4(2
3)+ 4
3"# $%
= 64.
Trapezoidal rule Simpson’s rule
Group work2. Write down the correct formula to useSimpson’s rule and 4 subintervals:
f (x)dx2
10
!
!2
3f (2)+ 4 f (4)+ 2 f (6)+ 4 f (8)+ f (10)[ ]