Example 2.13. $\int_{-1}^{1}|x| e^{|x|} d x$.
Solution. Here the integrand is an even function, which needs to be utilized, and then apply the integration by parts formula (2.3):

$$
\begin{gathered}
\int_{-1}^{1}|x| e^{|x|} d x=2 \int_{0}^{1} x e^{x} d x=\left|\begin{array}{l}
u=x, d u=d x \\
d v=e^{x} d x, v=\int e^{x} d x=e^{x}
\end{array}\right|= \\
=2\left(\left.x e^{x}\right|_{0} ^{1}-\int_{0}^{1} e^{x} d x\right)=2\left(\left.x e^{x}\right|_{0} ^{1}-\left.e^{x}\right|_{0} ^{1}\right)= \\
=\left.2 e^{x}(x-1)\right|_{0} ^{1}=-2 e^{0}(0-1)=2
\end{gathered}
$$