as a genral solution you can sovle all problems like yours with this approach:
first sort it as:
then use this formula to differntiate:
it means when you are differntiatig a respect to x then y assumed as constant and in reverse; be sure before differniation that all statements of the equation should be sored on one side and other side should be only Zero(0).