MANE 3351
Lecture 14
Classroom Management
Agenda
- Simpson's Rule
- Lab 5 due before 9:30 AM
- Lab 6 Assigned today
- Homework 3 due 10/22/2025 before 11:59 PM
Calendar
| Week | Monday Lecture | Wednesday Lecture |
|---|---|---|
| 8 | 10/20: Simpson's Rule | 10/22: Romberg Integration |
| 9 | 10/27: Gaussian Quadrature | 10/29: Numerical Differentiation (not on Test 2) |
| 10 | 11/3: Linear Algebra | 11/5: Test 2 (Root Finding and Numerical Integration) |
Resources
Handouts
Lecture 14
Today's topic is Simpson's Rule.
- Simpson's (1/3) rule is Newton-Cotes with \(n=2\)
- Chapra and Canale (2015)1 illustrate Simpson's rule in the figure shown below

Definition of Simpson's Rule
- Chapra and Canale(2015)1 provide the following definition of Simpson's rule
\[
I=\frac{h}{3}\left[f(x_0)+4f(x_1)+f(x_2)\right]
\]
where \(h=(b-a)/2\)
- Note that Simpson's rule is of the form
\[
\begin{aligned}
I&\approx \left(b-a\right)\frac{f(x_0)+4f(x_1)+f(x_2)}{6}\\
I&\approx\mbox{ width}\times\mbox{ average height}
\end{aligned}
\]
Simpson's Rule Error Analysis
- Chapra and Canale (2015)1 provides the following definition:
\[
\begin{aligned}
I&=\frac{h}{3}\left[f(x_0)+4f(x_1)+f(x_2)\right]-\frac{1}{90}f^{(4)}(\xi)h^5\\
I&=\mbox{Simpson's 1/3 approximation}-\mbox{ Truncation error}
\end{aligned}
\]
Multiple Applications of Simpson's Rule
- The number of segments must be even
- The formula is
\[
I\approx\left(b-a\right)\frac{f(x_0)+4\sum_{i=1,3,5}^{n-1}f(x_i)+2\sum_{j=2,4,6}^{n-2}f(x_j)+f(x_n)}{3n}
\]
where \(h=\frac{b-a}{n}\)
Pseudo-code: Simpson's 1/3 Rule
- CodeSansar2 provides the following pseudo-code

Python Code for Multiple Simpson's 1/3 Rule
import math
def f(z):
return (math.exp(-0.5*z**2)/((2.0*math.pi)**0.5))
n=10
a=-5.0
b=0.0
h=(b-a)/n
sum=f(a)+f(b)
for i in range(1,n):
# print(i)
k=a+i*h
if i%2==0:
#print("even number")
sum=sum+2.0*f(k)
else:
#print("odd number")
sum=sum+4.0*f(k)
sum=sum*h/3.0
print("The area is {} after {} iterations".format(sum,n))
Simpson's 3/8 Rule
- Simpson's 3/8 rule is Newton-Cotes with \(n=3\)
- Chapra and Canale (2015)1 illustrate Simpson's rule in the figure shown below

Definition of Simpson's 3/8 Rule
- Chapra and Canale(2015)1 provide the following definition of Simpson's rule
\[
I=\frac{3h}{8}\left[f(x_0)+3f(x_1)+3f(x_2)+f(x_3)\right]
\]
where \(h=(b-a)/3\)
- Note that Simpson's 3/8 rule is of the form
\[
\begin{aligned}
I&\approx \left(b-a\right)\frac{f(x_0)+3f(x_1)+3f(x_2)+f(x_3)}{8}\\
I&\approx\mbox{ width}\times\mbox{ average height}
\end{aligned}
\]
Truncation Error of Simpson's 3/8 Rule
\[
\begin{aligned}
E_t&=-\frac{3}{80}h^5f^{(4)}(\xi)\\
&=-\frac{\left(b-a\right)^5}{6480}f^{(4)}(\xi)
\end{aligned}
\]
Classroom Coding: One Interval of Simpson's 3/8 Rule
รท
-
Chapra, S., and Canale, R., (2015), Numerical Methods for Engineers, 7th edition ↩↩↩↩↩
-
https://www.codesansar.com/numerical-methods/integration-simpson-1-3-method-algorithm.htm ↩
-
Cheny, W., and Kincaid, D., (2004), Numerical Mathematics and Computer, 5th edition ↩
-
Kiusalaas, J. (2013), Numerical Methods in Engineering with Python 3 ↩
-
https://www.codesansar.com/numerical-methods/integration-simpson-3-8-method-pseudocode.htm ↩