|x| splits at 0:
for x ≥ 0: |x| = x
for x < 0: |x| = -x
So:
for x ≥ 0: |x| + x2 - 5x + 8 becomes x + x2 - 5x + 8 ---> x2 - 4x + 8
for x 0: |x| + x2 - 5x + 8 becomes -x + x2 - 5x + 8 ---> x2 - 6x + 8
Both of these are (partial) parabolas.
The vertex of y = x2 - 4x + 8 occurs at (2,4) so the minimum value is 4.
The maximum value of x2 - 4x + 8 on [0,4] occurs at x = 4 ---> y = 8.
The maximum value of x2 - 6x + 8 on [-1,0] occurs at x = -1 ---> y = 15.
Thus, the maximum value is 15.