Tutorials › AP Statistics › Deriving Area Integrals with Absolute Differences

Area Between Curves · Tutorial 644 of 999

Deriving Area Integrals with Absolute Differences

Use vertical slices to derive the absolute-difference formula for area, then split it at curve intersections to evaluate it piece by piece.

Intermediate 9 min read

What You'll Learn

  • Derive the area formula from the height of a vertical slice
  • Express the distance between two function values as an absolute difference
  • Locate intersections that can change which graph is higher
  • Convert an absolute-value integral into piecewise integrals
  • Distinguish geometric area from signed integral

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.

Definition: If \(f\) and \(g\) are continuous on \([a,b]\), and the region consists of the points between their graphs for \(a\le x\le b\), its area is $$ A=\int_a^b |f(x)-g(x)|\,dx. $$

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.

$$ \text{slice height} = \max(f(x),g(x))-\min(f(x),g(x)) = |f(x)-g(x)|. $$

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.

Theorem: Suppose \(h=f-g\) is continuous on \([a,b]\), and its distinct zeros in the interval are finite. Partition \([a,b]\) at those zeros. On each resulting subinterval, choose \(h\) or \(-h\) according to the sign of \(h\) there. The sum of those integrals equals \(\int_a^b |h(x)|\,dx\), and therefore equals the area between the graphs.

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.

1
Subtract the functions.
Set \(h(x)=f(x)-g(x)\). Its zeros are the intersection \(x\)-values.
2
Partition at the zeros.
List the intersection values between the endpoints in increasing order.
3
Determine each sign.
Use a test value in each open subinterval, or otherwise establish whether \(h\) is positive or negative there.
4
Integrate nonnegative heights.
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:

$$ x^2-1=0 \quad\Longrightarrow\quad x=-1,\;1. $$

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

$$ A=\int_{-2}^{-1}(x^2-1)\,dx +\int_{-1}^{1}(1-x^2)\,dx +\int_1^2(x^2-1)\,dx. $$

An antiderivative of \(x^2-1\) is \(F(x)=\frac{x^3}{3}-x\), since \(F'(x)=x^2-1\). Its endpoint values are

$$ F(-2)=-\frac{2}{3},\qquad F(-1)=\frac{2}{3},\qquad F(1)=-\frac{2}{3},\qquad F(2)=\frac{2}{3}. $$

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

$$ A=\frac{4}{3}+\frac{4}{3}+\frac{4}{3}=4. $$

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

$$ A=\int_0^{\sqrt{2}}(2-x^2)\,dx +\int_{\sqrt{2}}^2(x^2-2)\,dx. $$

Use \(H(x)=\frac{x^3}{3}-2x\), for which \(H'(x)=x^2-2\). The needed values are

$$ H(0)=0,\qquad H(\sqrt{2})=\frac{2\sqrt{2}}{3}-2\sqrt{2} =-\frac{4\sqrt{2}}{3},\qquad H(2)=\frac{8}{3}-4=-\frac{4}{3}. $$

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

$$ A=\frac{4\sqrt{2}}{3}+\frac{4\sqrt{2}-4}{3} =\frac{8\sqrt{2}-4}{3}. $$

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:

$$ h(x)=f(x)-g(x)=x^2-3x+2=(x-1)(x-2). $$

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

$$ A=\int_0^1 h(x)\,dx-\int_1^2 h(x)\,dx+\int_2^4 h(x)\,dx. $$

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:

$$ F(0)=0,\qquad F(1)=\frac{1}{3}-\frac{3}{2}+2=\frac{5}{6}, $$ $$ F(2)=\frac{8}{3}-6+4=\frac{2}{3},\qquad F(4)=\frac{64}{3}-24+8=\frac{16}{3}. $$

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

$$ A=\frac{5}{6}+\frac{1}{6}+\frac{14}{3} =1+\frac{14}{3} =\frac{17}{3}. $$

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.

  1. Explain why the vertical height between \(y=f(x)\) and \(y=g(x)\) is \(|f(x)-g(x)|\), regardless of which graph is higher.
  2. 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.
  3. What continuity fact ensures that the sign of \(f(x)-g(x)\) cannot change between consecutive intersection values?
  4. For the two graphs \(y=x^2\) and \(y=2\) on \([0,2]\), which graph is higher on each side of their intersection?
  5. Why can taking the absolute value of a signed integral fail to give the geometric area between graphs?

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon