The idea: stack thin rectangles between the two curves
Slice the region into vertical strips. Each strip has width dx and height equal to the vertical gap between the curves at that x — the upper curve minus the lower one. Multiply, add up, and take the limit. That is the integral ∫(top − bottom) dx, and it is the entire method.
Everything that makes these problems fiddly comes from one question: which curve is on top? The answer can change along the interval, and it changes exactly at the points where the curves cross. So the real work is finding the intersections, and then integrating the correct difference on each stretch between them.
Writing the integrand as |f − g| handles it automatically. The absolute value picks whichever curve is higher without you having to decide, and it guarantees that every strip contributes a positive amount. Compare that with the plain integral ∫(f − g) dx, which lets a stretch where g is on top subtract from a stretch where f is on top. Both quantities are reported here, and the gap between them tells you the curves swapped places.
You do not always want a vertical slice. If the region is bounded left and right rather than above and below — a parabola opening sideways, say — horizontal strips are simpler, and the integral becomes ∫(right − left) dy. The arithmetic is identical with the roles of the variables exchanged.
Finding the limits, which is where most of the difficulty lives
In automatic mode the calculator scans your window at 801 points, watches the sign of f − g, and records every place it flips. Each flip is then refined by 60 rounds of bisection, which locates the crossing to roughly machine precision. Integration then runs from the first crossing to the last, splitting at every crossing in between.
This is a numerical search, and it has the honest limitation that every numerical search has: two crossings closer together than the sample spacing can be missed as a pair. The spacing is the window width divided by 800, so a window of 4 units resolves features down to 0.005. Narrow the window when you suspect crowding.
A crossing that is not a sign change is invisible to a sign-change search, and mostly that is correct. Where f − g touches zero without crossing — x² against 2x − 1, which meet only at x = 1 — there is no enclosed region on either side to measure, so the region has zero width there. The one case where this costs you something real is a meeting point that sits on the edge of a domain: sqrt(x) and x² meet at the origin and at 1, but the origin is where sqrt begins rather than where the difference changes sign, so automatic mode reports one crossing and no region. Switch to fixed limits and enter 0 and 1.
Fixed-limit mode exists for the cases where the mathematical answer depends on limits you were given rather than on the geometry: an area swept between two specific times, or a region cut off by a vertical boundary. In that mode the calculator still splits at every interior crossing, so the absolute value is still applied correctly.
Worked example: the area between y = x² and y = 2x
These are the default curves.
- Find the intersections. Set
x² = 2x, sox² − 2x = 0, sox(x − 2) = 0. The curves meet atx = 0andx = 2. - Decide which is on top. Test the midpoint
x = 1: the line gives2, the parabola gives1. The line is above. - Set up the integral.
A = ∫ from 0 to 2 of (2x − x²) dx. - Antidifferentiate.
x² − x³/3. - Evaluate. At the upper limit,
4 − 8/3 = 4/3. At the lower limit,0. SoA = 4/3 = 1.3333333.
The calculator reports exactly that, with intersections at 0 and 2 and a single sub-region in the table with the note that g(x) — the line, entered second — is on top.
Now a case where the sign matters. Take f = sin x, g = 0, over fixed limits from 0 to 2π. The curves cross at x = π inside the interval. On the first half sine is above the axis and contributes +2; on the second half it is below and contributes −2. The signed integral is therefore 0, while the area is 2 + 2 = 4. That pair of numbers is one of this calculator's test vectors, and it is the single clearest illustration of why the absolute value belongs in the formula.
And a case where the split is essential. For f = x³ against g = x, the curves cross at −1, 0 and 1. The cubic is above the line between −1 and 0 and below it between 0 and 1. Each piece has area 1/4, so the total is 1/2 — but the signed integral over the whole range is zero, since the two pieces are mirror images.
How to read the results
Compare the area against the signed integral. When they match in magnitude, one curve stayed above the other throughout, and the sign of the signed integral tells you which. When the area is larger, the curves swapped places and the table shows where.
Check the crossing count against what you expect. Two polynomials of degrees m and n can cross at most max(m, n) times, so a count higher than that in your window means the search found numerical noise — usually because the two functions are equal on a whole stretch. A count lower than expected means a crossing fell outside the window.
Check the limits the calculator actually used. In automatic mode they are the outermost crossings, which may be inside your window. If they sit exactly at the window edges, the region probably extends beyond it and you should widen the window.
Read the sub-region table when the answer surprises you. Each row is bounded by consecutive crossings, gives that piece's area as a positive number, and names the curve on top. Adding the pieces reproduces the total, which is a useful arithmetic check on any hand calculation.
Standard area-between-curves problems and their exact answers
| Curves | Intersections | Top curve | Exact area | Decimal |
|---|---|---|---|---|
x² and 2x | 0, 2 | the line | 4/3 | 1.3333333 |
x² and x | 0, 1 | the line | 1/6 | 0.1666667 |
x² and 4 | −2, 2 | the constant | 32/3 | 10.666667 |
x³ and x | −1, 0, 1 | swaps at 0 | 1/2 | 0.5000000 |
sin x and 0 on [0, π] | 0, π | the sine | 2 | 2.0000000 |
sin x and 0 on [0, 2π] | 0, π, 2π | swaps at π | 4 | 4.0000000 |
sqrt(x) and x² | 0 (domain edge), 1 | the root | 1/3 | 0.3333333 |
e^x and 1 on [0, 1] | 0 | the exponential | e − 2 | 0.7182818 |
The x³ against x row and the sine over a full period row both have a signed integral of zero. Their areas are not zero, which is the whole point of the absolute value. Two rows need fixed limits. For sqrt(x) against x² the curves do meet at the origin, but that meeting is the left-hand edge of the domain of sqrt rather than a sign change of f − g, so the automatic scan finds only the crossing at x = 1; enter 0 and 1 as fixed limits. The e^x against 1 row is the same situation at a tangential-looking single contact, which is why the row states its interval.
Mistakes that produce the wrong area
- Integrating
f − gacross a crossing without splitting. The two sides cancel and you get a number smaller than the true area, sometimes exactly zero. - Subtracting in the wrong order. Bottom minus top gives a negative result. The absolute value fixes it, but if you are working by hand, check which curve is higher at a test point inside each stretch.
- Missing an intersection outside the window. Automatic mode can only see crossings you gave it room to find. If the region looks clipped, widen the window.
- Assuming polynomials cross where their formulas look equal. Solve the equation properly.
x² = 2xhas roots 0 and 2, not just 2 — dividing both sides by x loses the root at the origin. - Slicing the wrong way. Some regions need horizontal strips because a single vertical strip would cross three boundary pieces. Rewrite the curves as functions of y and integrate in y instead.
- Treating a tangential touch as a boundary. Where two curves touch without crossing there is no enclosed region on either side of that point, and the width of the region is zero there.
Where this leads next
Rotate the region and you get a volume. Spinning the area between two curves about a horizontal axis gives washers of outer radius f and inner radius g, and the volume is π∫(f² − g²) dx — handled by the disk and washer calculator. Rotating about a vertical axis instead favours the shell method.
Consumer and producer surplus are areas between curves. In economics, the area between a demand curve and the market price is consumer surplus, and the area between price and the supply curve is producer surplus. Both are computed by the integral on this page with the price line as one of the two curves.
The area between two cumulative distributions is a standard measure of how far apart two probability models are, and it is the same integral again.
For a single curve against the axis, enter 0 as the second function, or use the definite integral calculator directly and read its unsigned-area output.
For the length of the boundary rather than the area it encloses, use the arc length calculator, which integrates sqrt(1 + f′²) instead.
