# Integral $\int \frac{\mathrm{d}x}{\sin x+\sec x}$

In the following integral

$$\int \frac{\mathrm{d}x}{\sin x+\sec x}$$

My attempt is

I first multiplied and divided by $\cos^2x$

And then substitued $\tan x = t$

But after that got stuck .

$\displaystyle I = \int\frac{1}{\sin x+\sec x}dx = \int\frac{\cos x}{\sin x\cos x+1}dx = \int \frac{(\cos x+\sin x)+(\cos x-\sin x)}{\sin 2x +2}dx$
$\displaystyle =\int\frac{\cos x+\sin x}{\sin 2x+2}dx+\int\frac{\cos x-\sin x}{\sin 2x+2}dx = I_{1}+I_{2}$
for $\displaystyle I_{1} = \int\frac{\cos x+\sin x}{3-(\sin x-\cos x)^2}dx,$ put $(\sin x-\cos x) = t$ then $(\cos x+\sin x)dx = dt$
for $\displaystyle I_{2} = \int\frac{\cos x-\sin x}{(\sin x+\cos x)^2+1}dx,$ put $(\sin x+\cos x) = u$ then $(\cos x-\sin x)dx = du$
So $\displaystyle I = \int\frac{1}{3-t^2}dt +\int\frac{1}{1+u^2}du$