Why Absolute Differences Give Geometric Area
When two graphs enclose a region, the vertical distance between them is never negative. But the difference of their function values can be positive or negative: its sign depends on which graph is higher. The absolute value resolves that mismatch between an algebraic difference and a geometric distance.
This gives one compact formula for area, even when the graphs cross. To calculate with it, identify where their order changes and split the integral at those points.
Deriving the Formula from Vertical Slices
Fix an \(x\)-value in \([a,b]\). The two graphs have heights \(f(x)\) and \(g(x)\) at that location. The vertical slice between them therefore has height equal to the larger value minus the smaller value. For any real numbers \(u\) and \(v\), that nonnegative difference is \(|u-v|\). The slice height is consequently \(|f(x)-g(x)|\).
A thin slice has approximately the shape of a rectangle: its height is \(|f(x)-g(x)|\), and its width is a small change in \(x\). Adding the areas of such rectangles and taking the limit gives the integral of the slice height. Continuity ensures that this height function is continuous, so its definite integral gives the area.
Thus the absolute-difference formula is not a new way to define a different kind of area. It is the vertical-slice area method written so that the integrand remains nonnegative regardless of which graph is on top.
Turning the Absolute Value into Ordinary Integrals
For hand calculations, it is often useful to remove the absolute-value notation by splitting the interval where the graphs intersect. Define \(h(x)=f(x)-g(x)\). At an intersection, \(h(x)=0\). Between consecutive intersection points, \(h\) cannot change sign: if it changed from positive to negative, or vice versa, continuity and the Intermediate Value Theorem would require it to equal zero somewhere in between.
Once the sign on each subinterval is known, the absolute value has a simple form. Where \(h(x)\ge 0\), \(|h(x)|=h(x)\); where \(h(x)\le 0\), \(|h(x)|=-h(x)\). This yields a piecewise setup.
A zero where the sign does not change, such as a tangency, may still be included as a partition point. It does not cause a problem; the sign test on either side determines whether the same expression is used on both pieces. If the graphs agree throughout an interval, their difference is zero there and that interval contributes no area.
Set \(h(x)=f(x)-g(x)\). Its zeros are the intersection \(x\)-values.
List the intersection values between the endpoints in increasing order.
Use a test value in each open subinterval, or otherwise establish whether \(h\) is positive or negative there.
Integrate \(h\) where it is positive and \(-h\) where it is negative, then add the results.
Worked Examples
Worked Example: A Difference That Changes Sign Twice
Find the area between \(f(x)=x^2-1\) and \(g(x)=0\) on \([-2,2]\). First, \(h(x)=f(x)-g(x)=x^2-1\). Solve for its zeros:
Test values show the sign on each piece: \(h(-2)=3>0\), \(h(0)=-1<0\), and \(h(2)=3>0\). Therefore the area is
An antiderivative of \(x^2-1\) is \(F(x)=\frac{x^3}{3}-x\), since \(F'(x)=x^2-1\). Its endpoint values are
The left piece contributes \(F(-1)-F(-2)=\frac{2}{3}-(-\frac{2}{3})=\frac{4}{3}\). The middle piece contributes \(-[F(1)-F(-1)]=-[-\frac{2}{3}-\frac{2}{3}]=\frac{4}{3}\). The right piece contributes \(F(2)-F(1)=\frac{2}{3}-(-\frac{2}{3})=\frac{4}{3}\). Hence
As a check, each piece is positive, as an area must be. The signed integral without the absolute value is instead \(F(2)-F(-2)=\frac{2}{3}-(-\frac{2}{3})=\frac{4}{3}\), which is not the geometric area. The derivative check \(F'(x)=x^2-1\) confirms the antiderivative used.
Worked Example: A Crossing at an Irrational Value
Find the area between \(f(x)=x^2\) and \(g(x)=2\) on \([0,2]\). Their difference is \(h(x)=x^2-2\), which vanishes at \(x=\sqrt{2}\) in this interval. Since \(h(0)=-2<0\) and \(h(2)=2>0\), the constant graph is higher before the crossing, and the parabola is higher after it. Thus
Use \(H(x)=\frac{x^3}{3}-2x\), for which \(H'(x)=x^2-2\). The needed values are
The first area is \(-[H(\sqrt{2})-H(0)]=\frac{4\sqrt{2}}{3}\). The second is \[ H(2)-H(\sqrt{2}) =-\frac{4}{3}-\left(-\frac{4\sqrt{2}}{3}\right) =\frac{4\sqrt{2}-4}{3}. \] Therefore
The result is positive because \(\sqrt{2}>1\). Also, differentiating \(H\) gives \(x^2-2\), the difference used in both pieces; the negative sign on the first piece accounts for its reversed order of graphs.
Worked Example: Two Graphs with Different Values
Find the area between \(f(x)=x^2-3x+5\) and \(g(x)=3\) on \([0,4]\). Subtract in the stated order:
The intersections are \(x=1\) and \(x=2\). Testing \(x=0\), \(x=\frac{3}{2}\), and \(x=3\) gives \(h(0)=2>0\), \(h(\frac{3}{2})=-\frac{1}{4}<0\), and \(h(3)=2>0\). The area is consequently
An antiderivative is \(F(x)=\frac{x^3}{3}-\frac{3x^2}{2}+2x\), since \(F'(x)=x^2-3x+2\). Evaluate it at each endpoint:
The three areas are \(F(1)-F(0)=\frac{5}{6}\), \(F(1)-F(2)=\frac{5}{6}-\frac{2}{3}=\frac{1}{6}\), and \(F(4)-F(2)=\frac{16}{3}-\frac{2}{3}=\frac{14}{3}\). Therefore
Each contribution is positive. As an additional check, the signed integral is \(F(4)-F(0)=\frac{16}{3}\); the geometric area is larger because the negative portion of \(h\) must contribute positively to area.
A Common Mistake: Taking the Absolute Value After Integration
A frequent error is to calculate the signed integral first and then take its absolute value. In general, \(\left|\int_a^b h(x)\,dx\right|\) is not the same as \(\int_a^b |h(x)|\,dx\). Positive and negative parts can cancel in the signed integral, but areas on both sides of the axis must be added.
For \(h(x)=x^2-1\) on \([-2,2]\), the signed integral is \(\frac{4}{3}\), as computed above. Taking its absolute value still gives only \(\frac{4}{3}\), not the geometric area \(4\). The correction is to split at \(x=-1\) and \(x=1\), reverse the sign of the integrand on \((-1,1)\), and add the three positive contributions. Equivalently, integrate \(|x^2-1|\) over the whole interval.
When the Formula Is Useful
The absolute-difference formula is useful when the upper graph changes across the interval. It avoids trying to name one function as “top” for the entire region: instead, it measures the vertical distance at every \(x\). For evaluation, finding the intersections and checking the sign of \(f-g\) converts that single expression into ordinary integrals.
The formula also provides a useful setup check. The integrand \(|f(x)-g(x)|\) is nonnegative, so the resulting area cannot be negative. If a piecewise calculation produces a negative contribution, check the order of subtraction or the sign assigned on that subinterval. Remember that this formula assumes the region is described by the two graphs between the stated \(x\)-bounds; if the boundary changes to another curve, the boundaries for those slices must be identified appropriately.
Check Your Understanding
For each question, identify the relevant difference and pay attention to where its sign changes.
- Explain why the vertical height between \(y=f(x)\) and \(y=g(x)\) is \(|f(x)-g(x)|\), regardless of which graph is higher.
- For \(f(x)=x^2-4\) and \(g(x)=0\) on \([-3,3]\), find the intersection values and write the area as a sum of integrals without absolute-value symbols.
- What continuity fact ensures that the sign of \(f(x)-g(x)\) cannot change between consecutive intersection values?
- For the two graphs \(y=x^2\) and \(y=2\) on \([0,2]\), which graph is higher on each side of their intersection?
- Why can taking the absolute value of a signed integral fail to give the geometric area between graphs?