← Back to learning objective

Evaluating a definite integral via the area of a triangle

Consider the function f(x)=3−∣x−2∣f(x) = 3 - |x - 2| on the interval [0,4][0, 4].

The graph of f(x)=3−∣x−2∣f(x) = 3 - |x-2| on [0,4][0,4] forms a triangle with the xx-axis, with its peak at (2,3)(2,3).

Evaluating a definite integral via the area of a triangle graph

Using the area of this triangular region, evaluate ∫04(3−∣x−2∣) dx\displaystyle\int_0^4 (3 - |x-2|) \, dx.

Hint

Identify the base and height of the triangle formed by the graph and the x-axis, then use the formula for the area of a triangle: 12(base)(height)\frac{1}{2}(\text{base})(\text{height}). Since the region lies entirely above the x-axis, the integral equals this area.

Step-by-step solution

The graph of f(x)=3−∣x−2∣f(x) = 3-|x-2| crosses the x-axis where 3−∣x−2∣=03 - |x-2| = 0, i.e., ∣x−2∣=3|x-2| = 3, giving x=−1x = -1 or x=5x = 5. However, we only need the portion on [0,4][0,4]: at x=0x=0, f(0)=3−2=1f(0) = 3-2=1, and at x=4x=4, f(4)=3−2=1f(4) = 3-2=1, while the peak occurs at x=2x=2 with f(2)=3f(2) = 3. So the region on [0,4][0,4] is a triangle-like shape, but since ff stays positive throughout (never touching zero on this interval), it's actually a trapezoid... Let's instead directly compute using the fact that the shape is a triangle centered at x=2x=2: the full triangle (base from x=−1x=-1 to x=5x=5, height 3) is symmetric, and [0,4][0,4] captures the full triangle minus two small corner triangles.

Simpler approach: split the region at the peak x=2x=2. On [0,2][0,2], f(x)=3−(2−x)=x+1f(x) = 3-(2-x) = x+1, a line from (0,1)(0,1) to (2,3)(2,3) — this is a trapezoid with parallel sides 11 and 33 and width 22, area =12(1+3)(2)=4= \frac{1}{2}(1+3)(2) = 4. On [2,4][2,4], f(x)=3−(x−2)=5−xf(x) = 3-(x-2) = 5-x, a line from (2,3)(2,3) to (4,1)(4,1) — again a trapezoid with parallel sides 33 and 11 and width 22, area =4=4. Since f(x)≥0f(x) \geq 0 on all of [0,4][0,4], the integral equals the total area: 4+4=84+4 = 8.

Related problems

Practice similar Calculus problems interactively.

Start Closing the Gap