On this page
How to use the integral calculator
- Type your function of
xin the function box. - Enter the limits
aandb. Numbers work, and so do expressions such aspi/2. Useinfor-inffor an infinite limit. - Press Integrate or Enter. You get the value to about 12 digits, a tidy form such as π when the tool recognises one, and a graph with the area shaded.
- If an antiderivative appears, the tool found it and confirmed it by differentiating it back. The rules used are listed as steps, with F(b) - F(a) beside them. If none appears, the page says so and gives the numeric value.
- Choose a Riemann method (left, right, midpoint, trapezoid or Simpson) and n from 1 to 500 to see the sum, the exact value and the error, with the rectangles drawn.
- Press Revolve about the x-axis or about the y-axis for a volume and a rotatable 3D solid.
| You want | Type |
|---|---|
| x squared | x^2 |
| sine, square root | sin(x), sqrt(x) |
| e to the minus x squared | e^(-x^2) |
natural log (log is base 10) | ln(x) |
| a limit of π/2, or infinity | pi/2, inf, -inf |
The full page also has a double integral panel: enter f(x, y) and a rectangle, and it computes the volume under the surface and draws it.
The math behind it
Signed area and total area
A definite integral ∫ₐᵇ f(x) dx adds up the area between the curve and the x-axis, counting area above the axis as positive and area below as negative. That sum is the signed area. For sin(x) from 0 to 2π the two humps cancel and the integral is 0, yet the region really covers an area of 4. The total area is the integral of |f(x)|. The tool shows it whenever part of the curve dips below the axis.
Riemann sums
Cut [a, b] into n strips of width h = (b - a)/n and add up one rectangle per strip. The rectangle height is f at the left end (left sum), the right end (right sum) or the middle (midpoint sum). The trapezoid rule averages the two ends, and Simpson's rule fits a parabola through each pair of strips, so it needs an even n (the tool rounds an odd n up by one).
As n grows, the sum converges to the integral. This table uses ∫₀¹ 1/(1 + x²) dx = π/4 = 0.7853981634 and lists sum minus exact value (e-2 means × 10⁻²):
| n | Left error | Midpoint error | Simpson error |
|---|---|---|---|
| 4 | 5.990e-2 | 1.302e-3 | -6.007e-6 |
| 8 | 3.060e-2 | 3.255e-4 | -3.778e-8 |
| 16 | 1.546e-2 | 8.138e-5 | -5.912e-10 |
| 32 | 7.772e-3 | 2.035e-5 | -9.239e-12 |
| 64 | 3.896e-3 | 5.086e-6 | -1.444e-13 |
Doubling n halves the left error and quarters the midpoint error. Simpson collapses much faster. For sin(x) on [0, π] its error drops by about 16 times per doubling.
Disks and shells
Spin the region under y = f(x) around the x-axis and each slice is a disk of radius f(x), so V = π ∫ f(x)² dx. Spin it around the y-axis and each slice is a thin cylinder (a shell) of radius x and height f(x), so V = 2π ∫ x·f(x) dx. The shell option needs an interval that does not cross x = 0.
Improper integrals
With an infinite limit, ∫ₐ^∞ f(x) dx means the limit of ∫ₐᵗ f(x) dx as t grows. If that limit is a finite number the integral converges. If the area keeps growing, it diverges.
Double integrals
Over a rectangle, integrate in y first, then in x. For f = x² + y² on x in [0, 1], y in [0, 2], the hand answer is 2/3 + 8/3 = 10/3, and the tool returns 3.33333333333.
Three worked examples
1. Area under sin(x) and a midpoint sum
Take ∫₀^π sin(x) dx. The antiderivative is -cos(x), so F(π) - F(0) = 1 - (-1) = 2. The tool shows F(0) = -1, F(π) = 1 and the value 2.
Now check it with a midpoint sum at n = 4. Here h = π/4 and the midpoints are π/8, 3π/8, 5π/8 and 7π/8. The heights are 0.382683, 0.923880, 0.923880 and 0.382683, which total 2.613126. Multiply by h: 2.613126 × 0.785398 = 2.052344, an overestimate of 0.052344. At n = 8 the sum is 2.012909 (error 0.012909), about four times smaller, and at n = 100 it is 2.000082. Simpson at n = 8 gives 2.000269.
2. Volume of revolution of y = √x from 0 to 4
About the x-axis, the disk radius is √x, so V = π ∫₀⁴ (√x)² dx = π ∫₀⁴ x dx = π · 4²/2 = 8π. The tool reports V = 25.13274123, and V/π = 8 (to 14 digits). About the y-axis, the shell formula gives V = 2π ∫₀⁴ x · √x dx = 2π · (2/5) · 4^(5/2) = 2π · 12.8 = 128π/5 = 80.42477193. Separately, the area under the curve is 16/3 = 5.333333333, with the verified antiderivative 2x^(3/2)/3.
3. The Gaussian integral over the whole line
∫ e^(-x²) dx from -∞ to ∞ is the integral behind the normal distribution, and it equals √π. This function has no elementary antiderivative, so the tool says no closed form was found and gives the numeric value: 1.77245385091. The true √π is 1.7724538509055, so all 12 printed digits agree. Integrating from 0 to inf gives 0.886226925453, which is √π/2 (0.8862269254528), as symmetry demands.
Reading the result and common mistakes
- Radians. Trig functions here take radians. Use
piin the limits, not 180. - A zero or negative answer. That is signed area. For the physical area, read the total area line.
- Divergent integrals. ∫₁^∞ 1/x dx has no finite value: its antiderivative ln|x| grows without limit. The tool checks how the area grows as the cut-off moves from 100 to 10,000 to 1,000,000. For 1/x it keeps adding about 4.605 (ln 100) each time, so the tool reports that the integral diverges instead of printing a number. For 1/x² the extra area shrinks to almost nothing, and the result is 1 (shown as 0.999999999998).
- Singular endpoints lose digits. ∫₀¹ 1/√x dx is exactly 2 and the antiderivative route shows 2, but the numeric value reads 1.99999995644 because f blows up at 0. The 12-digit figure applies to smooth functions.
- No antiderivative shown. The tool only displays one it can verify. Its absence does not prove none exists, only that none was found on its list of rules, which covers power rule, linearity, u-substitution, simple integration by parts, half-angle forms and a few standard fractions. Our guides on common integration mistakes and the definite integral calculator cover more.
- Shells across zero. Pick an interval entirely on one side of x = 0, or use disks.
Frequently asked questions
Is this integral calculator free, and are the steps free?
Yes. The value, the graph, the Riemann sums and the volume of revolution cost nothing, and the steps appear whenever the tool finds an antiderivative it can verify.
Can it do indefinite integrals?
It shows an antiderivative plus C when it finds one and confirms it by differentiating back. If it cannot, you get the definite value computed numerically and a note that no closed form was found.
How accurate is the answer?
About 12 significant digits for smooth functions, using adaptive Gauss-Kronrod quadrature. Expect fewer correct digits when the function blows up at an endpoint, like 1/sqrt(x) at 0.
Why is my area negative or zero?
An integral is signed area, so regions below the x-axis subtract. When that happens the tool also prints the total area, which treats every region as positive.
Does it handle improper integrals?
Yes. Type inf or -inf as a limit. The tool also checks whether the area settles as the limit grows, so a divergent integral such as 1/x from 1 to infinity is reported as divergent rather than given a number.
Which Riemann method should I pick?
Midpoint and trapezoid beat left and right at the same n. Simpson is the most accurate of the five for smooth functions. Left and right are mainly for learning the definition and for bounding monotone functions.