Example 2.3. $I=\int_{0}^{\pi / 4}\left(\frac{4}{\cos ^{2} x}-\frac{5 x^{2}}{1+x^{2}}\right) d x$.
Solution.

$$
\begin{gathered}
I=4 \int_{0}^{\pi / 4} \frac{d x}{\cos ^{2} x}-5 \int_{0}^{\pi / 4} \frac{\left(x^{2}+1-1\right) d x}{1+x^{2}}= \\
=\left.4 \operatorname{tg} x\right|_{0} ^{\pi / 4}-\left.5 x\right|_{0} ^{\pi / 4}+5 \int_{0}^{\pi / 4} \frac{d x}{1+x^{2}}= \\
=4\left(\operatorname{tg}\left(\frac{\pi}{4}\right)-\operatorname{tg}(0)\right)-5\left(\frac{\pi}{4}-0\right)+5\left(\operatorname{arctg}\left(\frac{\pi}{4}\right)-\operatorname{arctg}(0)\right)= \\
=4-5 \frac{\pi}{4}+5 \operatorname{arctg}\left(\frac{\pi}{4}\right)
\end{gathered}
$$

![](https://cdn.mathpix.com/cropped/2024_05_22_0f84e17422d7c0df8d68g-047.jpg?height=97&width=919&top_left_y=125&top_left_x=175)

Solution. We will use the property of additivity and split the given integral into two:

$$
\begin{aligned}
& \int_{0}^{2} f(x) d x=\int_{-1}^{0} f(x) d x+\int_{0}^{2} f(x) d x= \\
& =\int_{-1}^{0}\left(x^{2}+2\right) d x+\int_{0}^{2}(x+1) d x= \\
& =\left.\left(\frac{x^{3}}{3}+2 x\right)\right|_{-1} ^{0}+\left.\left(\frac{x^{2}}{2}+x\right)\right|_{0} ^{2}= \\
& =\left(\frac{0^{3}}{3}+2 \cdot 0\right)-\left(\frac{(-1)^{3}}{3}+2 \cdot(-1)\right)+ \\
& \quad+\left(\frac{2^{2}}{2}+2\right)-\left(\frac{0^{2}}{2}+0\right)=6 \frac{1}{3}
\end{aligned}
$$