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$$
 A: Note that
$$\begin{align}
\int \frac {\sin (2x)}{(\sin(x)+\cos(x))^2} dx
&=\int \frac {2\sin(x)\cos(x)}{\cos^2(x)(1+\tan(x))^2} dx\\
&=\int\frac {2\tan(x)}{(1+\tan(x))^2} dx\\
&=\int\left(1-\frac {1+\tan^2(x)}{(1+\tan(x))^2}\right) dx\\
&=x+\frac{1}{1+\tan(x)}+c.
\end{align}$$
A: $$I=\int\frac{\sin(2x)}{(\sin(x)+\cos(x))^2}dx=\int\frac{2\sin(x)\cos(x)}{\sin^2(x)+2\sin(x)\cos(x)+\cos^2(x)}dx\tag{1}$$ $$=\int\frac{2\sin(x)\cos(x)+1-1}{2\sin(x)\cos(x)+1}dx=\int dx-\int\frac{dx}{\sin(2x)+1}=x-\int\frac{1-\sin(2x)}{\cos^2(2x)}dx\tag{2}$$ $$=x-\int\sec^2(2x)dx+\int\frac{\sin(2x)}{\cos^2(2x)}dx\tag{3}$$ 
Enforce the substitution $u=\cos(2x)$ on the second integral so that $du=-2\sin(2x)dx$.
$(1):\text{Recall}\space\sin(2x)=2\sin(x)\cos(x)\space\text{and}\space(a+b)^2=a^2+2ab+b^2$ 
$(2):$ $\frac{\sin(2x)}{\sin(2x)+1}=\frac{\left(\sin(2x)+1\right)-1}{\sin(2x)+1}=\frac{\sin(2x)+1}{\sin(2x)+1}-\frac{1}{\sin(2x)+1}=1-\frac{1}{1+\sin(2x)}\cdot\frac{1-\sin(2x)}{1-\sin(2x)}$
$(3):$ For $\int\sec^2(2x)dx$, let $t=2x\implies dx=\frac{dt}{2}\implies\int \sec^2(2x)dx=\frac{1}{2}\int\sec^2(t)dt$
Then $$I=x-\int \sec^2(2x)dx-\frac{1}{2}\int\frac{du}{u^2}=\boxed{x-\frac{1}{2}\tan(2x)+\frac{1}{2}\sec(2x)+C}$$
A: From your last step,
Let, $tanx = t, \ sec^2xdx = dt \ , (1+tan^2x)dx = dt$ 
$dx = \frac{dt}{1+t^2}$
$I = \int{\frac{2tdt}{(1+t^2)(1+t)^2}}$
Applying partial fractions, 
$\frac{2t}{(1+t^2)(1+t)^2} = \frac{1}{1+t^2} - \frac{1}{(t+1)^2}$
$I = \int{\bigg[\frac{1}{1+t^2} - \frac{1}{(t+1)^2}}\bigg]dt = tan^{-1}t + \frac{1}{(t+1)} + c$
$I = x +\frac{1}{tanx+1}+c$ 
A: $\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)$
