Derivative of an implicit trigonometric function I was doing my homework which included finding the derivative of implicit function. One of them was
$$3\sin(xy)+ 4\cos(xy) = 5$$
On first attempt I did this as follows
$$\frac{d}{dx}(3\sin(xy)+ 4\cos(xy)) = \frac{d}{dx}(5)$$
$$[3\cos(xy)-4\sin(xy)][y+x\frac{dy}{dx}] = 0$$
$$\frac{dy}{dx}= \frac{-y}{x}$$
It matched the answer and I was happy. I don't know why but I wrote the original expression as this
$$\frac{3}{5}\sin(xy)+ \frac{4}{5}\cos(xy) = 1$$
$$\cos(\alpha)\sin(xy)+ \sin(\alpha)\cos(xy) = 1$$
$$\sin(xy +\alpha)=1 \quad \quad \textrm{where} \quad\alpha = \arccos(\frac{3}{5})$$
Again from step 2 of finding derivative,
$$[3\cos(xy)-4\sin(xy)][y+x\frac{dy}{dx}] = 0$$
$$[\frac{3}{5}\cos(xy)-\frac{4}{5}\sin(xy)][y+x\frac{dy}{dx}] = 0$$
$$[\cos(\alpha)\cos(xy)-\sin(\alpha)\sin(xy)][y+x\frac{dy}{dx}] = 0$$
$$[\cos(xy +\alpha)][y+x\frac{dy}{dx}] = 0$$
Since $\sin(xy +\alpha) =1 \implies \cos(xy+\alpha)=0$ what did in finding the derivate while going from step 2 to 3 was diving by zero which is not valid. So I cannot actually conclude that the derivative is $\frac{-y}{x}$. But then why is the answer right(wolfram alpha says this too)? Is there any other way of finding this derivate?
Thank you in advance.

You didn't divide by zero. The reasoning is really "$AB = 0$ implies either $A=0$ or $B=0$". Then you can consider the cases $A=0$ and $A\neq 0$ separately. If $A\neq 0$, then it must be that $B=0$ (because then you can divide by the nonzero $A$) and you go on from there.
