From signed difference to geometric area
On a fixed interval, the vertical distance between two curves changes according to which curve is higher. The geometric area does not change sign when the curves exchange positions: every thin vertical slice contributes a nonnegative amount.
This distinction matters because a definite integral of the difference \(f(x)-g(x)\) is a signed accumulation. Where \(f\) lies above \(g\), the integrand is positive; where \(f\) lies below \(g\), it is negative. Contributions from different parts of the interval can therefore cancel. To measure total geometric area, the height of each slice must be nonnegative.
The absolute value makes the integrand the vertical distance between the curves, regardless of which curve is on top. This formula works whether the curves meet zero, one, or several times on the interval.
Why the absolute difference gives area
At a particular \(x\), the two curve values are \(f(x)\) and \(g(x)\). The vertical distance between them is the nonnegative number \(|f(x)-g(x)|\). A thin vertical strip with width \(\Delta x\) therefore has approximate area \(|f(x)-g(x)|\Delta x\). Adding such strip areas across the interval leads to the integral of that height.
At each \(x\), the vertical distance between the curves is \(|f(x)-g(x)|\).
A strip of width \(\Delta x\) has approximate area \(|f(x)-g(x)|\Delta x\).
The limit of these sums is the definite integral of the continuous height function.
Here is the justification in terms of the definition of area by vertical slices. Divide \([a,b]\) into subintervals and choose a sample point \(x_i^*\) in each subinterval. The corresponding sum of approximate strip areas is
Since \(f\) and \(g\) are continuous, their difference and its absolute value are continuous. Thus the sums converge to the definite integral of the slice height as the subinterval widths tend to zero. This gives
The continuity condition ensures the height is integrable on this closed, bounded interval, so the area is well-defined and finite. If the curves are given by other expressions but still define continuous functions on \([a,b]\), the same reasoning applies.
Finding where the absolute value changes form
To evaluate the formula using antiderivatives, identify where the difference is zero. Set \(h(x)=f(x)-g(x)\). At a zero of \(h\), the graphs meet. Between consecutive zeros, \(h\) cannot change sign: if it did, continuity and the Intermediate Value Theorem would force another zero between those points.
Consequently, on each interval between consecutive zeros, either \(h(x)\ge 0\) throughout or \(h(x)\le 0\) throughout. The absolute value can then be removed with the appropriate sign:
If the zeros in \([a,b]\) are the finite list \(r_1<r_2<\cdots<r_k\), include them as partition points together with the endpoints. On each resulting subinterval, determine the sign of \(h\) and integrate either \(h\) or \(-h\). A zero at an endpoint is simply an endpoint of the partition.
The absolute-difference formula itself does not require a finite number of zeros. But when there are finitely many zeros, splitting the integral gives a direct way to evaluate it using antiderivatives. If the curves never meet inside the interval, their order remains fixed and one ordinary integral suffices.
Worked area with two crossings
Worked Example: A Parabola and a Horizontal Line
Find the area between \(f(x)=x^2\) and \(g(x)=1\) on \([-2,2]\).
First form their difference:
The zeros are \(x=-1\) and \(x=1\). The difference is positive on \([-2,-1]\) and \([1,2]\), and negative on \([-1,1]\). Therefore,
An antiderivative of \(x^2-1\) is \(F(x)=\frac{x^3}{3}-x\), since \(F'(x)=x^2-1\). The left piece is
For the middle piece, an antiderivative of \(1-x^2\) is \(G(x)=x-\frac{x^3}{3}\), since \(G'(x)=1-x^2\). Thus
The right piece is
Adding the three nonnegative contributions gives \(A=\frac43+\frac43+\frac43=4\). As a check, differentiating \(F\) and \(G\) recovers the respective integrands, and each piece is positive. The signed integral of \(f-g\), however, is not this total area:
The outer pieces contribute \(\frac83\) in total, while the signed contribution from the middle is \(-\frac43\). Their signed sum is \(\frac83-\frac43=\frac43\); their geometric areas add to \(\frac83+\frac43=4\).
Worked area with three crossings
Worked Example: A Cubic Difference
Find the area between \(f(x)=x^3\) and \(g(x)=x\) on \([-2,2]\).
The difference factors as
The zeros are \(-1,0,1\). Testing one point in each interval gives the signs: \(h(-2)=-6\), \(h(-\frac12)=\frac38\), \(h(\frac12)=-\frac38\), and \(h(2)=6\). Thus the absolute difference is \(-h\), \(h\), \(-h\), and \(h\), respectively, on the four pieces.
An antiderivative of \(h(x)=x^3-x\) is \(H(x)=\frac{x^4}{4}-\frac{x^2}{2}\), because \(H'(x)=x^3-x\). The two pieces on the positive side are
Since \(h\) is odd, \(|h|\) is even, so the areas on the negative side equal those on the positive side. Hence
For a direct check, the corresponding negative-side pieces have areas \(\frac94\) on \([-2,-1]\) and \(\frac14\) on \([-1,0]\), as follows by evaluating \(H\) at their endpoints and reversing the sign where \(h<0\). The total is therefore \(\frac94+\frac14+\frac14+\frac94=5\). Also, \(H'(x)=h(x)\), as required.
Worked area with two simple roots
Worked Example: A Quadratic Difference on a Larger Interval
Find the area between \(f(x)=x^2-2x+1\) and \(g(x)=0\) on \([0,4]\).
Here the difference is
This expression is nonnegative throughout \([0,4]\), with a zero at \(x=1\). It does not change sign there, so the absolute difference equals \(h\) throughout. An antiderivative is \(H(x)=\frac{x^3}{3}-x^2+x\), and \(H'(x)=x^2-2x+1\). Therefore,
The result is positive, as an area must be. Differentiating the antiderivative gives \((x-1)^2\), confirming the integrand and the evaluation. This example also shows that a zero of the difference need not create a switch in which curve is higher: here the difference touches zero and remains nonnegative.
A common mistake: using signed area as total area
A frequent error is to integrate \(f-g\) across the entire interval and call the result the geometric area, even when the difference changes sign. For the first example, this incorrect approach would report
as the area. That value is the signed integral, not the total area: negative contributions between the crossings cancel part of the positive contributions outside them. The correction is to integrate the absolute difference, or equivalently split at the zeros and reverse the sign on pieces where \(f-g<0\). In that example the geometric area is \(\frac43+\frac43+\frac43=4\).
A related error is to split at every zero but forget to check the sign on each resulting piece. A zero identifies where the curves meet; it does not by itself tell you which curve is higher on either side. Test a point in each open piece or otherwise establish the sign before removing the absolute value.
Why this formulation is useful
Writing area as an integral of an absolute difference gives one compact description that remains valid even when the upper and lower curves exchange roles. It also separates the geometric question from the calculation: first identify the nonnegative slice height, then choose a convenient way to evaluate its integral.
When there are finitely many crossings, the zeros of \(f-g\) tell you exactly where the integrand may change form. On each resulting interval, ordinary antiderivative methods apply to either \(f-g\) or \(g-f\). Always retain the fixed interval endpoints, include every zero inside the interval, and check that the final sum is nonnegative.
Check Your Understanding
For each question, identify the role of the absolute difference and the zeros of the difference.
- State the formula for total area between two continuous functions on a fixed interval \([a,b]\).
- Why can \(\int_a^b(f(x)-g(x))\,dx\) differ from the geometric area?
- For \(f(x)=x^2\) and \(g(x)=4\) on \([0,3]\), find the zeros of \(f-g\) in the interval and state which pieces must be considered.
- If \(f-g\) is continuous and has no zeros in \((a,b)\), what can be said about its sign there?
- Can a zero of \(f-g\) occur without the curves switching which one is higher? Explain briefly.