Consider the following first order, linear differential equation
$$\frac{dr}{d\theta} + r\tan(\theta) = \sec(\theta)$$
My question is with regards to the integrating factor $\mu(\theta)$. By definition of the integrating factor and evaluating the integral, we have
$$ \begin{align*} \mu(\theta) &= \mathrm{exp}\bigg[\int \tan(\theta) \, d\theta \bigg] \\\\ &= \mathrm{exp}\big[\ln|\sec(\theta)|\big]\\\\ &= |\sec(\theta)| \end{align*} $$
From this point forward do we have to consider the two cases for $|\sec(\theta)|$, one where it's positive and the other when it is negative when solving differential equation? Thanks!
No, that is not necessary, you can always use $\mu(x)=\sec(x)$ between the poles $k\pi$ of the secant function which are singularities of the ODE. The maximal interval of any solution has the form $((k-\frac12)\pi,(k+\frac12)\pi)$.
Indeed $$ \frac{d}{dθ}\frac{r(θ)}{\cosθ}=\frac{r'\cosθ+r\sinθ}{\cos^2θ}=\frac1{\cos^2θ}. $$