How to find the directional derivative of the function