Skip to content
Calcapedia
Math

Definite Integral Calculator

Find the area under a curve between two x-values. Uses adaptive Gauss–Kronrod quadrature, gives an error estimate and checks the answer with Simpson's rule.

Level: Grade 12 to college

Printable worksheet

Definite Integral Calculator

Inputs

Use x as the variable, ^ for powers and * or a space for multiplication. Functions: sin, cos, tan, ln, log, sqrt, exp, abs and more; constants pi and e. Angles are in radians.

Result

Definite integral (approximate)

34

The integral of 3 × x^2 + 2 × x from 1 to 3 is approximately 34.

Estimated error (±)
below 1e-15From the difference between the 15-point and 7-point rules
Average value of f on the interval
17
Simpson's rule (200 strips) for comparison
34
Method
Adaptive 15-point Gauss–Kronrod quadrature
f(x) between the limits
01020304011.41.82.22.63

x

See the step-by-step solution ↓

Values of f(x) across the interval
Values of f(x) across the interval
xf(x)
15
1.26.72
1.48.68
1.610.88
1.813.32
216
2.218.92
2.422.08
2.625.48
2.829.12
333

Step-by-step solution

  1. Read your function the usual way, powers first, then multiplying, then adding (angles in radians)

    f(x) = 3 × x^2 + 2 × x
  2. We want the area between the curve and the x-axis. Area above the axis counts as plus, and area below counts as minus

    ∫ from 1 to 3 of (3 × x^2 + 2 × x) dx
  3. Estimate the area piece by piece (Gauss–Kronrod method). Each piece is checked at 15 points and again at 7, and the gap between them shows the error. The worst piece is cut in half until the error is tiny. That took 1 piece and 15 function values

    estimated error ≈ 0
  4. Check the answer a second way, with Simpson's rule on 200 equal strips

    Simpson ≈ 34
  5. Find the curve's average height: divide the area by the width of the interval

    343−1=17
  6. So the definite integral, a close estimate, is

    ∫ f(x) dx ≈ 34

Test yourself

20 quick questions built from this calculator's formula: work out results, predict what happens when an input changes, and work backward from an answer. Every answer comes with the working.

What this calculator does

Find the area under a curve between two points, and the curve's average height there. A definite integral adds up something that keeps changing, bit by bit. On a graph, it's the area between the curve and the x-axis, from one x-value to another. Area above the axis counts as positive, and area below counts as negative, so we call it a signed area. Adding up speed over time gives distance traveled. Adding up a force over a distance gives work. Divide the integral by the width of the interval, and you get the average value of the function.

Type a formula that uses x, plus the two end points, called limits. The calculator then estimates the integral with a method called adaptive 15-point Gauss–Kronrod quadrature. Scientific software uses the same family of methods. You also get an estimated error and a second answer from Simpson's rule, as an independent check. It shows the average value, a table of sample points and a chart, too. If the formula breaks down somewhere between your limits, or shoots off to infinity, the calculator tells you. That's better than handing you a misleading number.

Where it's used

Why this math matters outside the classroom:

  • Distance traveled. A car with velocity v(t) = 3t² + 2t m/s covers the integral of v from t = 1 to t = 3 s, which is 34 m.
  • Work on a spring. Stretching a spring with k = 200 N/m from 0 to 0.1 m takes the integral of 200x over that range, which is 1 joule of work.
  • Area under a curve. The region under y = √x from 0 to 4 has area (2/3) × 4^(3/2) = 16/3, about 5.33 square units.
  • Probability. With a waiting time spread evenly over 0 to 10 minutes, the chance of waiting 2 to 5 minutes is the integral of 0.1, which is 0.3.
  • Energy use. A device drawing P(t) = 2 + sin(t) kW for 3 hours uses 6 + 1 − cos 3, about 7.99 kWh, by integrating its power.

How to use it

  1. Type the function using x as the variable, for example 3x^2 + 2x, sin(x), e^(−x^2) or 1/(1 + x^2). Angles are in radians.
  2. Enter the lower limit a and the upper limit b. If b is smaller than a, the answer flips sign, because that's how integrals are defined.
  3. Read the integral, its estimated error, the Simpson's rule comparison and the average value.
  4. Open the working to see the method used and how many pieces the interval was cut into.

What the inputs mean

Function f(x)
Write powers with ^, and multiply with * or a space. Put what a function acts on in brackets: sqrt(1 − x^2), ln(x + 1). You can use sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, ln, log, sqrt, cbrt, abs and exp. The constants pi and e work too.
Lower limit a
Limits are ordinary numbers. For π, type 3.14159265358979. Infinite limits aren't supported.

Formula and method

∫ₐᵇ f(x) dx = F(b) − F(a), where F′ = f
∫ₐᵇ f(x) dx = −∫ᵇₐ f(x) dx
Gauss–Kronrod: ∫ f ≈ (b − a)/2 × Σ wᵢ f(cᵢ), at 15 carefully placed points cᵢ
Simpson: ∫ f ≈ h/3 × [f(x₀) + 4f(x₁) + 2f(x₂) + … + 4f(xₙ₋₁) + f(xₙ)]
average value = (1 ÷ (b − a)) × ∫ₐᵇ f(x) dx

In these formulas, f(x) is your function, a is the lower limit and b is the upper limit. The ∫ sign means integral, and dx means we add up along x. F is an antiderivative, a function whose rate of change (F′) is f. The fundamental theorem of calculus says the integral equals F(b) minus F(a). But many functions have no antiderivative you can write with ordinary functions. The classic example is e^(−x²). So this calculator works the integral out numerically, which works for any well-behaved function.

In the Gauss–Kronrod line, Σ means add up, the cᵢ are 15 sample points, and the wᵢ are weights, how much each point counts. The points are chosen so the weighted sum is exact for many smooth curves (every polynomial up to a high degree). The 15-point Kronrod rule includes the 7-point Gauss rule, so comparing the two gives a built-in error estimate. Any piece with too much error is cut in half and estimated again. That way, the effort goes where the function is hardest to handle.

In the Simpson line, h is the width of each equal strip and x₀ to xₙ are the strip edges. Simpson's rule fits small curves (parabolas) through evenly spaced points. Here it's only an independent check. For a smooth function, the two methods should agree to many decimal places.

Worked example

An object moves with velocity v(t) = 3t² + 2t meters per second. How far does it travel between t = 1 and t = 3 seconds?

  1. Distance is speed added up over time, so we integrate the velocity: ∫ from 1 to 3 of (3t² + 2t) dt.
  2. By hand, an antiderivative is t³ + t², so the integral is (27 + 9) − (1 + 1) = 34.
  3. The calculator's Gauss–Kronrod estimate is 34 with an estimated error below 1e-15, and Simpson's rule also gives 34.
  4. Average velocity over the 2 seconds: 34 ÷ (3 − 1) = 17 m/s.

Result: The object travels 34 meters, at an average velocity of 17 meters per second.

Understanding the result

The integral is a signed area, so parts of the curve below the x-axis subtract. If you want the total area no matter the sign, integrate abs(f(x)) instead.

The estimated error is usually far smaller than any rounding you'd do. Sometimes the Simpson's rule figure differs from the main result by more than the last few digits. That usually means the function changes very sharply somewhere. In that case, trust the Gauss–Kronrod value more.

Assumptions and limitations

  • The function has a finite value at every point from a to b, and angles are in radians.
  • The result is a close numerical estimate, not an exact formula answer.
  • It doesn't work out improper integrals. Those have an infinite limit, or a function that blows up inside the interval. Instead, the calculator tells you where the trouble is.
  • Some functions wiggle extremely fast, such as sin(1000x) over a long interval. For full accuracy, you may need to split the interval into smaller parts.
  • It doesn't give you an antiderivative formula. For that, check your answer against a table of integrals or a textbook.

Frequently asked questions

What is the difference between a definite and an indefinite integral?

An indefinite integral is a family of functions: the antiderivative plus any constant. A definite integral has limits and is a single number. It's the total built up, or signed area, between those limits.

Why is my integral negative?

Either more of the curve lies below the x-axis than above it between your limits, or the upper limit is smaller than the lower one. Either one makes the answer negative. For example, the integral of x from −3 to 1 is −4.

Why does the calculator refuse 1/x from 0 to 1?

Because 1/x has no value at 0, and it grows without limit as x gets close to 0. That makes the integral improper. It would have to be found as a limit, and here that limit doesn't exist at all. Move the lower limit to 0.001 to get a finite answer you can study.

How accurate is the result?

For smooth functions, the Gauss–Kronrod estimate is usually right to 12 or more significant digits. Treat the reported error as a rough upper bound. The Simpson's rule comparison gives a second, independent opinion.

How do I find the area between two curves?

Integrate the top curve minus the bottom curve, between the points where they cross. For y = x and y = x² between 0 and 1, integrate x − x^2 to get 1/6, about 0.166667.

How this calculator is checked

Method: Adaptive Gauss–Kronrod (G7–K15) quadrature with the standard QUADPACK nodes and weights, error estimated as |K15 − G7| per subinterval; composite Simpson's rule as a cross-check; tested against known antiderivatives. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.

Embed this calculator

Put this Definite Integral Calculator on your own website or blog for free. Paste this code where you want it to appear: