Mark M. answered 02/13/24
Retired math prof. Calc 1, 2 and AP Calculus tutoring experience.
Between x = -1 and x = 0, ex ≤ e0 = 1. So, ex - 1 ≤ 0. Therefore, l ex - 1 l = 1 - ex.
Between x = 0 and x = 2, ex ≥ e0 = 1, So, ex - 1 ≥ 0. Therefore, l ex - 1 l = ex - 1
So, ∫(-1 to 2) l ex - 1 l dx = ∫(-1 to 0) (1 - ex)dx + ∫(0 to 2) (ex - 1)dx
= (x - ex)(-1 to 0) + (ex - x)(0 to 2) = (0 - 1) - (-1 - 1/e) + (e2 - 2) - (1 - 0) = e2 + 1/e - 3