<s>[INST] Evaluate $\int \frac{1}{\sin x+\sec x}\,dx $ Evaluate $$\int \frac{1}{\sin x+\sec x}\,dx $$
Expressing $\sin x$ and $\cos x$ in terms of $\tan\frac{x}{2}$ i.e. putting $\sin x=\dfrac{2t}{1+t^2}$, $\cos x=\dfrac{1-t^2}{1+t^2}$ and hence $dx=\dfrac{2\,dt}{1+t^2}$
$$\int \frac{1-t^2}{1+t-t^3}\,dt $$
 [/INST] Probably a cleaner expression:
$$I=\int\dfrac{\cos x}{\sin x\cos x+1}dx =\int\dfrac{2\cos x}{2+2\sin x\cos x}dx$$
Now write $2\cos x=\cos x+\sin x+(\cos x-\sin x),$
As $\int(\cos x\pm\sin x)dx=\sin x\mp\cos x$ 
and $(\sin x\mp\cos x)^2=1\mp2\sin x\cos x,$
$$I=\int\dfrac{(\cos x+\sin x)}{3-(\sin x-\cos x)^2}dx+\int\dfrac{(\cos x-\sin x)}{1+(\sin x+\cos x)^2}dx$$
</s>