Integrating the product $x|x|$

136 Views Asked by At

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$.

2

There are 2 best solutions below

3
On BEST ANSWER

$$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$$

0
On

The sign function allows us to write any real number $x$ as

$$|x| = \mathrm{sgn}(x)x.$$ We may then integrate by parts to obtain

$$\int x|x|~dx=\int \mathrm{sgn}(x)x^2~dx=|x|x^2-\int 2x|x| ~dx,$$

where $\frac{d}{dx} |x|=\mathrm{sgn}(x)$ on non-zero sets. This yields

$$\int x|x| ~dx = \frac{|x|x^2}{3}+C~.$$