Compute $\int \frac{\sin(x)}{\sin(x)+\cos(x)}\mathrm dx$

Let $I:=\int\frac{\cos x}{\cos x+\sin x}dx$ and $J:=\int\frac{\sin x}{\cos x+\sin x}dx$. Then $I+J=x + C$, and $$I-J=\int\frac{\cos x-\sin x}{\cos x+\sin x}dx=\int\frac{u'(x)}{u(x)}dx,$$ where $u(x)=\cos x+\sin x$. Now we can conclude.


Hint: $\sqrt{2}\sin(x+\pi/4)=\sin x +\cos x$, then substitute $x+\pi/4=z$


You can do this without thinking: use the Weierstrass substitution to reduce the integral to a rational function, and integrate that as usual.