How to tell if a piecewise function is differentiable.