<s>[INST] Whats wrong in this approach to evaluate $\int_{0}^{\frac{\pi}{2}} \frac{\sin x\cos xdx}{\sin x+\cos x}$ Whats wrong in this approach to evaluate $$I=\int_{0}^{\frac{\pi}{2}} \frac{\sin x\cos xdx}{\sin x+\cos x}$$
Since $f\left(\frac{\pi}{2}-x\right)=f(x)$ we have
$$I=2\int_{0}^{\frac{\pi}{4}} \frac{\sin x\cos xdx}{\sin x+\cos x}$$
Now applying $\int_{a}^{b}f(x)dx=\int_{a}^{b}f(a+b-x)dx$ we get
$$I=\sqrt{2}\int_{0}^{\frac{\pi}{4}}\frac{(\sin x-\cos x)(\sin x+\cos x)dx }{\sin x-\cos x+\cos x+\sin x}$$ $\implies$
$$I=\sqrt{2}\int_{0}^{\frac{\pi}{4}}\frac{2\sin^2 x-1}{\sin x}$$
But second integral viz $$\int_{0}^{\frac{\pi}{4}} \csc xdx $$ is not defined when we substitute lower limit?
 [/INST] We have that


*

*$\sin(\pi/4-x)=\frac{\sqrt 2}2(\cos x-\sin x)$

*$\cos(\pi/4-x)=\frac{\sqrt 2}2(\cos x+\sin x)$


therefore
$$I=2\int_{0}^{\frac{\pi}{4}} \frac{\sin x\cos xdx}{\sin x+\cos x}=\sqrt{2}\int_{0}^{\frac{\pi}{4}}\frac{(\cos x-\sin x)(\cos x+ \sin x)dx }{\cos x-\sin x+\cos x+ \sin x}$$
</s>