Example 2. Into how many parts should the interval of integration be divided to calculate $\int_{2}^{7} \frac{d x}{\sqrt{x+2}}$ with an accuracy of 0.1?
Solution. The absolute error in calculating a definite integral using the rectangle method is determined by inequality (13.4). In the problem, the condition $\left|R_{n}(f)\right| \leq \varepsilon$ is set, where $\varepsilon=0.1$. The inequality $\left|R_{n}(f)\right| \leq \varepsilon$ will be satisfied if $\frac{(b-a)^{2} M}{2 n} \leq \varepsilon$, from which

$$
n \geq \frac{(b-a)^{2} M}{2 \varepsilon}
$$

In this case, $a=2, b=7, \varepsilon=0.1$. Since $f(x)=\frac{1}{\sqrt{x+2}}$,

$$
\begin{aligned}
f^{\prime}(x)=-\frac{1}{2 \sqrt{(x+2)^{3}}}, M & =\max _{2 \leq x \leq 7}\left|f^{\prime}(x)\right|=\frac{1}{16}, \text { then } \\
n & \geq \frac{(7-2)^{2} \cdot \frac{1}{16}}{2 \cdot 0.1} \approx 7.8
\end{aligned}
$$

Since $n$ is an integer, we need to take $n=8$. (For convenience in calculations, $n=10$ can be taken).

## Problems

Using the rectangle formulas, with $n=10$, calculate the definite integrals:

1. $\int_{1}^{11} \frac{d x}{x+2}$.
2. $\int_{0}^{\frac{\pi}{6}} \sin 3 x d x$.
3. $\int_{0}^{10} \sqrt{x^{2}+2} d x$.
4. $\int_{0}^{1} \frac{\cos x}{1+x} d x$.
5. $\int_{0}^{0.9} \sin x^{2} d x$.
6. $\int_{0}^{1} \frac{d x}{\sqrt{x^{3}+1}}$.

How many parts should the integration interval be divided into to calculate the integrals with an accuracy of 0.1 using the rectangle formulas:
7. $\int_{1}^{2} \ln x d x$.
8. $\quad \int_{0}^{1} \frac{d x}{x+1}$.
9. $\int_{0}^{\frac{\pi}{8}} \cos 4 x d x$. \quad 10. $\int_{0}^{\frac{\pi}{8}} \sin \frac{x}{2} d x$.

## Answers

1. $J_{n}=1.603 ; J_{n}=1.348$. 2. $J_{n}=0.303 ; J_{n}=0.314$. 3. $J_{n}=48.891$. 4. $J_{n}=0.565 ; J_{n}=0.640$. 5. $J_{n}=0.266$. 6. $J_{n}=0.444$. 7.5. 8.5. 9.3.

## § 13.2. Trapezoidal Rule

The trapezoidal rule is given by

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

where

$$
h=\frac{b-a}{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.5) represents the area of a figure consisting of trapezoids, each with height $h$ (Fig. 13.2). If $R_{n}$ is the remainder term of the approximate formula (13.5), then

$$
\left|R_{n}\right| \leq \frac{(b-a)^{3} M}{12 n^{2}}
$$

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

![](https://cdn.mathpix.com/cropped/2024_05_22_7ef2114a321cf223ba99g-382.jpg?height=409&width=516&top_left_y=1144&top_left_x=43)

Fig. 13.2