Solution:
Key idea: To integrate ∣g(x)∣, find the sign of g(x) on the interval and remove the modulus: ∣g(x)∣=g(x) where g(x)≥0 and ∣g(x)∣=−g(x) where g(x)≤0.
Step 1 — Remove the modulus.
For 4≤x≤5 we have x−5≤0, so the modulus changes the sign.
∣x−5∣=5−x
Step 2 — Integrate.
An antiderivative of 5−x is 5x−2x2.
∫45(5−x)dx=[5x−2x2]45
∫45(5−x)dx=(25−225)−(20−8)
∫45(5−x)dx=225−12
∫45(5−x)dx=21
Step 3 — Check with a picture.
Between the lines x=4 and x=5, the graph of y=5−x cuts off a right triangle with base 1 and height 1, whose area is 21. This agrees with Step 2.
Therefore, ∫45∣x−5∣dx=21.