Finding trigonometric integral $$\int\frac1{\sec x+\csc x} \, dx =\text{ ?}$$ can anyone help me for solving this?
I cannot find anything to help. Please show me how to solve.
 A: We have $$\frac{1}{\sec x+\csc x}=\frac{\sin x \cos x}{\sin x+\cos x}=\frac{1}{2\sqrt{2}}\frac{\sin (2x)}{\cos(x-\pi/4)},$$
where we used $\sin(2x)=2\sin x \cos x$ and $\cos(x-\pi/4)=\frac{\sqrt{2}}{2}(\cos x+\sin x)$. Now changing variable, $u=x-\pi/4$, we have $du=dx$ and $\sin(2x)=\sin(2u+\frac{\pi}{2})=\cos(2u)=2\cos^2(u)-1$. The original integral becomes
$$\frac{1}{2\sqrt{2}}\int \frac{2\cos^2 u-1}{\cos(u)}du=\frac{1}{\sqrt{2}}\int\cos(u)du-\frac{1}{2\sqrt{2}}\int \sec(u)du.$$
Note that $\int \sec(u)du=\ln|\sec (u)+\tan(u)|$. Thus the integral is 
$$\frac{1}{\sqrt{2}}\sin(x-\pi/4)-\frac{1}{2\sqrt{2}}\ln|\sec(x-\pi/4)+\tan(x-\pi/4)|+C.$$
Maybe you can simplify the expression a little bit.
A: If all else fails you can use the tangent half-angle substitution:
$$u = \tan\frac x 2,$$ so $$2\arctan u = x$$ and $$\dfrac{2\,du}{1+u^2} = dx.$$  Then you have
\begin{align}
\sin x & = \sin(2\arctan u) \\[10pt]
& = 2\sin(\arctan u)\cos(\arctan u) & & \text{by the double-angle formula for sine} \\[10pt]
& = 2\cdot \frac u {\sqrt{1+u^2}} \cdot \frac 1 {\sqrt{1+u^2}} = \frac{2u}{1+u^2} & & \text{This is seen to be true by drawing the} \\
& & & \text{triangles, with opposite} = u \text{ and} \\
& & & \text{adjacent} = 1, \text{ so hypotenuse } = \sqrt{1+u^2}.
\end{align}
and similarly you get
$$
\cos x = \frac{1-u^2}{1+u^2}
$$
by using the double-angle formula for the cosine, and then again looking at those triangles.
A: Write everything in terms of $\sin$ and $\cos$, add the fractions and simplify to get $$\int \frac{\cos x \sin x}{\sin x + \cos x} \; dx.$$  Then multiply the top and bottom by $\sin x - \cos x$ and split into to fractions to get 
$$\int \frac{\sin^2 x \cos x}{\sin^2 x - \cos^2 x} \; dx - \int \frac{\cos^2 x \sin x}{\sin^2 x - \cos^2 x} \; dx.$$  In the first integral, use the Pythagorean identity to replace the $\cos^2 x$ in the denominator.  Let $u= \sin x$ and get $$\int \frac{u^2 \; du}{2u^2-1}.$$  In the second integral, make the denominator $1-2\cos^2 x$ and let $v=\cos x$ to get $$\int \frac{v^2 \; dv}{1-2v^2}.$$
These are icky but possible.
