TITLE: Trignometric integral : $\int \frac{dx}{\sin x + \sec x}$
QUESTION [8 upvotes]: The integral I am trying to compute is : 
$$\int \dfrac{dx}{\sin x + \sec x}$$
I have tried manipulating trignometric functions and it took me nowhere. Then finally I tried putting $\tan\dfrac{x}{2} = t$, and subsequently:
$$=\int\dfrac{1-t^2}{(1+t^2)^2-2t(t^2-1)}dt$$
I cannot see how to approach after this, I know we have to factor out two quadratics, but cant see how to.
Also, if there was another method instead of this substitution, please hint on that too! Thanks!

REPLY [6 votes]: Another way:
$$\dfrac{2\cos x}{2+2\cos x\sin x}=\dfrac{\cos x-\sin x}{2+2\cos x\sin x}+\dfrac{\cos x+\sin x}{2+2\cos x\sin x}$$
As $\displaystyle\int(\cos x-\sin x)dx=\cos x+\sin x,$ write $2\cos x\sin x=(\cos x+\sin x)^2-1$ and set $\cos x+\sin x=u$
and as $\displaystyle\int(\cos x+\sin x)dx=\sin x-\cos x,$ write $2\cos x\sin x=1-(\sin x-\cos x)^2$ and set $\sin x-\cos x=v$