Definite Integral Calculator - Value, Area, Simpson's Rule

    What is the definite integral of your function from a to b? Get the value, up to 10 significant digits, with an error estimate, the area to the x-axis, the average value and a Simpson's rule check.

    Parameters

    Enter data for calculations

    A formula in the variable x

    A number or an expression without x

    End of the interval

    Form progress0 / 3 fields

    💡 Fill in all required fields to unlock the calculate button

    A definite integral, the area under the curve and the average value

    The integral of x² from 0 to 1 is exactly 1/3. This calculator returns 0.3333333333 and adds that the number matches 1/3, so you can see both the decimal and the fraction. All it needs is a function and two limits. Next to the integral you get the area between the graph and the x-axis (a different number whenever the curve dips below the axis), the average value of the function on the interval, and a small table with the midpoint, trapezoidal and Simpson's rules for 10 subintervals, the three rules taught for approximating an integral by hand.

    Quick start. Function: sin(x), lower limit: 0, upper limit: pi. The result is 2, the average value 0.6366197724 (that is 2/π). Limits can be expressions too: pi/2, 2pi, e, sqrt(2).

    Evaluating an integral in four moves

    1. Function f(x) - a formula in one variable x, for example 3x^2 + 2, x e^x or 1/(1+x^2). Use ^ for powers; the multiplication sign can be left out (2x, 3sin(x)). Available: sin, cos, tan, cot, ln, log, exp, sqrt, abs, arcsin, arccos, arctan, arccot, and the constants pi and e.
    2. Lower limit a - a number or an expression without x, such as 0, -1.5 or pi/6.
    3. Upper limit b - the other end of the interval. It may be smaller than a; the integral then changes sign.
    4. Read the results - the value with its estimated error in the dark tile, then the area, the average value, the points where the function changes sign, and the table of approximation rules.

    Eight integrals from class and from physics

    Each case below was typed into the calculator; the numbers are its output, rounded only where the text says so.

    Area under a parabola. f(x) = x^2, a = 0, b = 1.
    Result: 0.3333333333, matched to 1/3. Simpson's rule with n = 10 lands exactly on it, the trapezoidal rule gives 0.335 and the midpoint rule 0.3325. Simpson's rule is exact for every polynomial of degree three or less, which is why its difference column shows 0.
    Net zero, area four. f(x) = sin x from 0 to 2pi.
    Result: integral 0, area 4, sign change at x ≈ 3.141592654. The half below the axis cancels the half above it. A question about the area of the region is a different question from the value of the integral.
    Distance from velocity. A velocity of v(t) = 3t² + 2 feet per second for 4 seconds. Type 3x^2 + 2 with limits 0 and 4.
    Result: 72 feet traveled, average velocity 18 ft/s. The variable in the calculator is always called x, even when the problem uses t.
    Displacement versus total distance. A ball thrown straight up at 60 ft/s has velocity v(t) = 60 - 32t (gravity taken as 32 ft/s²). Type 60 - 32x from 0 to 2.5.
    Result: integral 50, area 62.5, sign change at x ≈ 1.875. The ball ends 50 feet above the start (displacement) but covers 62.5 feet in total, because it climbs until t = 1.875 s and then falls back. Physics problems that say "distance traveled" want the area; "displacement" wants the integral.
    Work done by a spring. A spring with constant k = 12 pounds per foot pulls back with F(x) = 12x. Stretching it from 0 to 1.5 feet: type 12x, limits 0 and 1.5.
    Result: 13.5 foot-pounds of work, matched to 27/2, average force 9 pounds.
    An integral with no elementary antiderivative. f(x) = e^(-x^2) from -3 to 3.
    Result: 1.772414697, just under √π ≈ 1.772453851, the integral over the whole real line. The textbook route through an antiderivative does not work here; only a numerical method gets a value.
    Unbounded function, finite integral. f(x) = 1/sqrt(x) from 0 to 1.
    Result: 2. The trapezoidal and Simpson's rules show "not possible", because they need a value at x = 0. The calculator refines the partition toward zero until the value settles. The same input with 1/x^2 ends with "The integral diverges" and the trouble spot x ≈ 0.
    Limits in reverse order. f(x) = x from 2 to 0.
    Result: -2, area 2. Swapping the limits flips the sign of the integral; the area stays positive.

    Ten integrals you can check by hand with an antiderivative

    The Fundamental Theorem of Calculus says the integral from a to b equals F(b) - F(a), where F is any antiderivative of f. The table lists ten common cases; the last column is the calculator's output, which agrees with the antiderivative in every row.

    f(x) Interval Antiderivative F(x) Integral
    x²[0, 1]x³/31/3
    3x² - 2x + 1[1, 4]x³ - x² + x51
    sin x[0, π]-cos x2
    cos x[π/6, π/2]sin x1/2
    eˣ[0, 1]eˣe - 1 ≈ 1.718281828
    1/x[1, e]ln x1
    1/(1 + x²)[0, 1]arctan xπ/4 ≈ 0.7853981634
    x·eˣ[0, 1](x - 1)·eˣ1
    √x[0, 4](2/3)·x3/216/3 ≈ 5.333333333
    sin² x[0, π]x/2 - sin(2x)/4π/2 ≈ 1.570796327

    Midpoint, trapezoid and Simpson against the exact value

    The table under every result shows how far the classroom rules miss with 10 equal subintervals. For the integral of sin x from 0 to π (exactly 2) the calculator prints:

    Rule (n = 10) Value Difference from 2
    Midpoint rule2.0082484080.008248
    Trapezoidal rule1.983523538-0.016476
    Simpson's rule2.0001095170.000110

    The trapezoidal error comes out about twice the midpoint error and with the opposite sign, while Simpson's rule is two orders of magnitude closer. The value in the dark tile comes from none of these three. It is computed by adaptive Gauss-Kronrod quadrature with 7 and 15 nodes, which keeps splitting the interval where the estimated error is largest and stops once that error falls below roughly 10-12 of the integral, or of the area when positive and negative parts cancel out.

    Before you trust a definite integral

    Does the calculator show the antiderivative?
    No. It evaluates the definite integral numerically and shows it to at most 10 significant digits with an estimated error; when the error estimate supports fewer digits (for example after heavy cancellation), it shows fewer and says so. When the value matches a simple fraction, a multiple of π or of ln 2, it says so (for example "matches π/4"). The table above covers the most common antiderivatives, and you can check any antiderivative by differentiating it.
    Why is the integral different from the area under the curve?
    The integral counts the parts below the x-axis as negative; the area counts them as positive. For sin x from 0 to 2π the integral is 0 and the area is 4. When a problem asks for the area of a region, use the tile "Area between the graph and the x-axis".
    How do I type a square root, a power or the number e?
    Square root: sqrt(x) or √x. Power: x^3; e to a power: e^x or exp(x). The square of sine can be written sin^2(x). Watch two forms: 1/2x is read as (1/2)·x, and e^2x as e²·x (with a warning), so e to the power 2x needs parentheses: e^(2x). Scientific notation such as 1e3 is not read; type 1000 or 10^3, without a thousands comma. The box "Function as read" shows how the formula was understood.
    Is log the natural logarithm?
    No. Here log is the base-10 logarithm and ln the natural one. The integral of ln x from 1 to e is 1; of log x on the same interval about 0.4342944819.
    Can it do improper integrals?
    Those with a singularity at an end or inside the interval, yes: 1/√x from 0 to 1 gives 2, and 1/√(1 - x²) from 0 to 1 gives π/2 ≈ 1.570796327. The piece next to the singularity is estimated from how fast the integrals over narrower and narrower strips shrink, and the result says so next to the error. Infinite limits are not possible: both limits must lie between -1,000,000 and 1,000,000. For a fast-decaying function a large limit is enough, for example e^(-x) from 0 to 1000000 gives 1. A narrow spike far from both ends and from zero can still be missed, so for such functions a moderate limit is safer.
    Radians or degrees?
    Radians, as everywhere in calculus. The limit "pi" is 3.141592654, that is 180°. Convert degree limits first: 30° = pi/6, 90° = pi/2.
    What is the average value of a function good for?
    It is the integral divided by the length of the interval, (1/(b - a))·∫f(x)dx. For velocity it is the average velocity (72 feet in 4 seconds is 18 ft/s), for instantaneous power the average power. A rectangle with that height and width b - a has the same area as the integral.

    Related tools

    System of Equations Calculator

    Two or three linear equations solved step by step, with exact fractions and a check - See the calculator

    Derivative Calculator

    Derivative step by step with named rules, second derivative and tangent line - See the calculator

    Laplace Transform Calculator

    F(s) for common functions, an integral from 0 to infinity in table form - See the calculator

    Series Convergence Calculator

    Whether a geometric, p-series or alternating series converges, and its sum - See the calculator

    Quadratic Function Calculator

    Zeros, vertex and axis of a parabola, handy before integrating one - See the calculator

    Area Calculator

    Areas of triangles, trapezoids, circles and other basic shapes - See the calculator

    Average Calculator

    Arithmetic, weighted, geometric and harmonic means of a list of numbers - See the calculator

    Logarithm Calculator

    ln, log base 10 and any other base, the functions behind many integrals - See the calculator

    Similar calculators from this section