Evaluate $ \int_{\pi/4}^{\pi/2} \frac{2\sin x+\cos x}{\sin x+2\cos x}\,dx$ 
Evaluate 
  $$ \int_{\pi/4}^{\pi/2} \frac{2\sin x+\cos x}{\sin x+2\cos x}\,dx,$$

My attempt : $u=\tan\frac{x}{2} \rightarrow x=2\arctan(u) \rightarrow \frac{2}{1+u^2}du=dx$
$$\sin x= \frac{2\tan\frac{x}{2}}{1+\tan^2\frac{x}{2}}=\frac{2u}{1+u^2}$$
$$\cos x= \frac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}= \frac{1-u^2}{1+u^2}$$
I was looking to see if this is the right way to go and also i am not sure how to evaluate the boundaries . Could you help me out ?
 A: Just convert into exponentials
$$\sin(x) = \frac{e^{ix} - e^{-ix}}{2i}$$
$$\cos(x) = \frac{e^{ix} + e^{-ix}}{2}$$
The extrema won't change.
Substitute, arrange and you get
$$\int_{\pi/4}^{\pi/2} \frac{e^{ix}(2 + i) + e^{-ix(i-2)}}{e^{ix}(2i + 1) + e^{-ix}(2i - 1)}\ \text{d}x$$
You can split the integral in two pieces, then collect $e^{ix}$ up and down in the first piece and $e^{-ix}$ up and down in the second piece. This leads you to
$$\int_{\pi/4}^{\pi/2} \frac{2+i}{2i + 1 + e^{-2ix}(2i-1)}\ \text{d}x + \int_{\pi/4}^{\pi/2} \frac{i-2}{2i - 1 + e^{2ix}(2i+1)}\ \text{d}x$$
The integrals are rather easy for it's just a denominator exponential integral (you can always call with other letters the complex constants).
Hence we have:
$$I_1 = \left(\frac{1}{10}-\frac{3 i}{40}\right) \left(\pi +2 i \log \left(\frac{9}{2}\right)\right)$$
$$I_2 = \left(\frac{1}{10}+\frac{3 i}{40}\right) \left(\pi -2 i \log \left(\frac{9}{2}\right)\right)$$
Eventually
$$I = I_1 + I_2 = \frac{1}{10} \left(2 \pi +\log \left(\frac{729}{8}\right)\right)$$
A: Hint:
$$2\sin x+\cos x=\frac{4}{5}(\sin x+2\cos x)+\frac{3}{5}(2\sin x-\cos x)$$
This makes the integral $\displaystyle \int\left(\frac{4}{5}\mathrm dx-\frac{3}{5}\mathrm d(\ln|\sin x+2\cos x|)\right)$ with the same limits. 
A: 
\begin{align} I&=\int_{\pi/4}^{\pi/2} \frac{2\sin x+\cos x}{\sin x+2\cos x}\,dx\tag{1}\label{1}.\end{align} 

\begin{align} 
I&=
\int_{\pi/4}^{\pi/2} 
\frac{2\cot x+1}{\cot x+2}\,dx
\overset{\color{blue}{t=\cot x}}
{=}
\int_0^1
 \frac{2+t}{(1+2t)(1+t^2)}
 \, dt
\tag{2}\label{2}
\\
&=
\int_0^1
\frac{2+t}{(1+2t)(1+t^2)}
\, dt
=
\int_0^1
\tfrac 65\,\frac 1{1+2t}
+\tfrac45\,\frac1{1+t^2}
-\tfrac35\,\frac {t}{1+t^2}
\, dt
\tag{3}\label{3}
\\
&=
\left(
\tfrac 65\cdot\tfrac12\,\ln(1+2t)
\right)_0^1
+
\left(
\tfrac45\cdot\arctan(t)
\right)_0^1
-
\left(
\tfrac35\cdot
\tfrac12\,\ln(1+t^2)
\right)_0^1
\\
&=
\tfrac35\,\ln(3)+\tfrac\pi5-\tfrac3{10}\,\ln(2)
\approx 1.07954175
.
\end{align}
