Example 2. Using the trapezoidal rule with an accuracy of 0.01, calculate $\int_{2}^{3} \frac{d x}{x-1}$.
Solution. To determine the number $n$ of segments into which the interval of integration should be divided, we will use inequality (13.7). The inequality $\left|R_{n}\right| \leq \varepsilon$ will be satisfied if $\frac{(b-a)^{3} M}{12 n^{2}} \leq \varepsilon$, from which

$$
n \geq \sqrt{\frac{(b-a)^{3} M}{12 \varepsilon}}
$$

Since $\varepsilon=0.01$,

$$
\begin{gathered}
f(x)=\frac{1}{x-1}, f^{\prime}(x)=-\frac{1}{(x-1)^{2}}, f^{\prime \prime}(x)=\frac{2}{(x-1)^{3}} \\
M=\max _{a \leq x \leq b}\left|f^{\prime \prime}(x)\right|=\max _{2 \leq x \leq 3}\left|\frac{2}{(x-1)^{3}}\right|=2, \text { so } \\
n \geq \sqrt{\frac{(3-2)^{3} \cdot 2}{12 \cdot 0.01}}=\sqrt{\frac{1 \cdot 2 \cdot 100}{12}}=\sqrt{\frac{50}{3}}>\sqrt{16}=4
\end{gathered}
$$

Since $n$ is an integer, we can take $n=5$. Having determined $n$, we find $\quad h=0.2, \quad x_{k}=2+0.2 k(k=0,1,2,3,4,5): \quad x_{0}=2, \quad x_{1}=2.2$,

$$
x_{2}=2.4, \quad x_{3}=2.6, \quad x_{4}=2.8, \quad x_{5}=3 ; \quad y_{k}=\frac{1}{x_{k}-1}: \quad y_{0}=1, \quad y_{1}=0.833
$$

$$
y_{2}=0.714, \quad y_{3}=0.625, \quad y_{4}=0.556, \quad y_{5}=0.500
$$

Using formula (13.5), we get

$$
\begin{gathered}
\int_{2}^{3} \frac{d x}{x-1} \approx h\left(\frac{y_{0}}{2}+y_{1}+y_{2}+y_{3}+y_{4}+\frac{y_{5}}{2}\right)=0.2(0.5+0.833+0.714+ \\
+0.625+0.556+0.250)=0.2 \cdot 3.478=0.6956
\end{gathered}
$$

Remark. The obtained result satisfies the conditions of the problem. Indeed,

$$
\int_{2}^{3} \frac{d x}{x-1}=\left.\ln (x-1)\right|_{2} ^{3} \approx 0.6931 ;\left|R_{n}\right|=|0.6931-0.6956|=0.0025<0.01
$$

## Problems

Using the trapezoidal rule with $n=10$, compute the definite integrals for the given values of the parameter $p$:

1. $\int_{0}^{1} \frac{d x}{x+p} ;$ 1) $p=1$
2) $p=2$;
3) $p=3$
4) $p=4$;
5) $p=5$
6) $p=6$; 7) $p=7$; 8) $p=8$; 9) $p=9$; 10) $p=10$.
7) $p=1 ; 2$ ) $p=2$
2. $\int_{0}^{1} \frac{d x}{1+p x}$
3) $p=3$
4) $p=4$;
5) $p=5$
6) $p=6$; 7) $p=7$; 8) $p=8$; 9) $p=9$; 10) $p=10$.

Using the trapezoidal rule with an accuracy of 0.01, compute the definite integrals:
3. $\int_{0}^{3} \frac{d x}{x+2}$.
4. $\int_{1}^{2} \frac{d x}{x}$.
5. $\int_{0}^{1.2} e^{x} d x$.
6. $\int_{1}^{3} \ln 2 x d x$.

## Answers

1. 2) 0.69314 ; 2) 0.40555 ; 3) 0.28769 ; 4) 0.22315 ; 5) 0.18232 ; 6) 0.15415 ; 7) 0.13353 ; 8) 0.11778 ; 9) 0.10536 ; 10) 0.09531 . 2. 1) 0.69314 ; 2) 0.56078 ; 3) 0.46442 ; 4) 0.40551 ; 5) 0.36231 ; 6) 0.32906 ; 7) 0.30257 ; 8) 0.28089 ; 9) 0.26280 ; 10) 0.24744.3. 0.916.4. 0.693.5. 2.320.6. 2.682.

## § 13.3. The Parabola Formula

The parabola formula (or Simpson's formula) is given by

$$
\int_{a}^{b} f(x) d x \approx \frac{h}{3}\left[y_{0}+4\left(y_{1}+y_{3}+\ldots+y_{2 n-1}\right)+2\left(y_{2}+y_{4}+\ldots+y_{2 n}\right)\right]
$$

where

$$
h=\frac{b-a}{2 n}, x_{k}=a+k h, y_{k}=f\left(x_{k}\right)(k=0,1,2, \ldots, n)
$$

The right-hand side of formula (13.8) represents the area of a figure composed of parabolic trapezoids $x_{0} M_{0} M_{2} x_{2}, x_{2} M_{2} M_{4} x_{4}$, and so on (Fig. 13.3). The arc $M_{0} M_{1} M_{2}$ of the graph of the function $f(x)$ is replaced by the arc of a parabola passing through the points $M_{0}, M_{1}, M_{2}$. A similar replacement is made for the other arcs.

![](https://cdn.mathpix.com/cropped/2024_05_22_7ef2114a321cf223ba99g-385.jpg?height=419&width=722&top_left_y=745&top_left_x=237)

Fig. 13.3

The estimate of the remainder term of formula (13.8) is given by the inequality

$$
\left|R_{n}\right| \leq \frac{(b-a)^{5} M}{180(2 n)^{4}}
$$

where $M=\max _{a \leq x \leq b}\left|f^{\text {Iv }}(x)\right|$.