Numerical Integration by Simpson's 1/3 and 3/8 Rules

​
functions
f
1
f
2
f
3
f
1
(x)3+cos(x+3)
f
2
(x)2+sin(2x)
f
3
(x)x
3-x
e
limits
lower, a
1
upper, b
8
number of subintervals
n
3
Using Simpson's 3/8 rule,
8
∫
1
f(x)x ≈ B
= 2.33333 ×
3
8
[ (5.35078) + 3 (6.27261) + 2 (0.) ]
1
3
1
3
= 21.1475
exact answer = 20.7568
absolute error ≈ 0.390715
Definite integrals can be approximated using numerical methods such as Simpson’s rule. A better approximation is obtained as you increase
n
, the number of subintervals.
Let
h=(b-a)/n
and
x
k
=a+kh
, where
k=0,1,2,…,n
, and set
y
k
=f(
x
k
)
.
Simpson's 1/3 rule:
b
∫
a
f(x)dx≈A=
h
3

y
0
+
y
n
+4
n-1
∑
i=1,iodd
y
i
+2
n-2
∑
i=2,ieven
y
i

.
Simpson's 3/8 rule:
b
∫
a
f(x)dx≈B=
3h
8
(
y
0
+
y
n
+3(
y
1
+
y
2
+
y
4
+
y
5
+⋯+
y
n-2
+
y
n-1
)+2(
y
3
+
y
6
+⋯+
y
n-3
))
.
In the graphic, approximations for a given
n
are computed using the two rules and compared with the exact value of the integral.

Permanent Citation

Rinashini Arunasalam
​
​"Numerical Integration by Simpson's 1/3 and 3/8 Rules"​
​http://demonstrations.wolfram.com/NumericalIntegrationBySimpsons13And38Rules/​
​Wolfram Demonstrations Project​
​Published: August 2, 2016