How to integrate $|x| \cdot x$

$\begin{eqnarray} \int x|x|\,dx&=&\int x|x|\cdot\frac{x}{x}\,dx\\ &=&\int x^2\cdot\frac{|x|}{x}\,dx \end{eqnarray}$

Let $u=|x|$. Then $du=\frac{|x|}{x}\,dx$.

So

\begin{eqnarray} \int x^2\cdot\frac{|x|}{x}\,dx&=&\int u^2\,du\\ &=&\frac{u^3}{3}+c\\ &=&\frac{1}{3}x^2|x|+c \end{eqnarray}


For $x>0$, this is the integral of $x^2$ which is $\frac{x^3}{3}$. For $x<0$, is the integral of $-x^2$, which is $-\frac{x^3}{3}$. This is just $\frac{|x^3|}{3}$


$$\begin{align*} \int x|x|\,dx &= \int_c^x t|t|\,dt \\ &= \begin{cases}\begin{cases} \int_c^x t^2\, dt, & c\ge 0 \\ \int_0^x t^2\,dt - \int_c^0 t^2\,dt, & c < 0\end{cases}, & x\ge 0 \\ \begin{cases} \int_x^0 t^2\, dt - \int_0^c t^2\,dt, & c\ge 0 \\ -\int_c^x t^2\,dt, & c < 0\end{cases}, & x< 0\end{cases} \\ &= \begin{cases}\begin{cases} \frac 13(x^3-c^3), & c\ge 0 \\ \frac 13(x^3 +c^3), & c < 0\end{cases}, & x\ge 0 \\ \begin{cases} -\frac 13(x^3+c^3), & c\ge 0 \\ -\frac 13(x^3-c^3), & c < 0\end{cases}, & x< 0\end{cases} \\ &= \frac 13|x|^3 + \text{const}\end{align*}$$

Tags:

Integration