How to Find the Area Under a Curve Using Integration

Rectangles get you close. An antiderivative gets you exact. Here's the actual procedure for computing area under any curve, worked step by step, with a tank of water instead of hand-waving.

By Petrus Sheya

July 19, 2026 · 5 min read

How do you actually compute the area trapped under a wiggly curve, not just gesture at "infinitely many rectangles" and move on?

Here's the picture we'll use for the whole post. Imagine a water tank fed by a tap. The tap's flow rate changes constantly, sometimes fast, sometimes barely a trickle, and it can even reverse into a drain. You want to know how much water is in the tank at some moment. That's the area problem. The flow rate is your curve, and the water in the tank is the area underneath it.

Let's actually find it.


Read the gauge, pick a moment, multiply

You can't measure a changing flow rate all at once. But you can freeze time for a second, read the gauge, and multiply by how long that rate held.

Rate × time = volume. That's just multiplication, and it's exact, if the rate were constant. It isn't. So you chop the total time into short chunks, pretend the rate is constant within each chunk, and add up the little volumes.

Each chunk becomes a rectangle: width is the time slice, height is the flow rate you read. But here's a question you have to answer before you can compute anything: when in that chunk do you take the reading? At the start? The end? Right in the middle?

Which reading moment wins?

Every strip needs a flow reading. Pick when you take it, left edge, right edge, the middle, or both edges averaged, then watch how fast each choice closes in on the true tank volume as the strips get thinner.

x (time)flow rate
Approximation21.1852
True volume21.3333
Error0.1481

Notice something. Left and right readings tend to lean the wrong way, one runs high, the other runs low, so their errors shrink slowly. Midpoint and trapezoid straddle the curve instead of leaning against it, so their errors shrink much faster as you add strips.

Any of them work eventually. Written formally, this whole strategy is a Riemann sum:

volumei=1nf(xi)Δx\text{volume} \approx \sum_{i=1}^{n} f(x_i)\,\Delta x

where f(xi)f(x_i) is whatever reading rule you picked, and Δx\Delta x is the width of one strip. As nn \to \infty, every one of those rules converges to the same number. That number is what we call the integral.

But here's the thing. You don't want to babysit a spreadsheet of ten thousand strips every time you need an area. There's a shortcut, and it comes from a strange, wonderful fact about the tank itself.


The tank has a real gauge, not just guesses

Forget approximating for a second. The tank already has an actual water level at every moment, a real number, not an estimate. Call that level F(x)F(x).

Here's the wonderful fact: the rate at which F(x)F(x) is rising, at any instant, is exactly the tap's flow rate at that instant. The gauge's slope is the tap's rate. That's not a coincidence, it's practically the definition of what "rate" means. If the tank is filling at 3 liters per minute right now, the level is rising at 3 liters per minute right now. Same number.

That single fact is the whole reason exact areas are computable at all. If we can find the formula for F(x)F(x), its slope tells us f(x)f(x) back, everywhere, instantly, no summing required.

The gauge's slope is the tap's rate

This curve is the tank's water level, F(x) = x3/3. Drag the dot along it. The tangent line's slope is measured live, and it always matches the current tap rate f(x) = x2, exactly.

xtank level
x₀1.40
Gauge's slope1.960
Tap rate f(x₀)1.960

Drag the dot. The tangent line's slope always lands on the tap rate, for every power you try. This works for f(x)=xnf(x) = x^n specifically because of a pattern:

f(x)=xnF(x)=xn+1n+1f(x) = x^n \quad\Longrightarrow\quad F(x) = \frac{x^{n+1}}{n+1}

We call F(x)F(x) the antiderivative of f(x)f(x), because differentiating F(x)F(x) gives you f(x)f(x) right back. Finding it, for a given ff, is the one piece of real work in this whole method. The good news: mathematicians have already worked out the antiderivative for almost every function you'll run into.


The whole point: subtract two gauge readings

Once you have F(x)F(x), here's the payoff. The volume added between two moments aa and bb is just:

volume=F(b)F(a)\text{volume} = F(b) - F(a)

Read that as: the gauge level at the end, minus the gauge level at the start. Whatever happened in between, however wildly the tap sputtered, doesn't matter. Only the two endpoint readings do.

Two readings, one subtraction

The gauge for f(x) = x² is F(x) = x³/3. Drag the upper bound and watch the shaded volume update as just two lookups and a subtraction, no adding of strips required.

a=1b=3.0
F(x) = x³ / 3
F(b) = F(3.0)9.000
F(a) = F(1)0.333
Area = F(b) − F(a)8.667

Drag the bound and watch it happen live: no strips, no sum, just two lookups and a subtraction. This is the Fundamental Theorem of Calculus, and it's why the notation for area looks the way it does:

abf(x)dx=F(b)F(a)\int_a^b f(x)\, dx = F(b) - F(a)

That stretched \int is an old-style S, for "sum," a leftover from the rectangle-adding origin of the idea. But in practice you almost never sum. You find FF, plug in, subtract. An infinite process collapses into arithmetic.

Try it by hand for 13x2dx\int_1^3 x^2\,dx. The antiderivative of x2x^2 is x3/3x^3/3. Plug in: F(3)F(1)=913=8.6F(3) - F(1) = 9 - \tfrac{1}{3} = 8.\overline{6}. Six symbols, one subtraction, exact answer.


What if the tap runs backward?

So far the tap has only ever filled the tank. But what if it reverses, and starts draining?

When f(x)f(x) dips below zero, each thin slice f(x)dxf(x)\,dx is negative. That's not a glitch, it's the tank losing water. Add it into the running total, and it cancels out water added earlier.

What if the tap runs backward?

Sweep past the point where the tap reverses into a drain. In signed mode the tank level can fall back down. In total mode you're metering every drop that moved, in or out, and the gauge only ever climbs.

xtank
Signed area2.000
Total area2.000

Sweep the bound past the point where the curve crosses zero. In signed mode, the gauge climbs, then sinks back down, because the drain is undoing the fill. In total mode, we're not asking "how much water is left," we're asking "how much water moved through the pipe, period," so both directions count as positive and the gauge only ever climbs.

Both are legitimate answers, they just answer different questions. Signed area is:

abf(x)dx\int_a^b f(x)\, dx

Total area, when you want every drop counted regardless of direction, swaps in the absolute value:

abf(x)dx\int_a^b |f(x)|\, dx

Which one you want depends entirely on what the number is supposed to mean.


The actual how-to

Strip away the tank metaphor and here's the procedure, every time:

  1. Identify f(x)f(x), the thing that's varying, and the bounds aa and bb you care about.
  2. Find F(x)F(x), a function whose derivative is f(x)f(x). This is the one step that takes real work, and it's what most of a calculus course trains you to do.
  3. Compute F(b)F(a)F(b) - F(a).
  4. If the curve crosses zero and you want the total rather than the net, split the interval at each crossing and add the absolute values of each piece instead.

That's it. Approximation with rectangles is how you'd survive without step 2. The antiderivative is what turns "add up infinitely many infinitely thin things" into a computation you can do on paper in under a minute.