Definite Integral Calculator β€” Area Under a Curve

DIRECT ANSWER: this tool computes the definite integral of f(x) between two limits using numeric integration (Simpson's rule). It returns a numeric value for the given bounds β€” the signed area under the curve β€” not a symbolic antiderivative.

Calculate a definite integral

Use x as the variable. Supports + - * / ^ and sin, cos, tan, sqrt, exp, log (natural), pi.

How this calculator works

This is a numeric definite integral calculator. You give it a function f(x) and two limits, a (lower) and b (upper), and it computes the value of:

ab f(x) dx

That value is the signed area between the curve y = f(x) and the x-axis, from x = a to x = b. Area below the axis counts as negative.

Under the hood it uses Simpson's rule, a standard numerical-integration method. The interval [a, b] is split into n = 1000 equal strips of width h = (b − a)/n, and each pair of strips is approximated by a parabola:

∫ f(x) dx ≈ (h/3) × [ f(a) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 4f(xn-1) + f(b) ]

With 1000 strips this is highly accurate for smooth functions. Because the method evaluates f(x) at many points, it does not produce a formula β€” it produces a single number for the bounds you enter.

Definite vs. indefinite integrals

Integration rules

For reference, here are common antiderivatives. The definite integral over [a, b] is found by evaluating the antiderivative F at the limits: ∫ab f(x) dx = F(b) − F(a).

Function f(x)Antiderivative F(x)
xn (n ≠ −1)xn+1 / (n + 1) + C (power rule)
1 / xln|x| + C
exex + C
cos xsin x + C
sin x−cos x + C
sec2 xtan x + C
k (constant)kx + C

Worked examples

Example 1 β€” power rule.02 x² dx. Using the power rule, F(x) = x³/3, so the answer is 2³/3 − 0³/3 = 8/3 ≈ 2.6667. The calculator returns the same value numerically.

Example 2 β€” trig.0π sin(x) dx = [−cos x]0π = −cos(π) + cos(0) = 1 + 1 = 2. Enter sin(x) with a = 0 and b = pi.

Example 3 β€” exponential.01 ex dx = e¹ − e⁰ = e − 1 ≈ 1.71828. Enter exp(x) with a = 0 and b = 1.

Frequently asked questions

Does this calculator give the antiderivative or a symbolic answer?

No. This is a numeric definite integral calculator. It returns a single number β€” the value of the integral between your two limits β€” using Simpson's rule. It does not return a symbolic antiderivative or a formula with "+ C". If you need the symbolic indefinite integral, solve it by hand using the integration rules above or use a computer-algebra system.

How accurate is the result?

Very accurate for smooth, well-behaved functions. Simpson's rule with 1000 strips typically matches the exact value to around 6 significant figures. Accuracy can drop for functions with sharp spikes, discontinuities, or vertical asymptotes inside the interval.

Why did I get "function undefined on this interval"?

That message appears when f(x) returns an undefined or infinite value at one of the sample points β€” for example dividing by zero, taking log of a non-positive number, or sqrt of a negative number somewhere between a and b. Check that your function is defined across the whole interval.

What does a negative answer mean?

The definite integral is a signed area. Where the curve is below the x-axis, that region contributes a negative amount. So the result can be negative or zero even when there is visible area, if positive and negative regions cancel.

Can I swap the limits (a greater than b)?

Yes. If the lower limit a is greater than the upper limit b, the calculator follows the standard convention ∫ab = −∫ba and negates the result automatically.

Related Calculators

Last reviewed: June 2026