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

Hint:

Knowing that $\sin2x=2\sin x\cos x$ and $\sin^2x+\cos^2x=1$. The integral can be expressed as

\begin{equation} I=\int_0^{\pi/2}\frac{\cos x}{1+(\sin x-\cos x)^2}\ dx \end{equation}

then use substitution $x\mapsto\frac{\pi}{2}-x$, we have

\begin{equation} I=\int_0^{\pi/2}\frac{\sin x}{1+(\sin x-\cos x)^2}\ dx \end{equation}

Add the two $I$'s and let $u=\sin x-\cos x$.


I write simplify. $$ =\int\frac{d\sin(x-\pi /4)}{ 2 \sin^2(x-\pi/4) +1 } $$ Before it, use $ u=\pi/2 $ to get numerator $\sin x $ and $\cos x$ is same value.


Here is a step by step approach. :)

$$\begin{align} I &= \int_0^{\pi/2}\frac{\cos{x}}{2-\sin{2x}}dx \\ &= \int_0^{\pi/2}\frac{\cos{x}}{2-2 \sin x \cos x}dx \\ &= \int_0^{\pi/2}\frac{\cos{x}}{1+\cos^2 x -2 \sin x \cos x + \sin^2 x}dx \\ &= \int_0^{\pi/2}\frac{\cos{x}}{1+(\cos x - \sin x)^2}dx \\ &= \frac{1}{2} \left( \int_0^{\pi/2}\frac{\cos{x}}{1+(\cos x - \sin x)^2}dx + \int_0^{\pi/2}\frac{\sin{x}}{1+(\cos x - \sin x)^2}dx \right) \\ &= \frac{1}{2} \int_0^{\pi/2}\frac{\cos{x} + \sin{x}}{1+(\cos x - \sin x)^2}dx \\ &= -\frac{1}{2} \int_0^{\pi/2}\frac{d(\cos{x} - \sin{x})}{1+(\cos x - \sin x)^2}\\ &= -\frac{1}{2}\arctan(\cos{x}-\sin{x})|_{0}^{\frac{\pi}{2}} \\ &= \frac{\pi}{4} \end{align}$$