<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] You messed up with your multiplication. Multiplying the integral factor to both sides should yield:
$$\dfrac{d}{d\theta}\left(\dfrac{r}{\sin^2\theta}\right)=\left(\dfrac{1}{\sin\theta}\right)^2\dfrac{dr}{d\theta}+2\cot\theta\left(\dfrac{1}{\sin\theta}\right)^2 r=-\sin2\theta\left(\dfrac{1}{\sin\theta}\right)^2=-2\cot\theta$$
and so
$$\dfrac{r}{\sin^2\theta}=-2\int\cot\theta d\theta=-2\log(\sin\theta)+C$$
</s>