<s>[INST] 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 ?
 [/INST] 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)$$
</s>