Definite Integral Calculator
- Free
- No sign-up
- Works on phones
- Shows the working
This definite integral calculator evaluates \( \int_a^b f(x)\,dx \) for any function and any pair of limits. It shows the antiderivative when one exists and gives the exact value where it can recognize it (fractions, \( \pi \), \( e \), roots), along with a decimal.
It doubles as an improper integral calculator: set a limit to inf or -inf, or integrate across a point where the function blows up, and it tells you whether the integral converges and to what. Free, no sign-up.
How to use the definite integral calculator
- Enter the integrand \( f(x) \). Use
^for powers,sqrt(),ln(),sin(), ande^(-x)for exponentials;3xandx^2 e^(-x)work without a*. - Enter the lower limit \( a \) and upper limit \( b \). Numbers, fractions,
pi,pi/2andinfare all accepted. - Press Integrate. You get the antiderivative \( F(x) + C \) (when a closed form exists) and the value of the integral, highlighted.
- If a limit is infinite, a note confirms that the improper integral converges. If it does not converge, you get a clear divergence message instead of a meaningless number.
How it works
For a continuous \( f \) on \( [a, b] \), the Fundamental Theorem of Calculus turns the area problem into a subtraction:
$$\int_a^b f(x)\,dx = F(b) - F(a), \qquad F' = f$$
The calculator computes the value with adaptive Gauss–Kronrod quadrature, which is accurate to many digits even when no antiderivative exists, and separately looks for a symbolic antiderivative to display. An improper integral is defined as a limit,
$$\int_a^{\infty} f(x)\,dx = \lim_{t \to \infty} \int_a^{t} f(x)\,dx,$$
and numerically the infinite interval is mapped onto a finite one before integrating.
Worked examples
Example 1 (improper). Evaluate \( \int_0^{\infty} x^2 e^{-x}\,dx \), the example preloaded above.
Integrating by parts twice gives
$$F(x) = -e^{-x}(x^2 + 2x + 2)$$
As \( x \to \infty \), the exponential wins over the polynomial, so \( F(x) \to 0 \). At the lower limit, \( F(0) = -2 \). Therefore
$$\int_0^{\infty} x^2 e^{-x}\,dx = 0 - (-2) = 2$$
The calculator shows the same antiderivative (written out term by term) and the value 2, with a note that the improper integral converges.
Example 2 (ordinary). Type 3x^2 - 2x + 1 with limits 0 and 2. The antiderivative is \( x^3 - x^2 + x \), and
$$F(2) - F(0) = (8 - 4 + 2) - 0 = 6$$
Convergent or divergent? Reading the result
- A finite value with a note: the improper integral converges. For instance \( \int_0^{\infty} \frac{dx}{1 + x^2} = \frac{\pi}{2} \), and the calculator shows \( \frac{\pi}{2} \approx 1.5707963 \).
- A divergence message: the area is infinite or undefined. \( \int_1^{\infty} \frac{dx}{x} \) is the classic example: its antiderivative \( \ln x \) grows without bound.
- Vertical asymptotes count too. \( \int_0^4 \frac{dx}{\sqrt{x}} \) is improper at 0 but converges to 4; \( \int_0^1 \frac{dx}{x^2} \) diverges.
- No antiderivative row: some functions, like \( e^{-x^2} \), have no elementary antiderivative. You still get the number, for example \( \int_0^1 e^{-x^2}\,dx \approx 0.7468241 \).
A negative answer is not an error. A definite integral is signed area, so parts of the graph below the x-axis subtract. For the total geometric area, integrate \( |f(x)| \) with abs(); for the area between two graphs, the area between curves calculator splits the interval for you. Our guide to improper integrals explains the comparison tests you can use to predict convergence before calculating.
Related guides
- Improper Integrals: How to Tell If They Converge or Diverge
- Fundamental Theorem of Calculus (Parts 1 and 2) Explained
- Integration by Parts: Formula, LIATE Rule and Examples
- Integral of e^(−x²): The Gaussian Integral = √π
Further reading
- Computing Definite Integrals (Paul’s Online Math Notes) — the Fundamental Theorem in action, including piecewise and absolute value integrands.
- Improper Integrals (Paul’s Online Math Notes) — infinite limits and discontinuous integrands, with the \( p \)-integral rule.
FAQ
Can this calculator do improper integrals?
Yes. Use inf or -inf as a limit, or integrate across a vertical asymptote. It returns the value when the integral converges and says so when it diverges.
Does it give exact answers or decimals?
Both, when possible. The value is computed numerically to high precision, and if it matches a recognizable exact form, such as \( \frac{\pi}{2} \) or a fraction, that form is shown alongside the decimal.
Why did I get a negative definite integral?
The graph lies below the x-axis on some or all of the interval, and the integral counts that area as negative. Integrate abs(f(x)) if you want total area.
Do I need to find the antiderivative first?
No. The calculator evaluates the integral directly; the antiderivative is shown only as a bonus when it exists in closed form. If you want the antiderivative worked out step by step, use the integral calculator.
