How to find the derivative of cosx using limits