MANE 3351
Lecture 13
Classroom Management
Agenda
- Test 1 not graded
- Homework 3 Assignment
- Lab 6 Assignment
- Numerical Integration
Calendar
| Date | Lecture | Lab |
|---|---|---|
| 10/7 | Secant Method, Homework 3 | Lab 6 |
| 10/9 | Trapezoid Rule | Lab 6, continued |
| 10/14 | Simpson's Rule, Homework 4 | Lab 7 |
| 10/16 | Romberg Integration | Lab 7, continued |
| 10/21 | No Class, Dr. Timmer on ABET Visit | No Class, Dr. Timmer on ABET Visit |
| 10/23 | Gaussian Quadrature, Homework 5 | Lab 8 |
| 10/28 | Numerical Differentiation (not on Test 2) | Lab 8, continued |
| 11/4 | Numerical Integration (not on Test 2) | Lab 9 |
| 11/6 | Linear Algebra, part 1 (not on Test 2) | Lab 9, continued |
| 11/11 | Test 2 (Root Finding and Numerical Integration) | No Lab |
Resources
Handouts
Lecture 13 Content
- Today's topic is numerical integration.
- This is a major new topic after root finding.
- Trapezoid Rule
Introduction to Numerical Integration
- In layman's terms, an integral calculates the area under a curve
- Frequently used in engineering analysis


Definitions
Cheney and Kincaid (2004)1 provide the following definitions
- Indefinite integral : \(\int x^2\;dx=\frac{1}{3}x^3+C\)
- Definite integral: \(\int x^2\; dx = \frac{8}{3}\)
Numerical Integration
Kiusalaas (2013)2 suggest three major approaches to numerical integration that we will investigate:
- Newton-Cotes
a. Trapezoid rule (n=1)
b. Simpson's rule (n=2)
c. 3/8 Simpson's rule (n=3)
-
Romberg Integration
-
Gaussian Quadrature
Note: there are many different techniques for numerical integration than the ones listed above
Newton-Cotes Formulas
Kiusalass (2013)2 provide the following illustration to explain Newton-Cotes techniques

Trapezoid Rule
Chapra and Canale (2015)3 provide the figure shown below illustrating the trapezoid rule

Trapezoid Rule, continued
Chapra and Canale (2015)3 provided the following formulae
- \(I=(b-a)\frac{f(a)+f(b)}{2}\)
- \(E=-\frac{1}{12}f^{\prime\prime}\left(\xi\right)\left(b-a\right)^3\)
Multiple Applications of the Trapezoid Rule
Typically, the region form \(a\) to \(b\) is sub-divided into multiple regions and then the Trapezoid Rule for each region is applied. Chapra and Canale (2015)3 illustrate this concept.

Uniform Spacing
Cheney and Kincaid (2004)1 the following formula for composite (multiple) applications of the Trapezoid Rule
Pseudo-code
Cheney and Kincaid (2004)1 provided the following pseudo-code for the composite trapezoid rule

Python Code for Multiple Trapezoid Rule Applications
import math
def f(z):
return (math.exp(-0.5*z**2)/((2.0*math.pi)**0.5))
n=4
a=-5.0
b=0.0
h=(b-a)/n
sum=0.5*(f(a)+f(b))
for i in range(1,n):
x=a+i*h
sum=sum+f(x)
sum=sum*h
print("The area is {} for {} sub-intervals".format(sum,n))