I want to integrate the product $x|x|$ with respect to $x$. That is, compute $\int x|x| dx$. I want to make sure I am doing this correctly.
So, $|x| = -x$ when $x < 0$ and $|x| = x$ when $x > 0$ and vanishes for $x = 0$. That means I should write $\int_{-\infty}^{0}-x\cdot x dx + \int_0^{\infty} x\cdot x dx = -\frac{x^3}{3} \mid_{-\infty}^{0} + \frac{x^3}{3}\mid_{0}^{\infty}$ but this isn't really making sense as the left term is zero and the right term goes to $\infty$.
$$I:=\int x\lvert x\rvert\,\mathrm{d}x=\int x^2 \frac{x}{\lvert x\rvert}\,\mathrm{d}x$$ $u=\lvert x\rvert,\mathrm{d}x=\frac{\lvert x\rvert}{x}\,\mathrm{d}u$ $$I=\int u^2 \,\mathrm{d}u=\frac{u^3}{3}+C=\frac{\lvert x\rvert x^2}{3}+C$$