Patrick B. answered 05/11/19
Math and computer tutor/teacher
It is not differentiable at x=1 and x=2
IN general, y = |x| = sqrt(x^2) and is not differentiable at x=0
y = |x-k| = sqrt( (x-k)^2) and is not differentiable at x=k
So f(x) = sqrt( (x-1)^2) + sqrt( (x-2)^2)
= sqrt( u^2) + sqrt( V^2) where U = x-1 and V = x-2.
Then dU = dx and dV = dx
= (U^2)^(1/2) + (V^2)^(1/2)
The derivative is:
(1/2)(U^2)^(-1/2)*2U*dU + (1/2)(V^2)^(-1/2)(2V)*dV =
U/ sqrt(U^2) dU + V/sqrt(V^2) dV =
{ (x-1)/|x-1| + (x-2)/|x-2| } dx