Indefinite integral with trig components The following integral has me stumped. Any help on how to go about solving it would be great.
$\int\frac{\cos\theta}{\sin2\theta - 1}d\theta$

If you set $\theta=\frac{\pi}{4}-x$, the integral becomes
$$
\int \frac{\cos(\frac{\pi}{4}-x)}{\sin(\frac{\pi}{2}-2x)-1}\,(-dx)
= -\int \frac{\frac{1}{\sqrt2}\cos x + \frac{1}{\sqrt2}\sin x}{\cos 2x -1}\,dx
= \frac{-1}{\sqrt2} \int\frac{\cos x+\sin x}{(1-2\sin^2 x)-1} \, dx
= \frac{1}{2\sqrt2}\left( \int \frac{\cos x \, dx}{\sin^2 x} + \int\frac{\sin x \, dx}{1-\cos^2 x} \right) = \ldots
$$
Maybe you can take it from there?
