Hint or starting point:
Nothing immediate jumps out to me when I see the integral
$$\int \frac{\cos \theta}{\sin \theta + \cos\theta} d\theta$$
However, when integrating rational function of trig functions, we can always use the Weierstrass substitution.
So, let $t = \tan \left(\frac{\theta}{2}\right), dt = \frac{1}{2}\sec^2\left(\frac{\theta}{2}\right) \ dx.$ With the Weierstrass sub, we have that: $$\sin \theta = \frac{2t}{1+t^2}, \cos\theta = \frac{1-t^2}{1+t^2}, d\theta = \frac{2 \ dt}{1+t^2}$$
This allows us to rewrite our integral as:
$$\int\frac{2(1-t^2) \ dt}{(t^2+1)^2 \left(\frac{2t}{t^2+1} + \frac{1-t^2}{t^2+1}\right) }$$
Clean up the denominator to get:
$$2\int\frac{(t^2-1) \ dt}{t^4 - 2t^3 - 2t - 1}$$
From here, looks like partial fractions will do it. Note the denominator factors as
$$(t^2+1)(t^2-2t-1)$$
Second thought Write the original integral as $$\int \frac{1}{1+\cot \theta} d\theta$$ Let $u = \cot \theta, du = -(1+u^2) d\theta$. Then we have:
$$-\int\frac{1}{(1+u^2)(u^2+1)} \ du $$
This is a nicer partial fraction decomposition to work with and is less work in getting there compared to my original thinking.