<s>[INST] Linear differential equations, integrating factor Solve the following differential equation:
$$ dr+(2r \cot\theta+\sin 2\theta)d\theta=0$$
I have tried like this:
$$ \frac{dr}{d\theta}+2r\cot\theta=-\sin{2\theta}$$
\begin{align}
I.F. &=e^{\int{2\cot\theta d\theta}}\\
& =e^{-2\log\sin\theta}\\
& =\frac 1{\sin^2\theta}\\
\end{align}
$$\therefore\frac r{\sin^2\theta}=-\int\frac{\sin 2\theta d\theta}{\sin^2\theta}\\
\implies \frac r{\sin^2\theta}=-2\int{\cot\theta d\theta}\\
\implies \frac r{\sin^2\theta}=2\log\sin\theta+c $$
But in my book the answer is:
$$2r{\sin^2\theta}+{\sin^4\theta}=c$$
Please check out which is correct..
 [/INST] $$dr+(2r \cot\theta+\sin 2\theta)d\theta=0$$
$$\sin \theta dr+(2r \cos\theta+2\sin^2 \theta\cos\theta )d\theta=0$$
Multiply by $2\sin \theta$:
$$2\sin^2 \theta dr+(4r \cos\theta\sin \theta+4\sin^3 \theta\cos\theta )d\theta=0$$
$$2\sin^2 \theta dr+2r d\sin^2 \theta+ d\sin^4 \theta=0$$
$$2(\sin^2 \theta dr+r d\sin^2 \theta)+ d\sin^4 \theta=0$$
$$2 dr\sin^2 \theta+ d\sin^4 \theta=0$$
Integrate:
$$2 r\sin^2 \theta+ \sin^4 \theta=C$$
</s>