Area Under the Curve Calculator
The area under a curve is one of the most visual concepts in calculus. When you plot a function and shade the region between its graph and the x-axis over a chosen interval, that shaded area represents a concrete quantity: the total accumulated value of the function across that span. In physics it might be the total distance covered when you integrate velocity over time, or the total work done when you integrate force over displacement. In probability it is the chance that a random variable falls within an interval. In economics it is the total revenue when you integrate a demand curve. This calculator takes any function of x written in standard notation, for example x^2, a lower limit a and an upper limit b, and returns four results: the total shaded area (all regions counted as positive), the net signed area (regions below the x-axis counted as negative), the average value of the function across the interval, and the width of the interval for reference. Calculation uses Simpson's rule with 1000 subintervals, which gives a highly accurate numerical answer for smooth functions. The calculator is distinct from a Riemann sum calculator because it emphasises the geometric shaded-area concept and provides the average value alongside. Use standard operators +, -, *, / and ^ for powers, plus functions like sin, cos, exp, log, and sqrt.
Shaded area treats all regions as positive. Net signed area subtracts regions below the x-axis. Uses Simpson's rule with 1000 subintervals.
How it works
The calculator applies Simpson's rule: the interval [a, b] is divided into 1000 equal subintervals of width h = (b - a) / 1000. The signed integral sums f(a) + 4f(a+h) + 2f(a+2h) + 4f(a+3h) + ... + f(b), all multiplied by h/3. The shaded area applies the same rule to |f(x)| instead of f(x), so regions below the x-axis contribute positively. The average value of f over [a, b] is the signed integral divided by (b - a), giving the height of a rectangle with the same base and the same net area as the signed region.
Worked example
For f(x) = x^2, a = 0, b = 3: the exact definite integral is x^3/3 evaluated from 0 to 3 = 27/3 = 9.000. Because x^2 is always non-negative, the shaded area and the net signed area are both 9.000. The interval width is 3 and the average value of f over [0, 3] is 9.000 / 3 = 3.000. These match the defaults pre-filled above.
Related calculators
- Riemann Sum Calculator: approximate the same area using rectangular sums and see how accuracy improves with more rectangles.
- Average Rate of Change Calculator: find the slope of a secant line over an interval.
- Tangent Line Calculator: find the tangent to a curve at a point.
- Critical Points Calculator: locate where a function's derivative is zero.