Home » Blog » Compute the area between the graphs of functions

Compute the area between the graphs of functions

Let

    \[ f(x) = |x-1|, \qquad g(x) = x^2-2x. \]

Find the area between the graphs of f and g on the interval [0,2].


First, we draw the graph, shading the region S between the two graphs in blue.

Rendered by QuickLaTeX.com

In this problem f(x) \geq g(x) on the entire interval [-1,1]; however, the function f(x) = |x| is defined piecewise on this interval as

    \[ f(x) = |x-1| = \begin{cases} -(x-1) & \text{if } x \in [0,1) \\ x-1 & \text{if } x \in [1,2] \end{cases}. \]

Thus, we break the integral into intervals [0,1] and [1,2], and in both cases we are taking the integral of f(x) - g(x), but the definition of f will depend on which interval we are in. The computation is as follows:

    \begin{align*}   a(S) = \int_0^2 (f(x) - g(x)) \, dx &= \int_0^1 (-(x-1) - x^2 + 2x) \, dx + \int_1^2 (x-1 - x^2 + 2x) \, dx \\  &= \int_0^1 (-x^2 + x + 1) \,dx + \int_1^2 (-x^2 + 3x - 1) \, dx \\  &= \left. \left( -\frac{x^3}{3} + \frac{x^2}{2} + x \right) \right|_0^1 + \left. \left( -\frac{x^3}{3} + \frac{3x^2}{2} - x \right) \right|_1^2 \\  &= \left( -\frac{1}{3} + \frac{1}{2} + 1 \right) + \left( -\frac{8}{3} + 6 - 2 + \frac{1}{3} - \frac{3}{2} + 1\right) \\  &= \frac{7}{6} + \frac{7}{6} \\  &= \frac{7}{3}. \end{align*}

2 comments

  1. Anonymous says:

    1) on line 1, the second integral’s integrand is x – 1 – x^2 + 2x, instead of x – 1 – x^2 – 2x.
    2) on line 2, the first integral’s integrand should be -x^2 + x + 1, instead of -x^2 – x + 1

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):