Showing the following differential equation is exact

I'm asked to show that the attached differential equation is exact: $$\left(\frac{x}{\sin y}+2 \right)dx=\frac{(x^2+1)\cos y}{1-\cos{2y}}dy$$ I know I have to show that $N_x=M_y$. In this particular equation, $M = \frac{x}{\sin y} + 2$ and N = $\frac{((x^2+1)\cos y)}{(1-\cos2y)}$, and all I could get to is $M_y = -\frac{x\cos y}{\sin^2 y}$ and $N_x = \frac{2x\cos y}{1-\cos2y}$. What did I do wrong? Or maybe there is a different path altogether?

We are trying to determine if:

$$\underbrace{\left(\frac{x}{\sin(y)}+2\right)}_{P(x,y)}\:\mathrm{d}x-\underbrace{\frac{(x^{2}+1)\cos(y)}{1-\cos(2y)}}_{Q(x,y)}\:\mathrm{d}y=0$$

Is an exact ordinary differential equation; we note that if this is an exact differential equation, then we have that there exists a function $f(x,y)$ such that $P(x,y)=\frac{\partial f}{\partial x}$ and $Q(x,y)=\frac{\partial f}{\partial y}$, we therefore have (using the identity $\frac{\partial^{2} f}{\partial x\partial y}=\frac{\partial^{2} f}{\partial y\partial x}$) that:

$$\frac{\partial P}{\partial y}=\frac{\partial Q}{\partial x}$$

Must be true if it is an exact ODE. computing $\frac{\partial P}{\partial y}$, we get:

$$\frac{\partial P}{\partial y}=-x\cot(y)\csc(y)$$

And computing $\frac{\partial Q}{\partial x}$, we have:

$$\frac{\partial Q}{\partial x}=-\frac{2x \cos(y)}{1-\cos(2y)}=-x\cot(y)\csc(y)$$

Therefore it is an exact ODE.

• Thank you very much. However, could you please explain the derivations you did? I'm not sure I understood them. – user159527 Aug 18 '14 at 15:02