Integral Sum Calculator

Definite integrals by Simpson's rule or Gauss–Legendre, with an antiderivative check.

  1. Enter valuesUse your own inputs or an example
  2. CalculateApply your selected settings
  3. View resultExplore the answer and explanation

Enter the integral

Enter your values below to get started.

Examples:
f(x) =
Use x as the variable: x*e^x, sin(x)/x, 1/(1+x^2), sqrt(1-x^2).
Method
Ignored by Adaptive. Simpson needs an even n.
The calculator compares F(b) − F(a) with the numerical integral.
Reset restores the default values.

Tips for this calculator

Leave the method on Adaptive for 10+ correct digits on smooth functions.

If f is undefined at a or b (like 1/√x at 0), Adaptive switches to tanh-sinh quadrature.

Enter b < a to get the negative of ∫ from b to a.

Clear the F(x) box if you do not want an antiderivative check.

An integral sum calculator evaluates a definite integral ∫ab f(x) dx as a weighted sum of function values, to 10 or more correct digits. Choose adaptive Simpson, Simpson's rule, 5-point Gauss–Legendre or the trapezoidal rule, get an error estimate and the average value of f, and type an antiderivative F(x) to check F(b) − F(a) against the numerical result.

What is an Integral Sum?

An integral sum is a weighted sum of function values, w1f(x1) + ⋯ + wNf(xN), that approximates the definite integral ∫ab f(x) dx, the signed area between f and the x-axis. Riemann sums, the trapezoidal rule, Simpson's rule and Gauss–Legendre quadrature are all integral sums; they differ in where the nodes xk sit and how large the weights wk are.

∫abf(x) dx≈∑k=1Nwk f(xk)\int_a^b f(x)\,dx \approx \sum_{k=1}^{N} w_k\, f(x_k)

Area above the axis counts as positive and area below as negative. For x³ − 4x + 1 on [−2, 3], the integral is 11.25, the net of the parts above and below the axis.

InteractiveSigned area: move a and b

How Does the Integral Sum Calculator Work?

The integral sum calculator evaluates f at a set of nodes, multiplies each value by its weight and adds the products; the adaptive method keeps splitting the interval until 2 estimates on every piece agree to about 10−10. The calculator then reports an error estimate, the number of function evaluations and the average value of f.

InteractiveWhere each rule puts its nodes, and how much each weighs
  1. Read f, a and b

    If b < a, the calculator integrates from b to a and flips the sign.

  2. Choose nodes and weights

    Simpson uses 1, 4, 2, …, 4, 1; Gauss–Legendre uses 5 nodes per panel at roots of P5.

  3. Estimate the error

    Each method is compared with a finer version of itself (Richardson extrapolation).

  4. Check F(x)

    If you type an antiderivative, F(b) − F(a) is compared with the numerical value.

Integral Sum Formula and the Fundamental Theorem of Calculus

The exact value of an integral sum's target is F(b) − F(a), where F is any antiderivative of f (F′ = f), by the Fundamental Theorem of Calculus. Isaac Newton and Gottfried Wilhelm Leibniz established the theorem independently in the 1660s–1680s.

∫abf(x) dx=F(b)−F(a)=lim⁡n→∞∑i=1nf(xi∗) Δx\int_a^b f(x)\,dx = F(b) - F(a) = \lim_{n\to\infty} \sum_{i=1}^{n} f(x_i^{*})\,\Delta x

For f(x) = x² on [0, 3], F(x) = x³/3 gives 27/3 − 0 = 9. Many integrands have no elementary antiderivative, for example e−x² and sin(x)/x, so a numerical integral sum is the only practical route: ∫01 e−x² dx ≈ 0.746824132812.

InteractiveF(b) − F(a) equals the area under f

Types of Integral Sum Methods

There are 4 integral sum methods in this calculator: adaptive Simpson, composite Simpson's rule, Gauss–Legendre quadrature and the trapezoidal rule. Their errors shrink at very different rates as you add function evaluations.

InteractiveError vs. function evaluations for 3 methods

Adaptive Simpson

Splits only where f bends sharply. Default; reaches about 10 correct digits on smooth functions.

Simpson's Rule

Thomas Simpson (1743). Fits parabolas through 3 points; error ∝ 1/n⁴; needs an even n.

Gauss–Legendre Quadrature

Carl Friedrich Gauss (1814). 5 nodes per panel integrate polynomials up to degree 9 exactly.

Trapezoidal Rule

Straight chords between nodes; error ∝ 1/n². Simple, and very accurate on periodic functions over a full period.

Tanh-Sinh Quadrature

Hidetosi Takahasi and Masatake Mori (1974). Used automatically when f is undefined at an endpoint.

Simpson's Rule for an Integral Sum

Simpson's rule replaces f on each pair of subintervals with the parabola through 3 points and integrates the parabolas exactly, which gives the weights 1, 4, 2, 4, …, 2, 4, 1 times Δx/3.

Sn=Δx3[f(x0)+4f(x1)+2f(x2)+⋯+4f(xn−1)+f(xn)]S_n = \frac{\Delta x}{3}\left[f(x_0) + 4f(x_1) + 2f(x_2) + \cdots + 4f(x_{n-1}) + f(x_n)\right]

n must be even. Simpson's rule is exact for every polynomial up to degree 3. S2 for x² on [0, 2] is exactly 8/3, while S2 for eˣ on [0, 2] is 6.4207 against the exact 6.3891. The error bound is (b − a)⁵K4 / 180n⁴, with K4 = max |f⁽⁴⁾|.

InteractiveParabolas through 3 points: Simpson's rule

How to Calculate an Integral Sum by Hand

To calculate an integral sum by hand, take 5 steps: pick a rule and n, find Δx, list the nodes, apply the rule's weights to f at each node, and add. Here is Simpson's rule with n = 4 on ∫0π sin x dx.

  1. Δx = π/4 ≈ 0.7854.
  2. Nodes: 0, π/4, π/2, 3π/4, π.
  3. Values: 0, 0.7071, 1, 0.7071, 0.
  4. Weighted sum: 0 + 4(0.7071) + 2(1) + 4(0.7071) + 0 = 7.6569.
  5. S4 = (0.7854 / 3) × 7.6569 ≈ 2.0046 (exact 2).
InteractiveStep through an integral sum by hand

    Properties of Definite Integrals

    Definite integrals follow 5 rules that every integral sum respects: additivity over intervals, linearity, reversing the limits, zero width, and comparison.

    • Additivity: ∫ac f + ∫cb f = ∫ab f for any c.
    • Linearity: ∫ (αf + βg) = α∫ f + β∫ g.
    • Reversed limits: ∫ba f = −∫ab f; ∫30 x² dx = −9.
    • Zero width: ∫aa f = 0.
    • Comparison: if f ≤ g on [a, b], then ∫ f ≤ ∫ g.
    InteractiveAdditivity: split the interval at c

    Common Mistakes with Integral Sums

    • Treating the integral as total area: parts below the axis subtract; use the area sum calculator for total area.
    • Odd n in Simpson's rule: the parabolas need pairs of subintervals.
    • Forgetting the + C cancels: any antiderivative works, since the constant drops out of F(b) − F(a).
    • Integrating through a vertical asymptote: 1/x on [−1, 1] has no finite integral, even though a numerical sum returns a number.
    • Degrees instead of radians: sin and cos take radians.
    InteractiveTrue or false: integral sums
    1. Simpson's rule is exact for f(x) = x³.

    2. ∫ from 3 to 0 of x² dx equals 9.

    3. 5-point Gauss–Legendre evaluates f at both endpoints.

    4. e^(−x²) has no elementary antiderivative.

    5. A definite integral can be negative.

    Score: 0 / 5

    How to Use the Integral Sum Calculator

    Type the integrand, the limits and, if you have one, an antiderivative; keep the method on Adaptive or pick a rule and n; then press Calculate. The result card shows the value, the error estimate, the number of evaluations, the average value and the antiderivative check; the tabs show the steps, the shaded area and a comparison of all 4 methods.

    InteractiveLoad a ready-made integral

    Each button fills the calculator and runs it.

    1. Enter f(x)

      For example x*e^x or sin(x)/x.

    2. Set a and b

      Any order; pi, e and fractions work.

    3. Pick a method

      Adaptive for accuracy, or Simpson, Gauss–Legendre or trapezoidal with your own n.

    4. Check F(x)

      Type a candidate antiderivative to verify homework answers.

    Real-Life Applications of Integral Sums

    Integral sums compute totals whenever a quantity is a rate or a density that changes along a line. 5 common uses:

    • Work: W = ∫ F(x) dx turns a variable force in newtons (N) into work in joules (J) or foot-pounds (ft·lbf).
    • Probability: the normal distribution has no closed-form cumulative integral, so statistics tables come from numerical integral sums.
    • Engineering: finite element software uses Gauss–Legendre quadrature inside every element.
    • Physics: the arc length of a pendulum's swing and the period of a large-angle pendulum need numerical integrals.
    • Economics: consumer surplus is the integral of the demand curve above the price.
    InteractiveWork done stretching a stiffening spring

    Integral Sum Examples

    Definite integrals with their numerical values and exact forms.

    Integral Sum Examples
    IntegralValueExact formCalculator
    ∫03x2 dx\int_0^3 x^2\,dx927/3
    ∫01e−x2 dx\int_0^1 e^{-x^2}\,dx0.746824132812(√π / 2) erf(1)
    ∫01xex dx\int_0^1 x e^x\,dx1[(x − 1)eˣ]₀¹
    ∫−111−x2 dx\int_{-1}^1 \sqrt{1-x^2}\,dx1.57079632679π/2
    ∫12sin⁡xx dx\int_1^2 \frac{\sin x}{x}\,dx0.659329906436Si(2) − Si(1)
    ∫01dxx\int_0^1 \frac{dx}{\sqrt{x}}2[2√x]₀¹
    ∫−23(x3−4x+1) dx\int_{-2}^3 (x^3 - 4x + 1)\,dx11.2545/4

    Popular Integral Sum Problems

    Evaluate each integral, then reveal the answer or check it in the calculator.

    1. Evaluate ∫₀³ x² dx and check it with F(x) = x³/3.

      \int_0^3 x^2\,dx
      Show answer9
    2. Evaluate ∫₀¹ x·eˣ dx.

      \int_0^1 x e^x\,dx
      Show answer1
    3. Simpson's rule with n = 4 for ∫₀^π sin x dx.

      S_4,\ \int_0^\pi \sin x\,dx
      Show answerS_4 \approx 2.0046
    4. Evaluate ∫₁² ln x dx.

      \int_1^2 \ln x\,dx
      Show answer2\ln 2 - 1 \approx 0.386294
    5. Evaluate ∫₋₁¹ √(1 − x²) dx, the area of a half unit disk.

      \int_{-1}^{1} \sqrt{1-x^2}\,dx
      Show answer\pi/2 \approx 1.570796
    6. Evaluate ∫₀¹ 1/(1 + x²) dx and multiply by 4.

      4\int_0^1 \frac{dx}{1+x^2}
      Show answer\pi \approx 3.141593

    Explore More Sum Calculators

    Discover 67 free sum calculators across different categories. Find the right calculator for your needs.

    Browse All 67 Calculators
    Questions and answers

    Frequently Asked Questions

    What is an integral sum calculator?

    An integral sum calculator is an online tool that evaluates a definite integral numerically as a weighted sum of function values. It offers adaptive Simpson, Simpson's rule, Gauss–Legendre and trapezoidal methods with an error estimate and an antiderivative check.

    How accurate is the integral sum calculator?

    On smooth functions the adaptive method reaches about 10 to 12 correct digits. The result card shows an error estimate for every method.

    Can the calculator find the antiderivative?

    No, the calculator computes the definite integral numerically. Type a candidate antiderivative F(x) and the calculator checks whether F(b) − F(a) matches.

    What is the difference between Simpson's rule and Gauss–Legendre?

    Simpson's rule uses equally spaced nodes with weights 1, 4, 2, …, 4, 1. Gauss–Legendre picks unequally spaced nodes at roots of a Legendre polynomial, so 5 nodes per panel integrate polynomials up to degree 9 exactly.

    Can a definite integral be negative?

    Yes, area below the x-axis counts as negative, and reversing the limits flips the sign. ∫ from 3 to 0 of x² dx = −9.

    Can I integrate a function that is undefined at an endpoint?

    Yes, when f is undefined at a or b, the adaptive method switches to tanh-sinh quadrature. ∫₀¹ 1/√x dx returns 2. Divergent integrals such as ∫₀¹ 1/x dx are reported as divergent.

    What is the average value of a function?

    The average value of f on [a, b] is the integral divided by b − a. For x² on [0, 3], the average is 9 / 3 = 3.

    Why is the result an approximation?

    A numerical integral sum uses finitely many function values, so it carries a small error. The adaptive method keeps that error near 10⁻¹⁰ for smooth integrands.

    Conclusion

    An integral sum evaluates ∫ab f(x) dx as a weighted sum of function values, and the integral sum calculator does it with adaptive Simpson, Simpson's, Gauss–Legendre or trapezoidal rules, plus an error estimate and an antiderivative check. Use the adaptive method for accuracy, Simpson's or the trapezoidal rule to match homework by hand, and F(b) − F(a) to confirm an antiderivative.

    Not sure which method to pick? Answer the questions below.

    InteractiveWhich integral sum method should you use?