Compute definite integrals numerically using Simpson's rule
How it works
An integral accumulates a quantity across an interval. The definite form gives the signed area between a curve and the x-axis; the indefinite form gives the whole family of antiderivatives. Definite results here come from Simpson rule, which fits a parabola through each pair of sub-intervals rather than a straight line.
∫ₐᵇ f(x) dx = F(b) − F(a), where F′ = f Power rule: ∫ xⁿ dx = x^(n+1)/(n+1) + C, for n ≠ −1 Simpson: ∫ₐᵇ f(x) dx ≈ (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + … + 4f(xₙ₋₁) + f(xₙ)], h = (b − a)/n
a, blower and upper limits of integrationFany antiderivative of fCconstant of integration, present only in the indefinite formnnumber of Simpson sub-intervals, which must be evenhwidth of each sub-interval
- Antiderivative: F(x) = x⁴/4
- F(2) − F(0) = 16/4 − 0 = 4
- Simpson with n = 2 and h = 1: (1/3)[f(0) + 4f(1) + f(2)]
- (1/3)[0 + 4(1) + 8] = 12/3 = 4
- Simpson rule integrates any polynomial up to degree three without error, which is why two sub-intervals already give the exact answer above. Its error term carries a fourth derivative, so it only begins to drift on functions that curve more sharply than a cubic.
- What you get is signed area. ∫₀^2π sin x dx is zero because the lobes cancel; for physical area, integrate |f(x)| or split the interval at every root first.
- Quadrature rules break on integrands that blow up inside the interval. ∫₀¹ x^(−1/2) dx converges to 2 analytically, but sampling at x = 0 returns infinity, so improper integrals need a substitution or a limit rather than more sub-intervals.
Related Tools
Most Searched Today
Frequently Asked Questions
Integral Calculator runs right in the browser tab you already have open. No install, no account, no cost.
Integral Calculator follows the standard method used in textbooks and technical references for this calculation, and we show the formula or approach on the page itself so you can check the working rather than trust a black box. Found an edge case that breaks it? Use the feedback button in the bottom-right corner.