Integral calculator: exact antiderivatives where the rules allow, reliable numbers always
This integral calculator evaluates definite integrals ∫ₐᵇ f(x) dx numerically with adaptive Simpson’s rule — accurate to around ten significant figures with an explicit error estimate — and, for a large family of common integrands, also finds the antiderivative F(x) symbolically so you get the exact value F(b) − F(a), such as 1/3 for ∫₀¹ x² dx or 2 for ∫₀^π sin x dx.
A graph shades the signed area under the curve and overlays the left, midpoint, right or trapezoid approximation with the number of strips you choose, so you can watch a Riemann sum converge to the integral — the picture behind the definition. Results copy as LaTeX, including the antiderivative when one was found.
The expression engine is math.js (Apache-2.0), fetched from a CDN the first time the page is used. Every calculation runs in your browser.
How to use the Integral Calculator
- Type the integrand, for example
x^2,sin(x),x * e^(2x)ore^(-x^2). The variable is detected automatically. - Enter the lower and upper limits. Expressions such as
pi/2oreare accepted. - Choose how many rectangles the Riemann sum should use and which rule — left, midpoint, right or trapezoid. The sum and the graph update immediately.
- Read the value in the result panel: exact when an antiderivative was found, otherwise the adaptive-Simpson value with its error bound.
- Open the details for the antiderivative, the numeric value, the Riemann sum and the average value of f, then copy the LaTeX or the plain-text result.
Integral Calculator features
Adaptive Simpson with error estimate
The interval is split into panels that are refined where the function varies most, with Richardson extrapolation; the reported error bound is the accumulated |S₂ − S₁|/15.
Symbolic antiderivatives for common forms
Polynomials and powers of linear expressions, 1/(ax+b), exponentials, sin, cos, tan, ln, sqrt, sinh and cosh with linear arguments, sin² and cos², products x·e^(ax), x·sin(ax), x·cos(ax), xⁿ·ln x, and 1/(1+x²), 1/√(1−x²).
Verified, not guessed
Every antiderivative is differentiated again and compared with the integrand at sample points before it is shown.
Riemann-sum visual
Left, midpoint, right and trapezoid rules with 4 to 100 strips, drawn as an SVG over the shaded exact area, with the sum and its error listed.
Improper endpoints handled
If f is undefined at a limit (1/√x at 0), the endpoint is moved inward by a tiny amount and the result is labelled as an approximation.
LaTeX export
The definite integral, its value and the antiderivative copy as LaTeX ready for a report or Overleaf.
What is integrated symbolically — and what is not
Symbolic integration is much harder than differentiation: there is no general algorithm that produces a tidy closed form for every elementary function, and many integrals (e^(−x²), sin(x)/x, √(1 + x³)) provably have none. This calculator uses a rule table that covers the integrands met in most courses and engineering work, and says clearly when the rules do not apply. The numeric value is computed regardless.
| Integrand | Antiderivative (+ C) | Rule |
|---|---|---|
| (ax + b)ⁿ, n ≠ −1 | (ax + b)ⁿ⁺¹ / (a(n + 1)) | Power rule with linear substitution |
| 1/(ax + b) | ln|ax + b| / a | Logarithmic rule |
| e^(ax+b), c^(ax+b) | e^(ax+b)/a, c^(ax+b)/(a ln c) | Exponential rule |
| sin(ax+b), cos(ax+b) | −cos(ax+b)/a, sin(ax+b)/a | Trigonometric rules |
| x·e^(ax), x·sin(ax), x·cos(ax) | e^(ax)(ax − 1)/a², (sin ax − ax cos ax)/a², (cos ax + ax sin ax)/a² | Integration by parts |
| ln x, xⁿ ln x | x ln x − x, xⁿ⁺¹ ln x/(n+1) − xⁿ⁺¹/(n+1)² | Integration by parts |
| 1/(1 + x²), 1/√(1 − x²) | atan x, asin x | Inverse trig rules |
Worked example: ∫₀¹ x² dx
By the power rule, an antiderivative of x² is F(x) = x³/3. The fundamental theorem of calculus then gives ∫₀¹ x² dx = F(1) − F(0) = 1/3 − 0 = 1/3. The adaptive Simpson value is 0.3333333333 with an error bound far below 10⁻¹⁰; in fact Simpson’s rule is exact for cubics, so the only error is rounding.
The midpoint Riemann sum with 10 strips gives 0.3325 and the trapezoid rule gives 0.335 — one below and one above the true value, as expected for a convex function. Doubling n roughly quarters each error, which you can confirm by switching n from 10 to 20.
Tips and limits
- Write the integrand explicitly:
x*sin(x), notx sin x;e^(2x)with brackets around the exponent. - Infinite limits are not accepted directly. For ∫₀^∞ e^(−x) dx, use a large upper limit such as 40 and check that increasing it no longer changes the result.
- Integrands with a singularity inside the interval (1/x on [−1, 1]) do not converge; the calculator will report that the integral does not converge or give an unreliable value with a large error estimate.
- Oscillatory integrands over long ranges (sin(100x) on [0, 100]) need many evaluations; the error estimate tells you how much to trust the number.
- Need the reverse? The derivative calculator differentiates symbolically, and the equation solver finds where f(x) = 0 so you can split an integral at the sign changes.
Integral Calculator FAQ
How do I find a definite integral with this integral calculator?
Type the function, enter the limits a and b, and read the value. If the antiderivative is in the rule table the value is exact (for example 1/3); otherwise it is computed numerically to about ten significant figures with an error estimate.
Can it find the indefinite integral (antiderivative)?
Yes, for polynomials, powers and exponentials of linear expressions, sin, cos, tan, ln, sqrt, hyperbolic functions, sin², cos², simple products by parts and the inverse-trig forms. The antiderivative is shown as F(x) + C and included in the LaTeX copy.
What does the error estimate mean?
Adaptive Simpson compares each panel’s estimate with the sum of its two halves; the difference divided by 15 bounds the local error. The reported figure is the sum of those bounds, so the true error is usually far smaller.
Why is my integral shown as numeric only?
The integrand is outside the supported rule set — for example e^(−x²) or sin(x)/x have no elementary antiderivative at all. The numeric value is still reliable.
What is the difference between the Riemann sum and the integral?
A Riemann sum approximates the area with n rectangles; the integral is the limit as n → ∞. The calculator shows both so you can see the sum converge as n grows.
Does it handle improper integrals?
Endpoint singularities such as 1/√x at 0 are approximated by nudging the limit inward and are labelled as such. Infinite limits and interior singularities are not supported — split the interval or use a finite cutoff.