Example 3. Find $\int \ln ^{2} x d x$.
Solution. We integrate by parts twice:

$$
\begin{aligned}
& \int \ln ^{2} x d x=\left\{\begin{aligned}
u & =\ln ^{2} x, & d u & =2 \ln x \cdot \frac{d x}{x} \\
d x & =d v, & v & =x
\end{aligned}\right\}= \\
& =x \ln ^{2} x-2 \int \ln x d x=\left\{\begin{array}{cc}
\ln x=u, & d u=\frac{d x}{x} \\
d x=d v, & v=x
\end{array}\right\}= \\
& =x \ln ^{2} x-2 x \ln x+2 \int d x=x^{2} \ln x-2 x \ln x+2 x+C
\end{aligned}
$$

The examples provided convince us that it is necessary to master the method of bringing under the differential sign and other integration techniques.