Show that
$$
\int_{-1}^1 \vert \, x\mathrm e^x \,\vert \mathrm d x =- \int_{-1}^0 x\mathrm e^x \mathrm d x +
\int_0^1 x\mathrm e^x \mathrm d x
$$
and hence evaluate the integral. Evaluate the following integrals:
(i) $\displaystyle \int_0^4 \vert\, x^3-2x^2-x+2 \,\vert \, \mathrm d x\,; $
(ii) $\displaystyle \int_{-\pi}^\pi \vert\, \sin x +\cos x \,\vert \; \mathrm d x\,. $