Skip to content

Integral Calculator: Antiderivatives and Definite Integrals

Antiderivative + C and definite integral, infinite bounds included.

Your details

Results update as you type

Definite integral ∫ₐᵇ f(x) dx

9

Antiderivative ∫ f(x) dx
x³/3 + C

Step-by-step solution
  1. f(x) = x²
  2. ∫ f(x) dx = x³/3 + C
  3. F′(x) = f(x) ✓
  4. ∫ = F(3) − F(0) = 9 − 0 = 9
  5. Gauss–Kronrod: ∫ ≈ 9 (± 0)

Integration is the reverse of differentiation and the tool for areas, accumulated quantities and averages. This integral calculator does both jobs at once: it looks for an antiderivative F(x)+CF(x) + C in closed form, and it computes the definite integral ∫abf(x) dx\int_a^b f(x)\,dx numerically to about 10 significant digits — even when the bounds are infinite or the integrand blows up at an endpoint.

The symbolic part handles polynomials, powers xnx^n (including 1/x1/x, which gives ln⁡∣x∣\ln|x|), exponentials ekxe^{kx} and axa^x, sine, cosine, tangent, sec⁡2\sec^2, hyperbolic functions, ln⁡x\ln x, ∣x∣|x|, 1/(1+x2)1/(1+x^2), 1/1−x21/\sqrt{1-x^2}, sums and constant multiples, any of these with a linear inside ax+bax + b, and simple uu-substitutions such as xex2x e^{x^2} or 2x/(x2+1)2x/(x^2+1). Every antiderivative it returns is checked by differentiating it back.

When no closed form is found — e−x2e^{-x^2} or xsin⁡xx\sin x, for instance — the calculator says so and still gives the definite value. If that value is a recognisable constant such as 1/31/3, π/2\pi/2 or π\sqrt{\pi}, it is shown next to the decimal.

How to use this calculator

  1. Type the integrand in Function f(x), e.g. x^2, sin(3x), e^(-x^2) or 1/(1+x^2).
  2. For a definite integral, enter the lower bound a and upper bound b. You can use constants (pi/2) and inf or -inf for improper integrals.
  3. Leave both bounds empty if you only want the indefinite integral ∫f(x) dx\int f(x)\,dx.
  4. Read the result: the definite value (with an exact form when one is recognised), the antiderivative with its constant CC, and the estimated numerical error.
  5. Open the steps to see the antiderivative, the evaluation F(b)−F(a)F(b) - F(a) and the numerical check.

The formula

If F′=fF' = f on [a,b][a, b] and ff is continuous there, the fundamental theorem of calculus gives

∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a)

The calculator uses this whenever its antiderivative agrees with the numerical value. Basic antiderivatives:

f(x)f(x) ∫f(x) dx\int f(x)\,dx
xnx^n, n≠−1n \neq -1 xn+1n+1+C\frac{x^{n+1}}{n+1} + C
1/x1/x ln⁡∣x∣+C\ln|x| + C
ekxe^{kx} ekxk+C\frac{e^{kx}}{k} + C
sin⁡(kx)\sin(kx) −cos⁡(kx)k+C-\frac{\cos(kx)}{k} + C
tan⁡x\tan x −ln⁡∣cos⁡x∣+C-\ln|\cos x| + C
1/(1+x2)1/(1+x^2) arctan⁡x+C\arctan x + C

Numerically, the integral is computed by adaptive Gauss–Kronrod quadrature: 15-point Kronrod and 7-point Gauss rules are compared on each subinterval, and the interval with the largest disagreement is split until the total error estimate is tiny. Infinite bounds are first mapped to a finite interval, e.g. x=a+t/(1−t)x = a + t/(1-t) for [a,∞)[a, \infty).

Worked example

Polynomial. For ∫03x2 dx\int_0^3 x^2\,dx the antiderivative is x3/3x^3/3, so the integral is F(3)−F(0)=9−0=9F(3) - F(0) = 9 - 0 = 9 — the calculator's default example.

Trigonometric. ∫0πsin⁡x dx=[−cos⁡x]0π=1−(−1)=2\int_0^{\pi} \sin x\,dx = [-\cos x]_0^{\pi} = 1 - (-1) = 2.

Improper, no closed form. ∫−∞∞e−x2 dx\int_{-\infty}^{\infty} e^{-x^2}\,dx has no elementary antiderivative, but the calculator returns π≈1.7724538509\sqrt{\pi} \approx 1.7724538509, the Gaussian integral.

Divergent. ∫011x dx\int_0^1 \frac{1}{x}\,dx is infinite: the area near x=0x = 0 grows like −ln⁡x-\ln x. The calculator reports Diverges instead of a meaningless number.

Improper integrals and divergence

An integral is improper when a bound is infinite or the integrand becomes infinite inside [a,b][a, b]. It converges when the area stays finite: ∫1∞x−2 dx=1\int_1^{\infty} x^{-2}\,dx = 1 and ∫01x−1/2 dx=2\int_0^1 x^{-1/2}\,dx = 2 converge, while ∫1∞x−1 dx\int_1^{\infty} x^{-1}\,dx diverges.

Watch out for poles inside the interval. ∫−11x−2 dx\int_{-1}^{1} x^{-2}\,dx looks like F(1)−F(−1)=−2F(1) - F(-1) = -2 with F=−1/xF = -1/x, which is absurd for a positive function. The fundamental theorem does not apply because ff is not continuous at 0; the calculator detects the singularity and reports that the integral diverges.

Areas and volumes

For f≥0f \ge 0 the definite integral is the area under the curve. The area between two curves is ∫ab(f−g) dx\int_a^b (f - g)\,dx. Rotating y=f(x)y = f(x) around the xx-axis gives a solid of volume V=π∫abf(x)2 dxV = \pi \int_a^b f(x)^2\,dx: for f(x)=xf(x) = x on [0,2][0, 2], enter pi*x^2 to get 8π/3≈8.37758040968\pi/3 \approx 8.3775804096. To go the other way, from a function to its rate of change, use the derivative calculator.

Frequently asked questions

Why does the antiderivative include + C?

Any constant has derivative zero, so if F is an antiderivative of f, so is F + C for every constant C. The definite integral does not depend on C because it cancels in F(b) − F(a).

Why does it say "No closed form found"?

Some functions, like e^(−x²) or sin(x)/x, have no elementary antiderivative; others, like x·sin(x), need integration by parts or partial fractions, which this tool does not perform. The definite integral is still computed numerically.

How accurate is the definite integral?

Smooth integrands are typically accurate to 10 or more significant digits; the estimated error is shown. Singular or slowly decaying integrands are less accurate, and the error estimate tells you so.

How do I enter infinity as a bound?

Type inf for +∞ and -inf for −∞. The calculator maps the infinite interval to a finite one with a change of variable before integrating.

Are trigonometric functions in radians?

Yes. Calculus formulas such as ∫cos x dx = sin x + C assume radians; convert degrees with pi/180.

Sources

Last updated:

More Math calculators

People also use