Answer
$(\dfrac{1}{3})\ln|\dfrac{\cos \theta+2}{\cos \theta-1}|+c$
Work Step by Step
Integration by parts formula suggests that $\int p'(x) q(x)=p(x) q(x)-\int p(x) q'(x)dx$
Solve $\int \dfrac{\sin \theta d\theta}{\cos^2 \theta+\cos \theta-2}$
Plug $a=\cos \theta \implies da=-\sin \theta d\theta$
Thus, we have $\int -\dfrac{da}{a^2+a-2}=\int -\dfrac{da}{(a+2)(a-1)}$
Write the integral into partial fractions as follows: $\int -\dfrac{da}{(a+2)(a-1)}=\int [-\dfrac{1}{3(a+2)}+\dfrac{1}{3(a-1)} da]$
This implies that $\dfrac{\ln |a+2|-\ln |a-1|}{3}+c=(\dfrac{1}{3})\ln|\dfrac{a+2}{a-1}|+c$
Hence, $(\dfrac{1}{3})\ln|\dfrac{a+2}{a-1}|+c=(\dfrac{1}{3})\ln|\dfrac{\cos \theta+2}{\cos \theta-1}|+c$