Numerical Integration Approximation
On this page
Direct answer
Numerical integration estimates a definite integral by sampling the integrand at equally spaced points, useful when the antiderivative is awkward. With strip width h = (b − a)/n, the trapezoidal rule joins the sampled points with straight lines, with error of order h². Simpson's one-third rule fits parabolas through consecutive triples, needs an even number of strips, and has error of order h⁴. Simpson's rule converges much faster on smooth integrands.
What you must remember
- Trapezoidal rule: T = h/2[(y0 + yn) + 2(sum of middle ordinates)] with h = (b − a)/n; endpoints weigh once and interior ordinates twice.
- Simpson's one-third rule: S = h/3[(y0 + yn) + 4(odd-indexed ordinates) + 2(even-indexed ordinates)], valid only for an even number of strips.
- Error orders: the trapezoid error is O(h²) and involves f''; the Simpson error is O(h⁴) and involves the fourth derivative.
- Halving h: cuts the trapezoid error about fourfold and the Simpson error about sixteenfold.
- Exactness: Simpson's rule integrates every polynomial up to degree 3 exactly, because its error term vanishes on cubics.
- Over or under: the trapezoid overestimates a convex integrand (f'' > 0) and underestimates a concave one.
- Odd strips: apply Simpson's rule to the first n − 1 strips and the trapezoid to the last strip.
Working an estimate by hand
Estimate ∫₀¹ dx/(1 + x²) with n = 4. The exact value π/4 ≈ 0.7854 lets the answer check itself.
- Fix the strip width: h = (1 − 0)/4 = 0.25, with nodes at 0, 0.25, 0.5, 0.75 and 1.
- Sample the integrand: y = 1/(1 + x²) gives y0 = 1, y1 ≈ 0.9412, y2 = 0.8, y3 = 0.64 and y4 = 0.5.
- Apply the trapezoidal rule: T = (0.25/2)[(1 + 0.5) + 2(0.9412 + 0.8 + 0.64)] ≈ 0.7828, short of π/4 by about 0.0026.
- Apply Simpson's rule: S = (0.25/3)[(1 + 0.5) + 4(0.9412 + 0.64) + 2(0.8)] ≈ 0.78539, matching π/4 to four decimal places.
- Check the sign of the error: y'' = (6x² − 2)/(1 + x²)³ changes sign at x = 1/√3, so convexity alone cannot tell which way the trapezoid errs on this interval.
Keep the discipline simple. Fix h first, list every ordinate in order, and apply the weights last. A Simpson result drifting from π/4 usually means a 4 and a 2 have been swapped.
Where the marks leak
The rules are mechanical, so most errors are setup and arithmetic slips.
- Trap: applying Simpson's rule to an odd number of strips. Correct: the one-third rule needs an even count, so finish an odd case with a trapezoid on the last strip.
- Trap: computing h from the sum of the x-values or from a step that does not divide the interval. Correct: h = (b − a)/n uses only the interval length and the strip count.
- Trap: swapping the weights 4 and 2 between odd and even ordinates. Correct: odd-indexed ordinates carry weight 4, even-indexed ordinates carry weight 2, and the two endpoints are weighted once.
Frequently asked questions
Can Simpson's rule be used with an odd number of strips?
No, Simpson's one-third rule needs an even number of strips. Apply it to the first n − 1 strips and finish the last strip with the trapezoidal rule.
Why is Simpson's rule more accurate than the trapezoidal rule?
Simpson's error involves the fourth derivative and is of order h⁴, against the order h² error of the trapezoidal rule. Doubling n cuts the Simpson error about sixteenfold but the trapezoid error only about fourfold.
For which integrands is Simpson's rule exact?
Simpson's rule integrates every polynomial of degree up to 3 exactly, because its error term vanishes for those. It also performs very well on smooth functions such as 1/(1 + x²) on [0, 1].
Does the trapezoidal rule overestimate or underestimate?
The trapezoidal rule overestimates a convex integrand, where f'' > 0 and the chords lie above the curve, and underestimates a concave one. When f'' changes sign over the interval, the direction of the error cannot be read off by inspection.
Is numerical integration part of the JEE syllabus?
Numerical integration is not a named topic in the standard syllabus listing, and questions on it are uncommon. Check the official syllabus for the current year, and treat the trapezoidal and Simpson formulas as a method check for definite integrals.