<s>[INST] Compute $\int_0^{\pi/2}\frac{\cos{x}}{2-\sin{2x}}dx$ How can I evaluate the following integral?

$$I=\int_0^{\pi/2}\frac{\cos{x}}{2-\sin{2x}}dx$$  


I tried it with Wolfram Alpha, it gave me a numerical solution: $0.785398$.
Although I immediately know that it is equal to $\pi /4$, I fail to obtain the answer with pen and paper.
I tried to use substitution $u=\tan{x}$, but I failed because the upper limit of the integral is $\pi/2$ and $\tan{\pi/2}$ is undefined.
So how are we going to evaluate this integral? Thanks.
 [/INST] There are 5 wonderful solutions already. I want to share with you one more alternative which is long but hopefully interesting.
Using $\sin 2x=2\sin x\cos x$ and multiplying both denominator and numerator by $1-\sin x \cos x$ rewrites$$
I=\frac{1}{2} \int_{0}^{\frac{\pi}{2}} \frac{\cos x+\sin x \cos ^2x}{1-\sin ^{2} x \cos ^{2} x} d x
$$
Splitting the numerator into 2 parts and letting respectively $\sin x \mapsto x$ and $\cos x\mapsto x $ yields
$$
\begin{array}{l} \displaystyle    I=\frac{1}{2} \int_{0}^{1} \frac{1+x^{2}}{x^{4}-x^{2}+1} d x \\
\displaystyle \quad =\frac{1}{2} \int_{0}^{1} \frac{\frac{1}{x^{2}}+1}{x^{2}+\frac{1}{x^{2}}-1} d x \\
\displaystyle \quad =\frac{1}{2} \int_{0}^{1} \frac{d\left(x-\frac{1}{x}\right)}{\left(x-\frac{1}{x}\right)^{2}+1} \\
\displaystyle \quad =\frac{1}{2}\left[\tan ^{-1}\left(x-\frac{1}{x}\right)\right]_{0}^{1} \\
\displaystyle \quad =\frac{1}{2}\left[0-\left(-\frac{\pi}{2}\right)\right] \\
\displaystyle \quad =\frac{\pi}{4}
\end{array}
$$
</s>