Example. Find the indefinite integral

$$
\int \frac{2 x^{3}-40 x-8}{x(x+4)(x-2)} d x
$$
SOLUTION.

1. The integrand is an improper rational fraction since $n=m=3$. We separate the integer part:

$$
\frac{2 x^{3}-40 x-8}{x(x+4)(x-2)}=2-\frac{4 x^{2}+24 x+8}{x(x+4)(x-2)}
$$

2. Since the denominator of the last fraction has three distinct real roots $x=0, x=-4$, and $x=2$, its decomposition into partial fractions is of the form

$$
\frac{4 x^{2}+24 x+8}{x(x+4)(x-2)} \equiv \frac{A_{1}}{x}+\frac{A_{2}}{x+4}+\frac{A_{3}}{x-2}
$$

3. To find the coefficients $A_{1}, A_{2}, A_{3}$, we bring the fractions on the right side of the identity to a common denominator:

$$
\frac{4 x^{2}+24 x+8}{x(x+4)(x-2)} \equiv \frac{A_{1}\left(x^{2}+2 x-8\right)+A_{2}\left(x^{2}-2 x\right)+A_{3}\left(x^{2}+4 x\right)}{x(x+4)(x-2)}
$$

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

$$
\left\{\begin{aligned}
A_{1}+A_{2}+A_{3} & =4 \\
2 A_{1}-2 A_{2}+4 A_{3} & =24 \\
-8 A_{1} & =8
\end{aligned}\right.
$$

This system has a unique solution $A_{1}=-1, A_{2}=-1, A_{3}=6$.

Thus, the integrand has the form

$$
\frac{2 x^{3}-40 x-8}{x(x+4)(x-2)}=2-\left(-\frac{1}{x}\right)-\left(-\frac{1}{x+4}\right)-\frac{6}{x-2}
$$

4. We integrate the integer part and the partial fractions using table integrals:

$$
\begin{array}{r}
\int \frac{2 x^{3}-40 x-8}{x(x+4)(x-2)} d x=\int 2 d x+\int \frac{1}{x} d x+\int \frac{1}{x+4} d x-\int \frac{6}{x-2} d x= \\
=2 x+\ln |x|+\ln |x+4|-6 \ln |x-2|+C
\end{array}
$$

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

PROBLEM CONDITIONS. Find the indefinite integrals.

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

Answers.

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

## 7.4. Integration of Rational Functions with Multiple Real 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^{n-1}+\ldots+b_{1} x+b_{0}} d x
$$

SOLUTION PLAN.

1. Introduce the notations:

$$
\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)
$$

Here, the polynomial $\widetilde{P}_{k}(x)$ is the remainder of the division of $P_{n}(x)$ by $Q_{m}(x)$, and the degree of $\widetilde{P}_{k}(x)$ is less than the degree of $Q_{m}(x)$.

2. Decompose the proper rational fraction $\frac{\tilde{P}_{k}(x)}{Q_{m}(x)}$ into partial fractions. If its denominator has real roots $r_{1}, r_{2}, \ldots, r_{s}$ of multiplicities $n_{1}, n_{2}, \ldots, n_{s}$ respectively, i.e.,

$$
Q_{m}(x)=\left(x-r_{1}\right)^{n_{1}}\left(x-r_{2}\right)^{n_{2}} \ldots\left(x-r_{m}\right)^{n_{s}}
$$

then the decomposition into partial fractions is of the form

$$
\begin{gathered}
\frac{\tilde{P}_{k}(x)}{Q_{m}(x)} \equiv \frac{A_{11}}{x-r_{1}}+\frac{A_{12}}{\left(x-r_{1}\right)^{2}}+\ldots+\frac{A_{1 n_{1}}}{\left(x-r_{1}\right)^{n_{1}}}+ \\
+\frac{A_{21}}{x-r_{2}}+\frac{A_{22}}{\left(x-r_{2}\right)^{2}}+\ldots+\