← Back to learning objective

Evaluating a definite integral of an absolute value function

Recall that ∣x−1∣=1−x|x-1| = 1-x for x≤1x \le 1 and ∣x−1∣=x−1|x-1| = x-1 for x≥1x \ge 1. This allows a definite integral of an absolute value function to be evaluated by splitting the interval at the point where the expression inside the absolute value changes sign.

Evaluate the definite integral

∫02∣x−1∣ dx\int_0^2 |x-1|\, dx

by splitting it into two integrals at the point where x−1x-1 changes sign, and using the Fundamental Theorem of Calculus (Part 2) to evaluate each piece. Give the exact value of the integral.

Evaluating a definite integral of an absolute value function graph
Hint

On [0,1][0,1], x−1≤0x-1 \le 0 so ∣x−1∣=1−x|x-1| = 1-x; on [1,2][1,2], x−1≥0x-1 \ge 0 so ∣x−1∣=x−1|x-1| = x-1. Find an antiderivative for each piece and apply FTC Part 2 to each, then add the results.

Step-by-step solution

Since x−1≤0x-1 \le 0 on [0,1][0,1] and x−1≥0x - 1 \ge 0 on [1,2][1,2], we split the integral as ∫02∣x−1∣ dx=∫01(1−x) dx+∫12(x−1) dx\int_0^2 |x-1|\,dx = \int_0^1 (1-x)\,dx + \int_1^2 (x-1)\,dx. An antiderivative of 1−x1-x is x−x22x - \frac{x^2}{2}, and an antiderivative of x−1x-1 is x22−x\frac{x^2}{2} - x.

By FTC Part 2, ∫01(1−x) dx=[x−x22]01=(1−12)−(0−0)=12\int_0^1 (1-x)\,dx = \left[x - \frac{x^2}{2}\right]_0^1 = \left(1-\frac12\right)-(0-0) = \frac12. Similarly, ∫12(x−1) dx=[x22−x]12=(2−2)−(12−1)=12\int_1^2 (x-1)\,dx = \left[\frac{x^2}{2}-x\right]_1^2 = (2-2)-\left(\frac12-1\right) = \frac12. Adding these gives 12+12=1\frac12+\frac12 = 1.

Related problems

Practice similar Calculus problems interactively.

Start Closing the Gap