How this integral calculator works
This is a definite integral calculator: it returns one number, the signed area between your curve and the x-axis from a to b. It never finds an antiderivative. Instead it evaluates f(x) at 1,001 evenly spaced points and combines them with composite Simpson's rule, which is why it can integrate functions that have no closed-form antiderivative at all (try e^(-x^2) from 0 to 1). The honest trade-off: if you need the indefinite integral (the symbolic antiderivative, with steps), that takes a computer algebra system, not a numerical method. No calculator that works this way can show algebra steps, because there aren't any.
Supported syntax: numbers, x, the operators + - * / ^, parentheses, the functions sin cos tan asin acos atan sqrt abs ln log exp (log is base 10, ln is natural), and the constants pi and e. Multiplication must be explicit: 2*x, not 2x.
The formula
Here n is the number of subintervals (we use 1,000), h is the width of each one, and x0 ... xn are the sample points from a to b. The friendly version: Simpson's rule slices your interval into narrow strips, and instead of approximating the curve in each strip with a flat top (rectangles) or a slanted top (trapezoids), it fits a small parabola through each set of three neighboring points. Parabolas hug curves so well that the error shrinks with the fourth power of the strip width: halve the strips and the error drops roughly 16-fold. That's why 1,000 strips is comfortable overkill for anything smooth.
Worked example
∫01 x² dx: the antiderivative is x³/3, so the exact answer is 1/3. The calculator returns 0.333333, matching to every displayed digit (Simpson's rule is actually exact for polynomials up to degree 3).
∫0π sin(x) dx: the antiderivative is −cos(x), so the exact answer is −cos(π) − (−cos(0)) = 1 + 1 = 2. Enter sin(x) with bounds 0 and pi and you'll get 2.000000.
Common antiderivatives worth memorizing
For hand integration (and for checking this calculator against exact answers), these five cover a remarkable share of homework:
| f(x) | ∫ f(x) dx | Watch out for |
|---|---|---|
| xn (n ≠ −1) | xn+1⁄(n+1) + C | Fails at n = −1; that case is the next row |
| 1⁄x | ln|x| + C | The absolute value matters for x < 0 |
| ex | ex + C | Its own antiderivative; enjoy it |
| sin(x) | −cos(x) + C | The minus sign, every single time |
| cos(x) | sin(x) + C | No minus sign here; sin/cos are asymmetric |
When numerical integration lies (and how we avoid it)
Numerical methods fail loudly in one case and quietly in another. The loud case is a singularity: integrate 1/x from −1 to 1 and a sample point lands on the vertical asymptote at 0. Some calculators average their way to a plausible-looking garbage number; this one checks every sample for infinities and domain errors (sqrt of a negative, asin beyond ±1) and tells you the integral is improper instead. The quiet case is undersampling: a function oscillating thousands of times between your bounds can wiggle right between the sample points. With 1,000 subintervals you're safe up to a few hundred oscillations; past that, split the interval and integrate the pieces.