Area Between Curves

Two companies launch on the same day. One's revenue climbs along a smooth curve; its costs creep up along another. At any instant the vertical gap between the two curves is the profit rate — money in minus money out. And the total profit earned over a whole year? That's the area trapped between the two curves. The same picture shows up everywhere two quantities accumulate side by side: two runners' velocity curves (the area between them is the lead one gains over the other), a drug entering and leaving the bloodstream, water flowing into and draining out of a reservoir. The gap between two growth stories is always an area.

You already know that a single definite integral measures the area between a curve and the x-axis. Replace that axis with a second curve and you get the area trapped between the two. If, on [a, b], the curve y = f(x) sits on top and y = g(x) underneath (so f(x) \ge g(x) throughout), the region between them has area

A = \int_a^{b} \big(f(x) - g(x)\big)\,dx.

Read it as "top minus bottom, integrated across the strip". Notice it is a subtraction of accumulations: the area under f minus the area under g, all in one integral. The lower curve is even free to dip below the axis — the subtraction still measures the genuine vertical gap.

Why "top minus bottom"? A strip-by-strip derivation

The formula is not an extra rule to memorise — it falls straight out of the Riemann-sum picture, exactly the way the ordinary area-under-a-curve formula did.

Step 1 — slice the region into thin vertical strips. Chop [a, b] into n pieces of width \Delta x. Over the i-th piece, at a sample point x_i, approximate the region by a rectangle that reaches up to the top curve and down to the bottom curve.

Step 2 — find one strip's area. That rectangle has width \Delta x and height equal to the vertical gap between the curves, f(x_i) - g(x_i). So its area is

\Delta A_i = \big(f(x_i) - g(x_i)\big)\,\Delta x.

Step 3 — add up all the strips. The whole region is approximately the sum of these rectangles — a Riemann sum:

A \approx \sum_{i=1}^{n} \big(f(x_i) - g(x_i)\big)\,\Delta x.

Step 4 — refine to a limit. Let the strips get infinitely thin (n \to \infty, \Delta x \to 0). The Riemann sum converges to the definite integral, and the approximation becomes exact:

A = \lim_{n \to \infty} \sum_{i=1}^{n} \big(f(x_i) - g(x_i)\big)\,\Delta x = \int_a^{b} \big(f(x) - g(x)\big)\,dx.

The height of the strip is the gap, not the height above the axis — that one change is the whole idea. Everything else is the definite integral you already own.

Worked example 1: a line and a parabola

Find the area enclosed between the line y = x and the parabola y = x^2. No interval is given — the curves themselves fence off a little leaf-shaped region, and its ends are where the curves meet. So the golden rule: find the intersections first.

Step 1 — find where they meet (the limits of integration). Set the curves equal:

x = x^2 \;\Longrightarrow\; x^2 - x = 0 \;\Longrightarrow\; x(x - 1) = 0 \;\Longrightarrow\; x = 0,\ 1.

Step 2 — decide which curve is on top. Test a point inside (0, 1), say x = \tfrac12: x = 0.5 while x^2 = 0.25. The line is higher, so f(x) = x is the top and g(x) = x^2 the bottom.

Step 3 — set up the integral.

A = \int_0^{1} \big(x - x^2\big)\,dx.

Step 4 — antidifferentiate and evaluate.

A = \left[\frac{x^2}{2} - \frac{x^3}{3}\right]_0^{1} = \left(\frac{1}{2} - \frac{1}{3}\right) - 0 = \frac{3 - 2}{6} = \frac{1}{6}.

The little sliver between line and parabola has area exactly \tfrac16 — a suspiciously tidy answer, and (as the vignette below shows) one that economists quietly reuse to measure inequality.

Let f and g be continuous on [a, b] with f(x) \ge g(x) there. The area of the region bounded above by y = f(x) and below by y = g(x) is

A = \int_a^{b} \big(f(x) - g(x)\big)\,dx.

Economists draw a country's income distribution as a Lorenz curve L(x): the poorest fraction x of the population earns fraction L(x) of all income. Perfect equality would be the diagonal y = x ("the poorest 40% earn 40%"); real curves sag below it. The standard measure of inequality — the Gini coefficient — is just twice the area between the diagonal and the Lorenz curve:

G = 2\int_0^{1} \big(x - L(x)\big)\,dx.

If a country's Lorenz curve happened to be L(x) = x^2, you have already done the integral: the area is \tfrac16, so G = \tfrac13 — close to the real figure for the UK. Perfect equality gives G = 0 (no gap at all); one person earning everything pushes G towards 1. A between-curves area, quoted in newspapers.

See the region, change the strip

Here are the line y = x and the parabola y = x^2, with the region between them shaded. Drag the limits a and b: the shaded area updates live, and the readout reports \int_a^{b}(x - x^2)\,dx exactly. At a = 0,\ b = 1 you recover the \tfrac16 above.

Now try pushing b past 1, or a below 0. Beyond the intersection points the parabola climbs above the line, so the integrand x - x^2 goes negative there and the readout starts shrinking — the integral is quietly subtracting the new region instead of adding it. That is the crossing trap in action, and it is exactly what the next example is about.

Worked example 2: when the curves cross mid-interval

Find the total area enclosed between y = x and y = x^3.

Step 1 — intersections. x^3 = x \Rightarrow x(x^2 - 1) = 0 \Rightarrow x = -1,\ 0,\ 1. Three meeting points — so the enclosed region has two separate lobes, and the curves swap places at x = 0.

Step 2 — who's on top, piece by piece. On (-1, 0), test x = -\tfrac12: x^3 = -\tfrac18 beats x = -\tfrac12, so the cubic is on top. On (0, 1), test x = \tfrac12: \tfrac12 > \tfrac18, so the line is on top. The roles flip at the crossing.

Step 3 — split at the crossing and keep each piece positive.

A = \int_{-1}^{0} \big(x^3 - x\big)\,dx \;+\; \int_{0}^{1} \big(x - x^3\big)\,dx.

Step 4 — evaluate each piece.

\int_{-1}^{0} \big(x^3 - x\big)\,dx = \left[\frac{x^4}{4} - \frac{x^2}{2}\right]_{-1}^{0} = 0 - \left(\frac14 - \frac12\right) = \frac14, \int_{0}^{1} \big(x - x^3\big)\,dx = \left[\frac{x^2}{2} - \frac{x^4}{4}\right]_{0}^{1} = \frac12 - \frac14 = \frac14, A = \frac14 + \frac14 = \frac12.

Now watch what happens if you skip the split and blindly integrate one difference across the whole interval:

\int_{-1}^{1} \big(x - x^3\big)\,dx = \left[\frac{x^2}{2} - \frac{x^4}{4}\right]_{-1}^{1} = \frac14 - \frac14 = 0.

Zero! The integrand is an odd function, so the left lobe (where it is negative) exactly cancels the right lobe. The integral is telling the truth about signed area — it just isn't answering the question you asked. Genuine area demands the split.

Two traps catch almost every first attempt at these problems:

Worked example 3: slicing sideways — integrating in y

Find the area enclosed between the sideways parabola x = y^2 and the line x = y + 2.

Try vertical strips and you hit trouble immediately: the parabola fails the vertical-line test, so "the top curve" isn't even a function of x. From x = 0 to 1 a strip runs between the two halves of the parabola; from x = 1 to 4 it runs from the line up to the upper half. Two different integrals, square roots everywhere.

Slice horizontally instead. A horizontal strip at height y enters the region on the parabola and leaves on the line — each boundary is a single honest function of y. The recipe is the same with the roles rotated a quarter-turn:

A = \int_c^{d} \big(x_{\text{right}}(y) - x_{\text{left}}(y)\big)\,dy.

Step 1 — intersections (in y).

y^2 = y + 2 \;\Longrightarrow\; y^2 - y - 2 = 0 \;\Longrightarrow\; (y - 2)(y + 1) = 0 \;\Longrightarrow\; y = -1,\ 2.

Step 2 — which curve is on the right? Test y = 0: the line gives x = 2, the parabola x = 0. The line is to the right throughout.

Step 3 — set up and evaluate.

A = \int_{-1}^{2} \big((y + 2) - y^2\big)\,dy = \left[\frac{y^2}{2} + 2y - \frac{y^3}{3}\right]_{-1}^{2} = \left(2 + 4 - \frac{8}{3}\right) - \left(\frac{1}{2} - 2 + \frac{1}{3}\right) = \frac{10}{3} - \left(-\frac{7}{6}\right) = \frac{27}{6} = \frac{9}{2}.

One clean integral, area \tfrac92. (If you're stubborn, the two-piece vertical version gives \int_0^1 2\sqrt{x}\,dx + \int_1^4 \big(\sqrt{x} - (x-2)\big)\,dx = \tfrac43 + \tfrac{19}{6} = \tfrac{27}{6} — the same \tfrac92, earned the hard way.)

The rule of thumb: slice in whichever direction the boundary becomes single-valued. A region fenced above and below by function graphs wants vertical strips and dx; a region fenced left and right (sideways parabolas, x = something) wants horizontal strips and dy. Nothing new is being learned — swap every x for a y, "top minus bottom" for "right minus left", and the entire theory carries over. Many classic shapes yield to one slicing and resist the other: the lens (or "leaf") between two circles, the region between y^2 = x and a chord, the cross-sections engineers integrate to find how stiff a beam is. Choosing the slicing direction is the skill.

See it explained