Integrate $\int \frac {\sin (2x)}{(\sin x+\cos x)^2}\,dx$ Integrate 
$$\int \frac {\sin (2x)}{(\sin x+\cos x)^2} \,dx$$
My Attempt:
$$=\int \frac {\sin (2x)}{(\sin x + \cos x)^2} \,dx$$
$$=\int \frac {2\sin x \cos x}{(\sin x+ \cos x)^2} \,dx$$
Dividing the numerator and denominator by $\cos^2 x$
$$=\int \frac {2\tan x}{(1+\tan x)^2} \,dx$$

$\displaystyle \int\frac{sin(2x)dx}{(sinx+cosx)^{2}}$
$sin(2x)=(sinx+cosx)^{2}-1$
$\displaystyle sinx+cosx=\sqrt{2}cos(x-\frac{\pi}{4})$
$\displaystyle y=x-\frac{\pi}{4}\Rightarrow dy=dx$
$\displaystyle \int\frac{sin(2x)dx}{(sinx+cosx)^{2}}=\int(1-\frac{1}{2cos^{2}y})dy$
$\displaystyle tan(y)=z\Rightarrow dz=\frac{dy}{cos^{2}y}$
$\displaystyle\int(1-\frac{1}{2cos^{2}y})dy=y-\frac{z}{2}+c $
$\displaystyle \int\frac{sin(2x)dx}{(sinx+cosx)^{2}}=x+\frac{1}{2}\tan{(x-\frac{\pi}{4})}+c_{1}\\\left( c_{1}=c-\frac{\pi}{4} \right)$
