Where is the function #h(x)=abs(x-1)+abs(x+2)# differentiable?

1 Answer
Aug 18, 2017

It is differentiable everywhere except the zeros of the expressions in absolute value. Everywhere except #1# and #-2#

Explanation:

The short answer statement is correct. Functions incolving terms that have absolute value tend to be non-differentiable at the zeros of the expression in absolute value. This is not true if the expression as always non-negative or always non-positive.

But let's analyze this function.

#abs(x-1) = {(x-1," ",1 <= x),(-x+1," ",x < 1):}#

#abs(x+2) = {(x+2," ",-2 <= x),(-x-2," ",x< -2):}#

We cut the number line at #-2# and at #1# and look at #h(x)# on each of the resulting 3 intervals, #(-oo,-2)#, #(-2,1)#, and #(1,oo)#.

#x <= -2# #rArr# #x <= 1# as well, so

#h(x) = (-x+1)+(-x-2) = -2x-1#

#-2 < x < 1#

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

#x > 1# #rArr# #x > -2#, so

#h(x) = (x-1)+(x+2) = 2x+1#.

Combining, we have

#h(x) - {(-2x-1," "," "x <= -2),(" "" "3," ",-2 < x < 1),(" "2x+1," "," "1 <= x):}#

Differentiating, we get

#h'(x) - {(-2," "," "x < -2),(" "0," ",-2 < x < 1),(" "2," "," "1 < x):}#

Because the derivatives do not agree at the joints (the left and right derivatives are distinct), the function is not differentiable at the joints.

Although we did not use it, here is the graph of #h#.

graph{abs(x-1)+abs(x+2) [-11.235, 11.265, -1.74, 9.51]}