TITLE: Integrate $\int \frac {\sin (2x)}{(\sin x+\cos x)^2}\,dx$
QUESTION [7 upvotes]: 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$$

REPLY [2 votes]: 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$