Example 4. Find $\int \sqrt{a^{2}+x^{2}} d x$.
Solution. Let the required integral be denoted by $I$ and use the integration by parts formula to form an equation in terms of $I$. We proceed as follows:

$$
\begin{aligned}
I= & \int \sqrt{a^{2}+x^{2}} d x=\left\{\begin{aligned}
\sqrt{a^{2}+x^{2}}=u, & d u=\frac{x}{\sqrt{a^{2}+x^{2}}} d x \\
d x=d v, & v=x
\end{aligned}\right\}= \\
& =x \sqrt{a^{2}+x^{2}}-\int \frac{x^{2}+a^{2}-a^{2}}{\sqrt{a^{2}+x^{2}}} d x=x \sqrt{a^{2}+x^{2}}-\int \frac{x^{2}+a^{2}}{\sqrt{a^{2}+x^{2}}} d x+ \\
& +a^{2} \int \frac{d x}{\sqrt{a^{2}+x^{2}}}=x \sqrt{a^{2}+x^{2}}-\int \sqrt{a^{2}+x^{2}} d x+a^{2} \ln \left|x+\sqrt{a^{2}+x^{2}}\right|
\end{aligned}
$$

In the numerator of one of the fractions, we added and subtracted $a^{2}$, and in the last equality, the middle term is $I$.

Clearly, the equation in terms of the original integral, which was mentioned at the beginning of the solution, is $I=A-I$, where $A$ contains two terms. From this, we obtain the value of the original integral.

$$
\int \sqrt{a^{2}+x^{2}} d x=\frac{1}{2} x \sqrt{a^{2}+x^{2}}+\frac{a^{2}}{2} \ln \left|x+\sqrt{a^{2}+x^{2}}\right|+C
$$

Note the technique of adding and subtracting a certain quantity (here $a^{2}$) to transform the integrand.