Finding the derivative using implicit differentiation