Math & Education
Integral Calculator (Definite & Antiderivative)
Compute definite integrals of any function numerically to high precision, and get the exact antiderivative of polynomials — the area under a curve in seconds.
How to use
- 1Type a function of x, e.g. x^2, sin(x) or exp(-x^2).
- 2Enter the lower and upper limits for a definite integral.
How it's calculated
Definite integrals use adaptive Simpson's rule (error target 10⁻¹⁰). For polynomials the antiderivative is exact: ∫ xⁿ dx = xⁿ⁺¹ / (n+1) + C.
Frequently asked questions
Can it integrate trig and exponential functions?
Yes — definite integrals work for any function that's finite on the interval. The symbolic antiderivative is shown for polynomials.
What about improper integrals?
Infinite limits or asymptotes inside the interval aren't supported — use a large finite bound as an approximation.
Why is the answer negative?
A definite integral counts area below the x-axis as negative. The 'total area' output counts all area as positive.
A worked example: polynomial vs. non-polynomial functions
For f(x) = 3x² + 2x from 0 to 2, the exact antiderivative is x³ + x² + C (applying the power rule to each term: ∫3x² dx = x³, ∫2x dx = x²), and evaluating gives (8 + 4) − (0 + 0) = 12 — exactly what the calculator returns. For f(x) = sin(x) from 0 to π, there's no polynomial antiderivative to display, so the tool falls back to 'Shown for polynomials only' — but it still computes the definite integral numerically and correctly returns 2, since sin(x) integrates to −cos(x) and −cos(π) − (−cos(0)) = 1 + 1 = 2.
Why adaptive Simpson's rule, not a fixed grid
Rather than slicing the interval into a fixed number of equal pieces, the integrator recursively splits any sub-interval further wherever Simpson's rule (which fits a parabola through three points) hasn't converged to within 10⁻¹⁰ of the previous estimate, concentrating effort where the function is changing fastest. This makes it accurate for both smooth functions and ones with sharp curvature, without needing you to specify how finely to sample.
Signed value vs. total area aren't the same number
Integrating f(x) = x from −1 to 1 gives a value of 0 — the area below the x-axis (from −1 to 0) exactly cancels the area above it (from 0 to 1). But the 'total area' output treats both halves as positive and sums them, giving 1. Which number you want depends on the question: net displacement (signed) or total distance traveled (absolute area) are a classic example of when these two diverge.
The same limits give zero, and a tiny result is wiped to zero
If I set the lower and upper limits equal, both the signed integral and the total area come back as zero, without trying to sample the function. Swapping the limits flips the sign of the integral and leaves the total area positive, because the area path folds the function to its absolute value first. A signed result whose size is smaller than a tiny threshold is shown as zero, which is how a numerical wobble around a true zero gets cleaned up. The antiderivative line only fills in for polynomials. Anything else says it is shown for polynomials only, even when the numeric integral succeeded. I still have to type a function and both limits, or the page stops before any of those numbers appear.
Related tools
- Derivative Calculator
Differentiate any function of x symbolically — polynomials, trig, exponentials, logs and products — and evaluate the derivative at a point.
- Equation Solver (Linear & Quadratic)
Solve linear and quadratic equations in x — typed naturally like 3x + 5 = 2x - 7 or x^2 - 5x + 6 = 0 — with the discriminant, vertex and real or complex roots.
- Limit Calculator
Find the limit of a function as x approaches a number or infinity — checks the left- and right-hand limits and spots infinite limits and limits that don't exist.
- Polynomial Factoring Calculator
Factor polynomials with integer coefficients — common factors, rational roots, difference of squares and irreducible quadratics — and list all the roots.
- Triangle Calculator
Solve any triangle from three known values (SSS, SAS or ASA): all sides, angles, area, perimeter and heights, using the law of sines and cosines.
- Area, Perimeter & Volume Calculator
Calculate the area and perimeter of 2D shapes (circle, rectangle, triangle, trapezoid, ellipse, hexagon) and the volume and surface area of 3D solids (sphere, cylinder, cone, box, pyramid).