Numerical Integration & Area Under Curve Calculator
Calculate the area under a curve numerically using the trapezium rule or Simpson's rule. Enter y-values at equally spaced x-intervals.
Numerical Integration Guide
The Trapezium Rule
Area ≈ h/2 × (y₀ + 2y₁ + 2y₂ + ... + 2y_{n-1} + y_n). Where h = (b-a)/n is the strip width. The first and last ordinates appear once; all others appear twice. This estimates the area by approximating each strip as a trapezoid. Accuracy: the trapezium rule overestimates for convex curves and underestimates for concave curves. The error is proportional to h² — halving h quarters the error. More strips = more accurate. Example: y = x² from 0 to 4 with 4 strips (h=1). y values: 0, 1, 4, 9, 16. Area
Simpson's Rule
Area ≈ h/3 × (y₀ + 4y₁ + 2y₂ + 4y₃ + ... + 4y_{n-1} + y_n). Requires an even number of strips (odd number of ordinates). Weights alternate 4, 2, 4, 2... between the inner points. Simpson's rule fits parabolas through each triplet of consecutive points — much more accurate than the trapezium rule for smooth functions. The error is proportional to h⁴ — halving h gives 16× reduction in error. For the same example (x² from 0 to 4 with 4 strips): Area ≈ 1/3 × (0 + 4×1 + 2×4 + 4×9 + 16) = 1/3 × 64 = 2
When to Use Each Method
Trapezium rule: when you have measured data at equally spaced intervals and cannot choose the method. When you have an odd number of strips. When a quick estimate is sufficient. Simpson's rule: when you need higher accuracy. When the function is smooth. Must have an even number of strips (n must be even). A-level maths: both methods are in the A-level syllabus. Simpson's rule gives much better accuracy for most smooth functions — typically 10-100× more accurate than the trapezium rule for the sa
Improving Accuracy
Strategies to improve numerical integration accuracy: increase the number of strips (most straightforward). Use Simpson's rule instead of trapezium where possible. Use composite rules: apply Simpson's rule to smaller sub-intervals. Check convergence: if doubling the strips gives a noticeably different answer, the current accuracy is insufficient. Upper and lower bounds: for monotone functions, trapezium rule gives either an overestimate or underestimate — the average of upper and lower rectangle
Recommended for this calculator