Integral Calculator
Work out a definite integral between two limits, with the signed and total area, an error estimate and the area drawn.
Result…
How it's calculated
Simpson's rule on [l, r]: S = (r − l)/6 × (f(l) + 4f(m) + f(r)), m = (l + r)/2 Adaptive: halve until |S(left) + S(right) − S(whole)| ≤ 15 × tolerance F(b) − F(a) = ∫ from a to b of f(x) dx
The definite integral by adaptive Simpson's rule, with the error estimated from the difference between each panel and its two halves. It refuses intervals where f is undefined or has a vertical asymptote (1/x across 0, ln(x) at 0), since those integrals are improper and may diverge. The antiderivative is given for simple cases: powers and polynomials of a linear inside, 1/x, sin, cos, e^x and aˣ, and sums and constant multiples of them. Angles are in radians.
Your numbers, step by step
About the Integral calculator
This integral calculator works out the definite integral of a function of x between two limits, a and b, and draws the area it measures. It uses adaptive Simpson's rule, which keeps splitting the interval where the curve bends until the answer settles, and reports an error estimate alongside the result. You get both the signed integral, where area below the x-axis counts as negative, and the total geometric area, where every piece counts as positive. For simple functions such as polynomials, 1/x, sin, cos and e^x it also gives the antiderivative F(x) and checks that F(b) − F(a) matches. If the function is undefined or has a vertical asymptote inside the interval, the calculator says so instead of returning a misleading number. To differentiate instead, use the derivative calculator.
How to use it
- Type the function in “f(x) =”, for example 3x^2 - 4x + 1 or e^(-x^2).
- Enter the lower limit in “From a =” and the upper limit in “To b =”. Constants like pi or pi/2 work too.
- Read the integral, its error estimate and the total area, then the antiderivative when one is found.
- Look at the shaded graph to see which parts of the area lie above and below the x-axis.
Worked example
Integrate f(x) = 3x^2 - 4x + 1 from a = −1 to b = 2. The antiderivative is F(x) = x^3 − 2x^2 + x + C, and F(2) − F(−1) = 2 − (−4) = 6, which matches the numeric result of 6. The curve dips below the x-axis between x = 1/3 and x = 1, so the total geometric area is larger: 6.2962962963. The average value of f on the interval is 6 ÷ 3 = 2.
Updated
Questions people ask
How do I calculate a definite integral?
Find an antiderivative F(x), then work out F(b) − F(a). When there is no simple antiderivative, a numerical method such as Simpson's rule adds up the area in small slices instead.
What is the difference between the integral and the area?
The integral is signed: area below the x-axis is subtracted. The total area adds every piece as positive. For sin(x) from −π to π, the integral is 0 but the total area is 4.
How accurate is Simpson's rule?
Adaptive Simpson's rule halves each slice until the two halves agree with the whole to a tight tolerance, so smooth functions come out correct to about 10 significant figures. The error estimate shows how closely the slices agreed.
Why does the calculator refuse 1/x from −1 to 2?
1/x has a vertical asymptote at x = 0, which lies inside the interval. That integral is improper and diverges, so no finite answer would be correct.
What happens if a is bigger than b?
The integral changes sign: the integral from a to b equals minus the integral from b to a. The total area stays positive.
Why is there no antiderivative for e^(-x^2)?
e^(-x^2) has no antiderivative made of elementary functions, and others, like x sin(x), need integration by parts, which this calculator doesn't do. The numeric value is still accurate, and the working says no antiderivative was found.