CompoundPage

Integral Calculator

An integral calculator with steps: antiderivatives worked by rule, every step named and checked by differentiation, and definite integrals between any two bounds.

Use ^ for powers. 2x, 3cos(x) and x(x+1) multiply. log is the natural log; use log10 for base 10.

One letter. In an indefinite integral every other letter is a constant.

A number, an expression such as pi/2, or inf for infinity.

Definite integrale/2 - 1/2 ≈ 0.8591409142

Read as
xe^(x²)
Antiderivative
e^(x²)/2 + C
Step 1: u-substitution on xe^(x²) u = x², du = 2x dx, so ∫f(g(x))·g′(x) dx = ∫f(u) du
e^(x²)/2
Step 2: Exponential rule on e^u ∫e^u du = e^u
e^u
Check Differentiated, the antiderivative simplifies back to the integrand exactly.
d/dx [e^(x²)/2] = xe^(x²)
F(1) - F(0) The fundamental theorem of calculus: the antiderivative at the upper bound minus at the lower.
e/2 - 1/2 ≈ 0.8591409142
Numeric value (adaptive Gauss-Kronrod) Estimated error 3.2 × 10^-11, from 1 subinterval and 15 function evaluations.
0.8591409142

How the Integral Calculator works

An integral adds up a quantity that changes continuously. The definite integral of f(x) from a to b is the signed area between the graph and the x-axis from x = a to x = b: area above the axis counts as positive, area below as negative. The indefinite integral, or antiderivative, is a function F whose derivative is f. The integral calculator does both, and each half checks the other.

Antiderivatives by rule. Integration runs the rules of differentiation backward. The power rule becomes ∫xⁿ dx = xⁿ⁺¹/(n + 1) for any n except -1, so ∫x² dx = x³/3 + C. The exception is ∫1/x dx = ln|x| + C. The constant C is there because a constant differentiates to 0, so x³/3 + 5 has the same derivative as x³/3.

Sums and constant multiples. A sum integrates term by term and a constant factor stays outside. So ∫(3x² + 4cos(2x) + 1/x) dx = x³ + 2sin(2x) + ln|x| + C.

A linear inside function. When the inside is ax + b, integrate the outside and divide by a: ∫e^(2x + 1) dx = e^(2x + 1)/2 + C and ∫cos(3x) dx = sin(3x)/3 + C.

u-substitution. When the integrand is a function of g(x) times g′(x), set u = g(x). For x·e^(x²), u = x² and du = 2x dx, so x dx is du/2 and the integral is ∫eᵘ du/2 = e^(x²)/2 + C.

Standard forms. ∫sec²(x) dx = tan(x), ∫1/(1 + x²) dx = arctan(x), ∫1/√(1 - x²) dx = arcsin(x), ∫tan(x) dx = -ln|cos(x)|, and ∫sin²(x) dx = x/2 - sin(2x)/4 through the identity sin²(x) = (1 - cos(2x))/2.

Every antiderivative is checked. Differentiating the answer has to give back the integrand, exactly or at up to 24 test points where the two differ by an identity. An antiderivative that fails is not shown.

Definite integrals, numerically. A definite integral is computed by adaptive Gauss-Kronrod quadrature from the function's values alone, so it works whether or not there is an antiderivative. ∫ from -∞ to ∞ of e^(-x²) dx, which has no elementary antiderivative, comes out as 1.772453851, the square root of π.

Both, for the same integral. When there is an antiderivative and both bounds are finite, the calculator also works out F(b) - F(a), the fundamental theorem of calculus, and shows it only if it matches the numeric value. For x·e^(x²) from 0 to 1, F(1) - F(0) = e/2 - 1/2, and the numeric value is 0.8591409142.

Improper integrals. An infinite bound, or a function that blows up at a bound, makes an improper integral. Some converge: ∫ from 0 to 1 of 1/√x dx = 2. Some do not: ∫ from 0 to 1 of 1/x dx is infinite.

Integral Calculator FAQ

How do you calculate an integral step by step?

Match the integrand to a rule, starting from the outside. A sum splits into terms, a constant factor comes out front, and each piece is a power, an exponential, a trig function or a substitution. For 3x² + 4cos(2x) + 1/x that gives x³ + 2sin(2x) + ln|x| + C. Then differentiate the answer to check it, which is what this calculator does before it shows one.

What is the difference between a definite and an indefinite integral?

An indefinite integral is a function: the antiderivative F(x) + C, whose derivative is the integrand. A definite integral is a number: the signed area under the curve between two bounds, equal to F(b) - F(a) when F exists and the function is continuous on the interval.

Why is there a + C?

Because a constant has derivative 0. x³/3, x³/3 + 1 and x³/3 - 7 all have derivative x², so all of them are antiderivatives of x², and + C stands for the whole family. A definite integral has no C: it cancels in F(b) - F(a).

Can it do integration by parts?

No. Integration by parts, partial fractions and trigonometric substitution each involve a choice, and a wrong choice gives a harder integral rather than an answer. When an integrand looks like it needs one of them, the calculator says which. A definite integral of the same function still works, because that part is numeric.

How accurate is the definite integral?

The calculator aims for about ten significant figures and shows its own error estimate next to the answer. The estimate is the difference between a 15-point and a 7-point Gauss rule on each piece of the interval, which is usually far larger than the true error. Near a singularity at a bound the precision of the arithmetic limits it, and the calculator says so.

Can it integrate to infinity?

Yes. ∫ from 0 to inf of e^(-x) dx is 1 and ∫ from -inf to inf of 1/(1 + x²) dx is π. If the integral does not converge, such as ∫ from 1 to inf of 1/x dx, it says so rather than returning a large number.

Worked examples

Related calculators

Embed this calculator
<div id="compoundpage-integral-calculator"></div>
<script src="https://compoundpage.com/embed/integral-calculator.js" async></script>

The same calculation as JSON