Integrate $\int x e^{x} \sin x dx$ 
Evaluate:
$$\int x e^{x} \sin x dx$$

Have you ever come across such an integral? I have no idea how to start with the calculation.

If one may recall that $\sin(x)=\Im e^{ix}$, then
$$\int x\sin(x)e^x\ dx=\Im\int xe^{(1+i)x}\ dx$$
With a quick integration by parts, we have
$$=\Im\left(\frac1{1+i}xe^{(1+i)x}-\frac1{1+i}\int e^{(1+i)x}\ dx\right)\\=\Im\left(\frac1{1+i}xe^{(1+i)x}-\frac1{(1+i)^2}e^{(1+i)x}+C\right)\\=\frac12\left(x\sin(x)e^x-x\cos(x)e^x+\cos(x)e^x\right)$$
