find dy/dx for y = cos(xy)

find dy/dx for y = cos(xy)
Answer
Explanation:
Step1: Differentiate both sides
Differentiate $y = \cos(xy)$ with respect to $x$ using the chain - rule. The derivative of the left - hand side is $\frac{dy}{dx}$, and for the right - hand side, let $u = xy$. Then $\frac{d}{dx}(\cos(xy))=-\sin(xy)\cdot\frac{d}{dx}(xy)$. $\frac{dy}{dx}=-\sin(xy)\cdot\frac{d}{dx}(xy)$
Step2: Apply product rule on $\frac{d}{dx}(xy)$
By the product rule $\frac{d}{dx}(uv)=u\frac{dv}{dx}+v\frac{du}{dx}$, where $u = x$ and $v = y$. So $\frac{d}{dx}(xy)=x\frac{dy}{dx}+y\cdot1$. $\frac{dy}{dx}=-\sin(xy)\left(x\frac{dy}{dx}+y\right)$
Step3: Expand the right - hand side
Expand $-\sin(xy)\left(x\frac{dy}{dx}+y\right)$ to get $-x\sin(xy)\frac{dy}{dx}-y\sin(xy)$. $\frac{dy}{dx}=-x\sin(xy)\frac{dy}{dx}-y\sin(xy)$
Step4: Isolate $\frac{dy}{dx}$ terms
Move all terms with $\frac{dy}{dx}$ to one side: $\frac{dy}{dx}+x\sin(xy)\frac{dy}{dx}=-y\sin(xy)$ Factor out $\frac{dy}{dx}$ on the left - hand side: $\frac{dy}{dx}(1 + x\sin(xy))=-y\sin(xy)$
Step5: Solve for $\frac{dy}{dx}$
Divide both sides by $(1 + x\sin(xy))$ to get $\frac{dy}{dx}$. $\frac{dy}{dx}=\frac{-y\sin(xy)}{1 + x\sin(xy)}$
Answer:
$\frac{dy}{dx}=\frac{-y\sin(xy)}{1 + x\sin(xy)}$