MathLab with Mr. Ahmed
MathLab with Mr. Ahmed is a math learning website by Ahmed Amasha, a mathematics teacher teaching the American curriculum. Explore Algebra 2, Precalculus, Calculus, and SAT and PSAT Math Prep through lessons, focused practice and printable resources.
Before you solve
Ideas in this lesson
Idea 1 of 3
Trapezoidal, midpoint, and Simpson rules
Use the appropriate weights for the chosen rule. Simpson’s Rule requires an even number of equal subintervals.
Worked example 1
Approximate ∫01x2dx with n=2 by the Trapezoidal Rule. - h=21; xᵢ =2i
- Tn=2h[f(0)+2∑f(xᵢ)+f(1)]
- T2=31+241=83≈0.38
Answer: 83≈0.38
Worked example 2
Approximate ∫01x2dx with n=4 by Simpson’s Rule. - h=41; xᵢ =4i
- Sn=3h[f(0)+4∑f(xodd)+2∑f(xeven)+f(1)]
- S4=31=31≈0.33
Answer: 31≈0.33
Idea 2 of 3
Error bounds
A derivative bound controls the approximation error. A zero fourth derivative makes Simpson’s Rule exact for a quadratic.
Worked example 1
For ∫01x2dx with n=4, find the Trapezoidal error bound. - f′′=2; f⁽4⁾ =0; M2=2; M4=0
- ∣ET∣≤1922(1−0)3=961≈0.01
Answer: 961≈0.01
Worked example 2
For ∫01x2dx with n=6, find the Midpoint error bound. - f′′=2; f⁽4⁾ =0; M2=2; M4=0
- ∣EM∣≤8642(1−0)3=4321≈0.00231
Answer: 4321≈0.00231
Idea 3 of 3
Choose a sampling method
Left, right, and midpoint sums use different heights on the same partition; a larger n alone is not an exact answer.
Worked example 1
Approximate ∫02x2dx with 3 equal left rectangles. | x | 0 | 0.6666666667 | 1.333333333 |
|---|
| f(x) | 0 | 0.4444444444 | 1.777777778 |
|---|
- Δx=32≈0.67
- Sample points: xᵢ =0,≈0.67,≈1.33
- L3=32[02+≈0.672+≈1.332]=2740≈1.48
Answer: 2740≈1.48
Worked example 2
Approximate ∫03x2dx with 4 equal right rectangles. | x | 0.75 | 1.5 | 2.25 | 3 |
|---|
| f(x) | 0.5625 | 2.25 | 5.0625 | 9 |
|---|
- Δx=43≈0.75
- Sample points: xᵢ =0.75,1.5,2.25,3
- R4=43[0.752+1.52+2.252+32]=32405≈12.66
Answer: 32405≈12.66
Resource alignment: Larson & Edwards, Calculus of a Single Variable, Tenth Edition, §4.6,p. 305. Explanations, diagrams and numerical practice variants are original MathLab content aligned to this section.