Cannot understand an Integral $$\displaystyle \int _{ \pi /6 }^{ \pi /3 }{ \frac { dx }{ \sec x+\csc x } } $$
I had to solve the integral and get it in this form. 
My attempt:
$$\int _{ \pi /6 }^{ \pi /3 }{ \frac { dx }{ \sec x+\csc x } } $$
$$=\int _{\frac{\pi}{6}}^{ \frac{\pi}{3}} \dfrac{\sin x \cos x }{ \sin x+\cos x }dx $$ 
Substituting $t=\tan(\frac{x}{2})$,
$$\int_{\tan(\frac{\pi}{12})}^{\tan(\frac{\pi}{6})} \dfrac{2t}{1+t^2}\times\dfrac{1-t^2}{1+t^2}\times\dfrac{2}{1+t^2}dt$$
$$2\int_{2-\sqrt{3}}^{\frac{1}{\sqrt{3}}} \dfrac{2t(1-t^2)}{(1+t^2)^3}dt$$
Substituting $u=1+t^2$, $2t dt=du$, $1-t^2 = 2-u$
$$2\int_{8-4\sqrt{3}}^\frac{4}{3} \dfrac{(2-u)}{u^3}du$$
$$\displaystyle 4\int_{8-4\sqrt{3}}^\frac{4}{3} \dfrac{du}{u^3} \displaystyle -2\int_{8-4\sqrt{3}}^\frac{4}{3} \dfrac{du}{u^2}$$ Could somebody please tell me where I have gone wrong? Also could someone please tell me how to change the limits of the definite integral throughout? 
 A: Here is an alternate method you could use:
Multiply $\displaystyle\int\frac{\sin x\cos x}{\sin x+\cos x}dx$ on the top and bottom by $\cos x-\sin x$ to get 
$\hspace{.6 in}\displaystyle\int\frac{\cos^2x\sin x}{2\cos^2 x-1}dx-\int\frac{\sin^2x\cos x}{1-2\sin^2 x}dx$.
Now substitute $u=\cos x$ in the first integral and $u=\sin x$ in the second integral to get
$\displaystyle\int\frac{u^2}{1-2u^2}du=\frac{1}{2}\int\big(-1+\frac{1}{1-2u^2}\big)du=\frac{1}{2}\bigg[-u+\frac{\sqrt{2}}{4}\ln\bigg|\frac{1+\sqrt{2}u}{1-\sqrt{2}u}\bigg|\bigg]+C$
using partial fractions.
Now you can let $u=\cos x$ in the first term and $u=\sin x$ in the second to get
$\displaystyle\frac{1}{2}\bigg[-u+\frac{\sqrt{2}}{4}\ln\bigg|\frac{1+\sqrt{2}u}{1-\sqrt{2}u}\bigg|\bigg]_{\frac{\sqrt{3}}{2}}^{\frac{1}{2}}-\frac{1}{2}\bigg[-u+\frac{\sqrt{2}}{4}\ln\bigg|\frac{1+\sqrt{2}u}{1-\sqrt{2}u}\bigg|\bigg]_{\frac{1}{2}}^{\frac{\sqrt{3}}{2}}$

Notice that substituting $t=\tan\frac{x}{2}$ gives
$\displaystyle\int{\frac{\sin x\cos x}{\sin x+ \cos x} dx=\int\frac{\frac{2t}{1+t^2}\cdot\frac{1-t^2}{1+t^2}}{\frac{2t}{1+t^2}+\frac{1-t^2}{1+t^2}}}\cdot\frac{2}{1+t^2}dt=\int\frac{4t(1-t^2)}{(1+t^2)^2(1+2t-t^2)}dt$,
and now you can use partial fractions to continue.
A: In general if you have an integral
$$\int_a^b f(x)dx$$
Upon making the substitution $t=g(x)$ the limits of the integral become $g(a)$ and $g(b)$. In your case you made the substitution $t=\tan \frac x2$ so the lower limit becomes $\tan \frac{\pi}{12}$ and the upper limit becomes $\tan \frac{\pi}{6}$. Thus the integral becomes
$$\int_{\tan\frac{\pi}{12}}^{\tan\frac{\pi}{6}} \dfrac{2t}{1+t^2}\times\dfrac{1-t^2}{1+t^2}\times\dfrac{2}{1+t^2}dt$$
And continue as you have otherwise.
A: To evaluate the integral use the identity $$(\sin{x}+\cos{x})^2=1+2{\sin{x}}{\cos{x}}$$
And substitute $\sin(x)\cos(x) = u$
A: Integrate directly as follows
\begin{align}
\int _{ \pi /6 }^{ \pi /3 }{ \frac { dx }{ \sec x+\csc x } } 
& =\frac12 \int _{ \pi /6 }^{ \pi /3 } \frac{(\sin x +\cos x)^2-1 }{ \sin x+\cos x }dx \\
&= \frac{1}2\int _{ \pi /6 }^{ \pi /3 } \left(\sqrt2\cos(\frac\pi4-x)
-\frac1{\sqrt2\cos(\frac\pi4-x)}\right)dx\\
&= \frac12\left[{\sqrt2}\sin(\frac\pi4-x)dx
-\frac1{\sqrt2} \ln \cot(\frac\pi8-\frac x2)\right]_{\pi/6}^{\pi/3}\\
&= \frac{\sqrt3-1}2-\frac1{2\sqrt2}\ln \frac{\cot\frac{5\pi}{24}}{\cot\frac{7\pi}{24}}
\end{align}
