Definite Integral Calculator

Calculate definite integrals for any function with step-by-step solutions. Visualize area under curves and understand fundamental calculus concepts.

Use ^ for exponents, * for multiplication, log() = natural log, exp() = e^, sqrt(). Standard trig functions.
Important: If your function has vertical asymptotes or singularities inside the integration interval (e.g., 1/x from -1 to 1), the integral may diverge. Always check continuity over [a,b].
Examples:
∫₀² x² dx
∫₀^π sin(x) dx
∫₀^π/2 cos(x) dx
∫₀¹ eˣ dx
∫₁² 1/x dx
∫₋₁¹ √(1-x²) dx
∫₋₁¹ e⁻ˣ² dx (numeric)
Local & Private — All computations run in your browser (nerdamer CAS + numeric fallback). No data leaves your device.

What is a Definite Integral?

The definite integral ∫ₐᵇ f(x) dx represents the signed area between the curve y = f(x) and the x‑axis, from x = a to x = b. It is defined as the limit of Riemann sums and is computed via the Fundamental Theorem of Calculus: if F'(x) = f(x), then ∫ₐᵇ f(x) dx = F(b) − F(a).

\[ \int_{a}^{b} f(x)\,dx = \lim_{n\to\infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x = F(b)-F(a) \]

This calculator gives you both the exact symbolic value (when an elementary antiderivative exists) and a high‑precision numeric approximation. The graph highlights the region whose area is being computed.

Features & Methods

  • Symbolic integration – using nerdamer CAS to find an exact antiderivative and evaluate F(b)−F(a).
  • Numerical fallback – adaptive Simpson's rule (error tolerance ~1e-12) for integrals without closed form, like e⁻ˣ² or sin(x²).
  • Interactive area plot – automatically scales to show the function and shaded integral region.
  • Swap limits – quick button to swap a and b, applying ∫ₐᵇ = −∫ᵇₐ.

Common Definite Integrals

f(x) ∫ₐᵇ f(x) dx Example (a,b)
xⁿ (n≠-1) (bⁿ⁺¹−aⁿ⁺¹)/(n+1) ∫₀¹ x² = 1/3
1/x ln|b/a| ∫₁² 1/x = ln2
eᵇ − eᵃ ∫₀¹ eˣ = e − 1
sin(x) cos(a) − cos(b) ∫₀^π sin(x) = 2
cos(x) sin(b) − sin(a) ∫₀^π/2 cos(x) = 1
1/(1+x²) arctan(b)−arctan(a) ∫₀¹ 1/(1+x²) = π/4

Step-by-Step Example

∫₀² 3x² dx

  1. Enter 3*x^2, lower limit 0, upper limit 2.
  2. Symbolic antiderivative: F(x) = x³.
  3. Evaluate: F(2)−F(0) = 8 − 0 = 8.
  4. Graph shows shaded area under 3x² from 0 to 2.

Numerical Integration (Fallback)

Some functions like e⁻ˣ² (Gaussian), sin(x²), or sin(x)/x have no elementary antiderivative. In such cases the calculator uses an adaptive Simpson method, accurate to about 1e-12 relative error. You will see a note that the result is numerical.

If f(x) is negative, the integral contributes negative area. The definite integral gives the net area (area above x‑axis minus area below). The graph shades the region accordingly.

It means the function does not have an antiderivative composed of basic functions; the result is computed numerically with high accuracy.

This tool currently supports finite limits only. For improper integrals, try a large bound as an approximation.

An algorithm that recursively refines intervals to achieve a desired accuracy, providing very precise numeric integrals without requiring a symbolic antiderivative.

Numerical Integration – How It Works

When no elementary antiderivative exists, the calculator uses an adaptive Simpson's rule. This method recursively subdivides the interval until the estimated error falls below 1e-12. The algorithm is based on Simpson's 1/3 rule:

∫ₐᵇ f(x) dx ≈ (b−a)/6 · [f(a) + 4f((a+b)/2) + f(b)]

Adaptive refinement ensures high accuracy for smooth functions like e⁻ˣ², sin(x²), or sin(x)/x. Maximum recursion depth is 20, guaranteeing termination even for oscillatory integrands.

Reference: Press et al., Numerical Recipes (3rd ed.), Cambridge University Press.

Academic validation: Symbolic engine validated against standard tables (Gradshteyn–Ryzhik). Numerical methods follow Press et al. "Numerical Recipes". Ideal for AP Calculus, college-level integration.

? References: Definite Integral (MathWorld) | Integral – Wikipedia | OpenStax Calculus