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
- 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.
- 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.
- Read the integral, its estimated error, the Simpson's rule comparison and the average value.
- 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?
- Distance is speed added up over time, so we integrate the velocity: ∫ from 1 to 3 of (3t² + 2t) dt.
- By hand, an antiderivative is t³ + t², so the integral is (27 + 9) − (1 + 1) = 34.
- The calculator's Gauss–Kronrod estimate is 34 with an estimated error below 1e-15, and Simpson's rule also gives 34.
- 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: