What is the maximum and minimum of #abs(x)+abs(x-1)+abs(x-2)# ?

1 Answer
Nov 24, 2017

This expression has no maximum value. It attains a minimum value #2#.

Explanation:

Note that each of the functions, #abs(x)#, #abs(x-1)# and #abs(x-2)# is V-shaped, with a minimum where the expression inside the #abs(...)# is zero.

Hence, the minimum value of the sum will occur when #x=1#:

#abs(color(blue)(1)) + abs(color(blue)(1)-1) + abs(color(blue)(1)-2) = abs(1)+abs(0)+abs(-1) = 1+0+1 = 2#

When #x >=2# we have:

#abs(x) + abs(x-1) + abs(x-2) = x+(x-1)+(x-2) = 3x-3#

which increases without upper bound as #x# increases.

graph{abs(x)+abs(x-1)+abs(x-2) [-9.24, 10.76, -2.74, 7.26]}