Make the substitution u = cos θ
Then the integrand becomes du/(2u-u2)
Then partial fractions (du/2)[(1/u)+(1/(2-u)]
This integrates as (1/2) ln u - (1/2)ln(2-u)
You can do the back substitution...but I do not agree with the answer as you have written it
This problem bothered me and I have done some more work on it. There are actually 2 solutions:
F(x)=.5ln[(cos x)/(cos x-2)] and G(x)=.5ln[(cos x)/(2-cos x)].
F'(x)=G'(x)=the given function to be integrated BUT F and G do NOT differ by a constant.
For odd multiples of π/2, both F and G are zero.
Between successive odd multiples of π/2 one and only one of F or G is defined.
Therefore the integral is only defined between successive odd multiples of π/2 and whether F or G is the
correct function to be used depends on the sign of the integrand. I know this is a long time after your queston was submitted but I do hope it helps our understanding.