# What method I should use to solve this differantial equation?

I had this during an exam

$$(x+2) \sin(y) dx + x \cos(y)dy = 0$$

and it was not given what method I am supposed to use in order to solve this differentiation equation. I have tried to solve it with exact equation, integrating factors, Laplace, separable but I was unable to solve it. What method should I have used to solve it?

Divide both sides by $x$ and $\sin(y)$ to find

$$\frac{x+2}{x} dx + \frac{\cos(y)}{\sin(y)} dy = 0$$

Now subtract one to the other side

$$\frac{x+2}{x} dx = - \frac{\cos(y)}{\sin(y)} dy$$

Now integrate both sides

$$x + 2 \ln(x) + C = -\int \frac{\cos(y)}{\sin(y)}= dy$$

For the left hand side set $u = \sin(y) \rightarrow du = \cos(y) dy$

Then:

$$x + 2 \ln(x) + C = - \int \frac{1}{u} du = - \ln(\sin(y))$$

Thus:

$$\sin(y)= Ce^{-2\ln(x) - x} = Cx^{-2}e^{-x}$$

$$y = \sin^{-1}(Cxe^{-2}e^{-x})$$

• I found $$sin(y) = Ce^{-2\ln(x) - x} = Cx^{-2}e^{-x}$$ – ilhan Jun 17 '14 at 20:06
• Also, this one is different too wolframalpha.com/input/… – ilhan Jun 17 '14 at 20:10
• You are right! I fixed the error – frogeyedpeas Jun 17 '14 at 22:07

$$(x+2)\sin(y) dx + x\cos(y)dy = 0 \iff (x+2) \sin y \,dx = -x\cos y\,dy$$ $$\iff -\dfrac{x+2}{x} \,dx = \dfrac{\cos y}{\sin y} \,dy$$ $$\iff -\int \frac{x+2}{x}\,dx = \int \dfrac{\cos y}{\sin y}\,dy$$ $$\iff -\int \left(1 + \frac 2x\right)\,dx = \int \frac{\cos y}{\sin y}\,dy$$ $$\iff - x + -2\ln |x| + c = \ln|\sin y|$$

Can you take it from here?

Separation of variables: $$\frac{x+2}{x} \mathrm{d}x = -\cot y dy$$

The integral of cotangent side is $-\ln|\sin y|+C$. The rest is easy.