Example. Find the indefinite integral

$$
\int \frac{x^{3}+6 x^{2}+13 x+6}{(x-2)(x+2)^{3}} d x
$$
Solution.

1. The integrand is a proper rational fraction.
2. Decompose it into partial fractions. Since the denominator has two real roots: $r_{1}=2$ of multiplicity one and $r_{2}=-2$ of multiplicity three, the partial fraction decomposition has the form

$$
\frac{x^{3}+6 x^{2}+13 x+6}{(x-2)(x+2)^{3}}=\frac{A_{11}}{x-2}+\frac{A_{21}}{x+2}+\frac{A_{22}}{(x+2)^{2}}+\frac{A_{23}}{(x+2)^{3}}
$$

3. To find the coefficients $A_{11}, \ldots, A_{23}$, we bring the fractions on the right-hand side to a common denominator:

$$
\begin{aligned}
& \frac{x^{3}+6 x^{2}+13 x+6}{(x-2)(x+2)^{3}} \equiv \\
& \equiv \frac{A_{11}(x+2)^{3}+A_{21}(x-2)(x+2)^{2}+A_{22}(x-2)(x+2)+A_{23}(x-2)}{(x-2)(x+2)^{3}}
\end{aligned}
$$

By equating the coefficients of like powers of $x$ in the numerators on the left and right, we obtain a system of four equations with four unknowns

$$
\left\{\begin{array}{rlr}
A_{11}+A_{21} & =1 \\
6 A_{11}+4 A_{21}+A_{22} & =6 \\
12 A_{11}-2 A_{21}+ & A_{23} & =13 \\
8 A_{11}-4 A_{21}-4 A_{22}-2 A_{23} & =6
\end{array}\right.
$$

## This system has a unique solution:

$$
A_{11}=1, \quad A_{21}=0, \quad A_{22}=0, \quad A_{23}=1
$$

Thus, the integrand has the form

$$
\frac{x^{3}+6 x^{2}+13 x+6}{(x-2)(x+2)^{3}}=\frac{1}{x-2}+\frac{1}{(x+2)^{3}}
$$

3. We integrate the sum of the partial fractions using standard integrals:

$$
\int \frac{1}{x-2} d x+\int \frac{1}{(x+2)^{3}} d x=\ln |x-2|-\frac{1}{2(x+2)^{2}}+C
$$

Answer. $\int \frac{x^{3}+6 x^{2}+13 x+6}{(x-2)(x+2)^{3}} d x=\ln |x-2|-\frac{1}{2(x+2)^{2}}+C$.

## Problem Statements. Find the indefinite integrals.

1. $\int \frac{1}{x^{2}(x+1)(x-1)} d x$.
2. $\int \frac{x^{3}-6 x^{2}+9 x+7}{(x-2)^{3}(x-5)} d x$.
3. $\int \frac{x^{2}+1}{x(x-1)^{3}} d x$.
4. $\int \frac{x^{2}+2}{(x-1)(x+1)^{2}} d x$.
5. $\int \frac{x^{2}+1}{(x-1)^{3}(x+3)} d x$.
6. $\int \frac{1}{x^{2}(x-2)^{2}} d x$.
7. $\int \frac{x^{2}-2 x+3}{x(x-1)^{2}(x-3)} d x$.
8. $\int \frac{5 x^{3}-17 x^{2}+18 x-5}{(x-1)^{3}(x-2)} d x$.
9. $\int \frac{1}{x^{3}-x^{2}-x+1} d x$.
10. $\int \frac{x^{5}}{(x-1)^{3}(x+1)} d x$.

## Answers.

1. $\frac{1}{2} \ln \left|\frac{x-1}{x+1}\right|+\frac{1}{x}+C . \quad 2 . \quad \ln |x-5|+\frac{3}{2(x-2)^{2}}+C$.
2. $\ln \left|\frac{x-1}{x}\right|-\frac{1}{(x-1)^{2}}+C$.
3. $\frac{1}{4} \ln \left|(x+1)(x-1)^{3}\right|+\frac{3}{2(x+1)}+C$.
4. $\frac{1}{4} \ln \left|(x-1)(x+1)^{2}\right|+\frac{3}{2(x+1)}+C$.
5. $\frac{5}{32} \ln \left|\frac{x-1}{x+3}\right|-\frac{1}{4(x-1)^{2}}-\frac{3}{8(x-1)}+C$.
6. $\frac{1}{4} \ln \left|\frac{x}{x-2}\right|-\frac{1}{4(x-2)}-\frac{1}{2 x}+C$.
7. $\frac{1}{2} \ln \frac{|(x-1)(x-3)|}{x^{2}}+\frac{1}{x-1}+C$.
8. $\ln \left|(x-1)^{2}(x-2)^{3}\right|+\frac{1}{2(x-1)^{2}}+C$.
9. $\frac{1}{4} \ln \left|\frac{x+1}{x-1}\right|-\frac{1}{2(x-1)}+C$.
10. $\frac{(x+2)^{2}}{2}+\frac{1}{8} \ln \left|(x-1)^{3}(x+1)\right|-\frac{1}{4(x-1)^{2}}-\frac{9}{4(x-1)}+C$.

## 7.5. Integration of Rational Functions with Simple Complex Roots in the Denominator

Problem Statement. Find the indefinite integral

$$
\int \frac{a_{n} x^{n}+a_{n-1} x^{n-1}+\ldots+a_{1} x+a_{0}}{b_{m} x^{m}+b_{m-1} x^{m-1}+\ldots+b_{1} x+b_{0}} d x
$$

PLAN OF SOLUTION.

1. Introduce the notation:

$$
\begin{aligned}
P_{n}(x) & =a_{n} x^{n}+a_{n-1} x^{n-1}+\ldots+a_{1} x+a_{0} \\
Q_{m}(x) & =b_{m} x^{m}+b_{m-1} x^{m-1}+\ldots+b_{1} x+b_{0}
\end{aligned}
$$

Compare the degrees of the numerator $P_{n}(x)$ and the denominator $Q_{m}(x)$.

If the integrand is an improper rational fraction, i.e., the degree of the numerator $n$ is greater than or equal to the degree of the denominator $m$, then we first separate the integer part of the rational function by dividing the numerator by the denominator:

$$
\frac{P_{n}(x)}{Q_{m}(x)}=M_{n-m}(x)+\frac{\tilde{P}_{k}(x)}{Q_{m}(x)} \quad(k < m)
$$

2. Decompose the proper rational fraction $\frac{\tilde{P}_{k}(x)}{Q_{m}(x)}$ into partial fractions.
3. Integrate the integer part (if it exists) and the partial fractions.
4. For partial fractions of the form $\frac{A x+B}{x^{2}+p x+q}$, where the quadratic polynomial $x^{2}+p x+q$ has no real roots (i.e., $p^{2}-4q < 0$), we can set $q-p^{2} / 4=a^{2}$ and make the substitution $t=x-p / 2$. We get

$$
\begin{aligned}
\int \frac{A x+B}{x^{2}+p x+q} d x & =\int \frac{A t+A p / 2+B}{t^{2}+a^{2}} d t= \\
& =\int \frac{A t}{t^{2}+a^{2}} d t+\int \frac{A p / 2+B}{t^{2}+a^{2}} d t= \\
& =\frac{A}{2} \ln \left(t^{2}+a^{2}\right)+\frac{A p / 2+B}{a} \operatorname{arctg} \frac{t}{a}=
\end{aligned}
$$

$$
=\frac{A}{2} \ln \left(x^{2}+p x+q\right)+\frac{A p / 2+B}{\sqrt{q-p^{2} / 4}} \operatorname{arctg} \frac{x+p / 2}{\sqrt{q-p^{2} / 4}}
$$

5. Combine the results of integrating the integer part (if it exists) and the partial fractions and write the answer.