<s>[INST] integrate $\int_0^{\frac{\pi}{4}}\frac{dx}{2+\tan x}$ 
$$\int^{\frac{\pi}{4}}_{0}\frac{dx}{2+\tan x}$$

$v=\tan(\frac{x}{2})$
$\tan x=\frac{2v}{1-v^2}$
$dx=\frac{2\,dv}{1+v^2}$
$$\int^{\frac{\pi}{4}}_0 \frac{dx}{2+\tan x}=\int^{\frac{\pi}{8}}_0 \frac{\frac{2\,dv}{1+v^2}}{2+\frac{2v}{1-v^2}}=\int^{\frac{\pi}{8}}_0 \frac{1-v^2}{(1+v^2)(-v^2+v+1)} \, dv$$
Using partial fractions 
$$-\frac{1}{5}\int^{\frac{\pi}{8}}_0 \frac{-2v+4}{v^2+1}+\frac{1}{5}\int^{\frac{\pi}{8}}_0 \frac{-2v+1}{-v^2+v+1}=\frac{1}{5}\int^{\frac{\pi}{8}}_0 \frac{2v}{v^2+1}-\frac{1}{5}\int^{\frac{\pi}{8}}_0 \frac{4}{v^2+1}+\frac{1}{5}\int^{\frac{\pi}{8}}_0 \frac{-2v+1}{-v^2+v+1}$$
$$=\frac{1}{5}ln|v^2+1|-\frac{4}{5}\arctan(v)+\frac{1}{5}ln|-v^2+v+1|$$ from $\frac{\pi}{8}$ to $0$
$0.02-0+0.299-0+0.04-0=0.359$
But it should come out 0.32
 [/INST] I have done the sum u just look at it.

Here after step 2 I have used the method where u have to do like this
Af(x) +Bf'(x) =numerator. and here A and B are constant.
Here f(x)=denominator =2cosx +sinx
Hence f'(x) =-2sinx +cosx
So we get A = 2/5 B= 1/5
Thanks for asking such a nice question.
</s>