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:
$$\cos x=\frac{1-t^2}{1+t^2} ,\sin x=\frac{2t}{1+t^2},\ dx=\frac{2dt}{1+t^2}$$
AND therefore:
$$=\int\dfrac{2(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!
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$