Skip to content
CornerTools

Integral Calculator

Find antiderivatives, definite and improper integrals with every technique named, each answer checked by differentiating it back.

Powers ^, sqrt( ), ln, log, log_2( ), e^x, |x|. Trig in radians.

Type a function and the calculator finds its antiderivative the way it is done by hand, naming each method as it goes: the standard integrals, substitution, integration by parts, partial fractions, powers of trig functions and trig substitution. Give a lower and an upper bound for a definite integral, including ∞, and it works out the exact value, splitting the range where the function breaks and taking limits where the integral is improper, so it says when an integral diverges.

Every antiderivative is differentiated back numerically and compared with the function before it is shown, and every definite integral is also computed numerically: an exact value appears only when the two agree. Where no method finds an antiderivative, it says so plainly, and still gives the numerical value between bounds. All of it is worked out in your browser.

How to use it

Function is typed as you would write it: 2x is 2 × x, sqrt(x) or √x a square root, |x| the absolute value, e^x the exponential, and trig functions work in radians. A bare log is ln unless you set log means to log₁₀, and the Read as line shows how the text was read. With another letter in the function, such as a in a x², choose which letter to integrate with respect to; the others are constants, and the answer keeps them as letters, without a graph or numerical value.

Leave From and To empty for the indefinite integral, F + C. Fill both for a definite integral: each takes a number or an exact value such as 1/2, pi/2, sqrt(2) or e (1e-3 alone is 0.001), or ∞ from the button beside it (−∞ beside From; typing −inf works too). A lower bound above the upper one is allowed and changes the sign of the answer.

Standard integrals, substitution, integration by parts, partial fractions, trig powers and trig substitution. Not piecewise functions, integrals in two variables, or integrals that need special functions.

How it works

The methods are tried in the order they are taught. A sum is integrated term by term. A table of standard integrals covers powers, eˣ and aˣ, the six trig functions, sec², csc², sec·tan, csc·cot, sinh, cosh and tanh, each also with a linear inside such as cos(3x + 1), and 1/(x² + a²), 1/√(a² − x²) and 1/√(x² ± a²). Then substitution: for each inside u = h(x), the function is divided by h′(x), and if what is left is written in u alone, the integral is taken in u and u is put back.

A ratio of polynomials is divided first if the numerator's degree is not lower, then its denominator is factored over the rationals and split into partial fractions, whose coefficients are found by matching the coefficients of each power of x. A quadratic factor that does not factor gives an arctangent after completing the square. Integration by parts chooses u by LIATE — logarithmic, inverse trig, algebraic, trig, exponential — and is applied up to 10 times in a row; when the integral comes back, as for eˣ sin x, the equation is solved for it. Powers of sin and cos use an odd power's substitution or the half-angle formulas; tan, sec, cot and csc powers up to 6 use their reduction formulas; and √(a² − x²), √(x² + a²) and √(x² − a²) are handled by the substitutions x = a sin θ, a tan θ and a sec θ.

Each antiderivative is then checked: its derivative is computed numerically, by central differences with Richardson extrapolation, and compared with the function at three points where both have values. An answer that fails is not shown.

For a definite integral, the range is split wherever the function or its antiderivative is undefined: a denominator of 0, a logarithm of 0, the edge of a root, or a pole of tan or sec. On each part, F(b) − F(a) is exact; an end at a singular point or at ±∞ makes the integral improper, and F's limit there is taken instead. Each part must converge for the whole to converge.

Alongside, the integral is computed numerically by the adaptive Gauss–Kronrod method of QUADPACK: the 7-point Gauss and 15-point Kronrod rules on each interval, the difference between them estimating the error, the worst interval halved until the total is within 10⁻¹⁰ of the value or 2,000 intervals are used, and Wynn's ε-algorithm accelerating the sums. An infinite range is mapped onto (0, 1] first. A numerical value is printed to the digits its error estimate supports, at most 10 significant figures.

∫ xⁿ dx = xⁿ⁺¹/(n + 1) + C, for n ≠ −1
∫ 1/x dx = ln|x| + C
Substitution: ∫ g(h(x)) h′(x) dx = ∫ g(u) du, with u = h(x)
By parts: ∫ u dv = uv − ∫ v du
∫ₐᵇ f(x) dx = F(b) − F(a)
Improper: ∫ₐ^∞ f(x) dx = lim (t → ∞) F(t) − F(a)

Examples

By parts: x eˣ

Function
x e^x

x is algebraic and eˣ exponential, so LIATE takes u = x and dv = eˣ dx. Then du = dx and v = eˣ, and what is left, ∫ eˣ dx, is a standard integral: ∫ x e^x dx = x e^x − e^x + C.

  1. By parts with u = x and dv = e^x dx (LIATE: algebraic before exponential), so du = dx and v = e^x: ∫ x e^x dx = x e^x − ∫ e^x dx​​​ ​ ​​
  2. A standard integral: ∫ e^x dx = e^x​​
  3. Add the constant of integration C: ∫ x e^x dx = x e^x − e^x + C​​​ ​

Substitution: 2x cos(x²)

Function
2x cos(x^2)

The inside of cos is x², whose derivative 2x is the other factor, so u = x² turns the integral into ∫ cos(u) du: ∫ 2x cos(x²) dx = sin(x²) + C.

  1. Substitute u = x², so du = 2x dx: ∫ 2x cos(x²) dx = ∫ cos(u) du​​​ ​​
  2. A standard integral: ∫ cos(u) du = sin(u)​​
  3. Put back u = x²: sin(u) = sin(x²)
  4. Add the constant of integration C: ∫ 2x cos(x²) dx = sin(x²) + C​​​

Partial fractions: 1/(x² − 1)

Function
1/(x^2 - 1)

The denominator factors as (x − 1)(x + 1), so the fraction splits into A/(x − 1) + B/(x + 1). Each part integrates to a logarithm, and the two combine: ∫ (1/(x² − 1)) dx = (1/2) ln|(x − 1)/(x + 1)| + C.

  1. Factor the denominator: x² − 1 = (x − 1)(x + 1) ​
  2. Partial fractions: 1/((x − 1)(x + 1)) = A/(x − 1) + B/(x + 1)
  3. Match the coefficients of each power of x and solve: A = 1/2, B = −1/2: 1/((x − 1)(x + 1)) = 1/(2(x − 1)) − 1/(2(x + 1))
  4. Integrate each part: ∫ (1/(x² − 1)) dx = (1/2) ln|(x − 1)/(x + 1)|​​ ​
  5. Add the constant of integration C: ∫ (1/(x² − 1)) dx = (1/2) ln|(x − 1)/(x + 1)| + C​​ ​

A singularity inside the range: 1/x² from −1 to 1

Function
1/x^2
From
-1
To
1

Taken blindly, the antiderivative −1/x gives F(1) − F(−1) = −2: a negative area under a function that is never negative. The mistake is that 1/x² is undefined at 0, inside the range, so the integral must be split there, and each part is improper. As x → 0 from either side, −1/x grows without bound, so ∫_(−1)¹ (1/x²) dx diverges.

  1. Power rule: ∫ x^n dx = x^(n + 1)/(n + 1): ∫ (1/x²) dx = −1/x​​
  2. Add the constant of integration C: ∫ (1/x²) dx = −1/x + C​​
  3. Split at x = 0, where the function or its antiderivative is undefined; each part must converge: ∫_(−1)¹ (1/x²) dx = ∫_(−1)⁰ (1/x²) dx + ∫₀¹ (1/x²) dx​​ ​​ ​​
  4. x = 0 is a singular point: take the limit of the antiderivative from the left: lim_(x→0⁻) −1/x = ∞​
  5. The limit is infinite, so the integral diverges

Integrals of common functions

Antiderivatives as the calculator finds them, each checked by differentiating it back
FunctionIntegral
x³x⁴/4 + C
1/xln|x| + C
√x2x√x/3 + C
e^xe^x + C
2^x2^x/ln(2) + C
ln(x)x ln(x) − x + C
sin(x)−cos(x) + C
cos(x)sin(x) + C
tan(x)−ln|cos(x)| + C
sec²(x)tan(x) + C
1/(x² + 1)atan(x) + C
1/√(−x² + 1)asin(x) + C
x e^xx e^x − e^x + C
sin²(x)x/2 − sin(2x)/4 + C

Sources

The numerical integration follows QUADPACK; the integrands named as having no elementary antiderivative are those proved so by Liouville's theorem, as Rosenlicht sets it out.

Sources

Reviewed

Frequently asked questions

A constant's derivative is 0, so x² and x² + 5 both have the derivative 2x: an antiderivative is found only up to a constant, and + C stands for all of them. Where the function is undefined at points, as 1/x is at 0, the constant can even differ on each side, and the calculator says so. In a definite integral the constant cancels.
ln x has values only for x above 0, but 1/x has values for negative x too. ln|x| has the derivative 1/x on both sides of 0, so it is the antiderivative of 1/x wherever 1/x is defined. The same holds for every logarithm the calculator writes with bars.
Because none exists in elementary functions — sums, products, powers, roots, exponentials, logarithms and trig functions of x. Liouville's theorem proves these have no elementary antiderivative; e^(−x²), sin(x)/x, eˣ/x and 1/ln x are the classic cases. Their antiderivatives are new functions, named erf, Si, Ei, li and so on; the calculator names the one that applies. Between bounds it still gives the numerical value: e^(−x²) from −∞ to ∞ is ≈ 1.772453851, which is √π.
A definite integral is a signed area: area below the axis counts as negative. From 0 to π, sin x is above the axis and the integral is 2; from π to 2π it is below and the integral is −2; together they give 0. For the total area, integrate |sin x| instead: no method here finds its antiderivative, but between the same bounds the calculator gives ≈ 4 numerically. The graph shades the two kinds of area in different tones.
By the standard definition the integral diverges: the part from 0 to 1 alone grows without bound. Cutting out a small gap (−ε, ε) around 0 and letting ε shrink gives 0 by symmetry, which is called the Cauchy principal value. It is a different, weaker idea, and the calculator does not use it.

See also