Title: Lecture 26 Numerical Integration
1Lecture 26 - Numerical Integration
- CVEN 302
- October 26, 2001
2Lectures Goals
- Trapezoidal Rule
- Simpsons Rule
- 1/3 Rule
- 3/8 Rule
- Midpoint
- Gaussian Quadrature
Basic Numerical Integration
3Basic Numerical Integration
We want to find integration of functions of
various forms of the equation known as the Newton
Cotes integration formulas.
4Basic Numerical Integration
- Weighted sum of function values
f(x)
x
x0
x1
xn
xn-1
5Numerical Integration
Idea is to do integral in small parts, like the
way you first learned integration - a
summation Numerical methods just try to make it
faster and more accurate
6Numerical Integration
- Newton-Cotes Closed Formulae -- Use both end
points - Trapezoidal Rule Linear
- Simpsons 1/3-Rule Quadratic
- Simpsons 3/8-Rule Cubic
- Booles Rule Fourth-order
- Newton-Cotes Open Formulae -- Use only interior
points - midpoint rule
7Trapezoid Rule
- Straight-line approximation
f(x)
L(x)
x
x0
x1
8ExampleTrapezoid Rule
- Evaluate the integral
- Exact solution
- Trapezoidal Rule
9Simpsons 1/3-Rule
- Approximate the function by a parabola
L(x)
f(x)
x
x0
x1
x2
h
h
10Simpsons 3/8-Rule
- Approximate by a cubic polynomial
f(x)
L(x)
x
x0
x1
x2
h
h
x3
h
11Example Simpsons Rules
- Evaluate the integral
- Simpsons 1/3-Rule
- Simpsons 3/8-Rule
12Midpoint Rule
- Newton-Cotes Open Formula
f(x)
x
a
b
xm
13Two-point Newton-Cotes Open Formula
- Approximate by a straight line
f(x)
x
x0
x1
x2
h
h
x3
h
14Three-point Newton-Cotes Open Formula
- Approximate by a parabola
f(x)
x
x0
x1
x2
h
h
x3
h
h
x4
15Better Numerical Integration
- Composite integration
- Composite Trapezoidal Rule
- Composite Simpsons Rule
- Richardson Extrapolation
- Romberg integration
16Apply trapezoid rule to multiple segments over
integration limits
17Composite Trapezoid Rule
f(x)
x
x0
x1
x2
h
h
x3
h
h
x4
18Composite Trapezoid Rule
19Composite Trapezoid Example
20Composite Trapezoid Rule with Unequal Segments
- Evaluate the integral
- h1 2, h2 1, h3 0.5, h4 0.5
21Composite Simpsons Rule
Piecewise Quadratic approximations
f(x)
...
x
x0
x2
x4
h
h
xn-2
h
xn
h
x3
x1
xn-1
22Composite Simpsons Rule
- Multiple applications of Simpsons rule
23Composite Simpsons Rule
- Evaluate the integral
- n 2, h 2
- n 4, h 1
24Composite Simpsons Example
25Composite Simpsons Rule with Unequal Segments
- Evaluate the integral
- h1 1.5, h2 0.5
26Summary
- Integration Techniques
- Trapezoidal Rule Linear
- Simpsons 1/3-Rule Quadratic
- Simpsons 3/8-Rule Cubic
27Homework
- Check the Homework webpage