I need some help in differentiating piecewise functions and finding local/absolute minimum/maximum values. Problem is, I don't know how. For example,

.........-x , if x<0

f(x)={ 2x^3-15x^2+36x , if 0<x<4, or x=0, or x=4

........ 216-x , if x>4

my first inclination is to differentiate each part separately, see where the slopes change in each part, and then calculuate the min/max values using the critical points, but I am not arriving at the correct answers. =\

I can find out the critical points of the middle part pretty easily

(x= 2,x=3), but my answer key also reads that there is a local minimum point at f(0)=0

I really don't have a good idea of how f(0) could be a minimum value, unless it is because x=0 is where the first part of the fuction ends and where the second piece begins, but if I am right in that regard, why isn't x=4 also considered a critical value?

Hope my question makes sense, and so on.

...