4. Calculate

$$
\int \frac{2 x+5}{(x+1)(x+2)(x+3)(x+4)+a} d x
$$

where $a \geq 1$.
Solution.

Case 1. For $a=1$, we have

$$
(x+1)(x+2)(x+3)(x+4)+1=\left(x^{2}+5 x+4\right)\left(x^{2}+5 x+6\right)+1=\left(x^{2}+5 x+5\right)^{2}
$$

$$
\int \frac{2 x+5}{(x+1)(x+2)(x+3)(x+4)+a} d x=\int \frac{\left(x^{2}+5 x+5\right)^{\prime}}{\left(x^{2}+5 x+5\right)^{2}} d x=-\frac{1}{x^{2}+5 x+5}+\mathcal{C}, x \in I
$$

where $I \subset \mathbb{R} \backslash\left\{\frac{-5-\sqrt{5}}{2}, \frac{-5+\sqrt{5}}{2}\right\}$ is an interval. (2p)

Case 2. For $a>1$, we have

$$
\begin{aligned}
\int \frac{2 x+5}{(x+1)(x+2)(x+3)(x+4)+a} d x & =\int \frac{\left(x^{2}+5 x+5\right)^{\prime}}{\left(x^{2}+5 x+5\right)^{2}+a-1} d x \\
& =\frac{1}{\sqrt{a-1}} \operatorname{arctg} \frac{x^{2}+5 x+5}{\sqrt{a-1}}+\mathcal{C}, x \in \mathbb{R}
\end{aligned}
$$