Differential equation $\sin \theta \frac{dr}{d \theta}+r\cos \theta =\tan \theta,0<\theta<\pi/2$ This problem has been stumping me for over an hour how can I set it up, I think I have done it wrong over and over. Solving for $r$.
 A: Hint: $$\frac{d}{d\theta}(r\sin\theta)=\frac{dr}{d\theta}\sin\theta+r\cos\theta$$
A: Note that
$\dfrac{d(r \sin \theta)}{d\theta} = \dfrac{dr}{d \theta} \sin \theta + r \cos \theta, \tag{1}$
so the equation reads
$\dfrac{d(r\sin \theta)}{d\theta} = \tan \theta = \dfrac{\sin \theta}{\cos \theta} = \dfrac{-d\ln(\cos \theta)}{d \theta}, \tag{2}$
valid for $0 < \theta < \pi/2$.  (2) in turn may be written
$\dfrac{d(r \sin \theta + \ln(\cos \theta))}{d\theta} = 0. \tag{3}$
(3) yields
$r\sin \theta + \ln(\cos \theta) = c, \tag{4}$
for some constant $c$.  (4) in turn gives $r$ as a function of $\theta$:
$r = \dfrac{c - \ln(\cos \theta)}{\sin \theta}, \tag{5}$
and if we know $r_0$ at $\theta_0$, $c$ may be found from (4)
$c = r_0 \sin \theta_0 + \ln(\cos \theta_0). \tag{6}$
Hope this helps.  Cheers,
and as always,
Fiat Lux!!!
A: First you have to note that the integral factor of the differential equations of the form $\dfrac{dy}{dx}+p(x)y=q(x)$ ,where $p(x)$ and $q(x)$ are only the functions of $x$ is given by $I_x=e^{\int p(x)dx}$ After multiplying both sides by this factor you will get a equation of the form $\dfrac{d(I_xy)}{dx}=I_xq(x)$ ,which can solve by separating variables.
$$\ sin \theta \dfrac{dr}{d \theta}+r\cos \theta =\tan \theta,0<\theta<\pi/2$$
$$\dfrac{dr}{d \theta}+r\cot \theta =\dfrac{\tan \theta}{\sin \theta}$$
The Integral factor is $I_\theta=e^{\int \cot \theta d \theta}=e^{\ln( \sin\theta)}=\sin \theta$
$$\dfrac{d(r \sin \theta)}{d \theta}=\tan \theta=\dfrac{d(\ln \sec \theta)}{d \theta}$$ Then the solution become trivial.
