Example 1. Find $\int x \sin x d x$.
Solution. Let: $x=u, \sin x d x=d v$.

To apply formula (4.18), we need to know $v$ and $d u$ as well. Differentiating the equation $x=u$, we get $d x=d u$. Integrating the equation $d v=\sin x d x=d(-\cos x)$, we determine $v=-\cos x$.

Substituting the values of $u, v, d u, d v$ into formula (4.18), we find

$$
\begin{gathered}
\int x \sin x d x=x(-\cos x)-\int(-\cos x) d x=-x \cos x+\sin x+ \\
+C=\sin x-x \cos x+C
\end{gathered}
$$