4.4.1. By first dividing the integration interval into 10 equal parts and then into 20 parts, find the approximate integrals $J_{10}$ and $J_{20}$. Determine the accuracy using the difference $\varepsilon=\left|J_{10}-J_{20}\right|$.

$$
J=\int_{-1}^{9} \sqrt{x^{2}+4} d x
$$

a) using the trapezoidal rule;

b) using Simpson's rule
Solution. We have the integrand function $y=\sqrt{x^{2}+4}$. Let's construct an auxiliary table.

| $x_{i}$ | $x_{i}^{2}$ | $x_{i}^{2}+4$ | When divided into 10 parts $y_{i}=\sqrt{x_{i}^{2}+4}$ | When divided into 20 parts $y_{i}=\sqrt{x_{i}^{2}+4}$ |
| :---: | :---: | :---: | :---: | :---: |
| -1 | 1 | 5 | $y_{0}=2.23607$ | $y_{0}=2.23607$ |
| $-0.5$ | 0.25 | 4.25 |  | $y_{1}=2.06155$ |
| 0 | 0 | 4 | $y_{1}=2.0$ | $y_{2}=2.0$ |
| 0.5 | 0.25 | 4.25 |  | $y_{3}=2.06155$ |
| 1 | 1 | 5 | $y_{2}=2.23607$ | $y_{4}=2.23607$ |
| 1.5 | 2.25 | 6.25 |  | $y_{5}=2.5$ |
| 2 | 4 | 8 | $y_{3}=2.82843$ | $y_{6}=2.82843$ |
| 2.5 | 6.25 | 10.25 |  | $y_{7}=3.20156$ |
| 3 | 9 | 13 | $y_{4}=3.60555$ | $y_{8}=3.60555$ |
| 3.5 | 12.25 | 16.25 |  | $y_{9}=4.03113$ |
| 4 | 16 | 20 | $y_{5}=4.47214$ | $y_{10}=4.47214$ |
| 4.5 | 20.25 | 24.25 |  | $y_{11}=4.92443$ |
| 5 | 25 | 29 | $y_{6}=5.38516$ | $y_{12}=5.38516$ |
| 5.5 | 30.25 | 34.25 |  | $y_{13}=5.85235$ |
| 6 | 36 | 40 | $y_{7}=6.32456$ | $y_{14}=6.32456$ |
| 6.5 | 42.25 | 46.25 |  | $y_{15}=6.80074$ |
| 7 | 49 | 53 | $y_{8}=7.28011$ | $y_{16}=7.28011$ |
| 7.5 | 56.25 | 60.25 |  | $y_{17}=7.76209$ |
| 8 | 64 | 68 | $y_{9}=8.24621$ | $y_{18}=8.24621$ |
| 8.5 | 72.25 | 76.25 |  | $y_{19}=8.73212$ |
| 9 | 81 | 85 | $y_{10}=9.21954$ | $y_{20}=9.21954$ |

a) By the trapezoidal rule.

When divided into 10 parts:

$$
\begin{aligned}
J_{10}=\int_{-1}^{9} \sqrt{x^{2}+4} d x & \approx \frac{9-(-1)}{10} \left( \frac{y_{0}}{2}+y_{1}+y_{2}+\ldots+y_{8}+y_{9}+\frac{y_{10}}{2} \right)= \\
& =\frac{10}{10} \cdot 48.10604=48.10604
\end{aligned}
$$

When divided into 20 parts:

$$
\begin{aligned}
J_{20}=\int_{-1}^{9} \sqrt{x^{2}+4} d x & \approx \frac{9-(-1)}{20} \left( \frac{y_{0}}{2}+y_{1}+y_{2}+\ldots+y_{18}+y_{19}+\frac{y_{20}}{2} \right)= \\
& =\frac{10}{20} \cdot 96.03356=48.01678
\end{aligned}
$$

The accuracy of the calculations is estimated by the difference:

$$
\varepsilon=\left|J_{10}-J_{20}\right|=|48.10604-48.01678|=0.08926 .
$$

b) By Simpson's rule

When divided into 10 parts:

$$
\begin{gathered}
J_{10}=\int_{-1}^{9} \sqrt{x^{2}+4} d x \approx \\
\approx \frac{9-(-1)}{10 \cdot 3}\left(y_{0}+4\left(y_{1}+y_{3}+\ldots+y_{9}\right)+2\left(y_{2}+y_{4}+\ldots+y_{8}\right)+y_{10}\right)= \\
=\frac{10}{10 \cdot 3} \cdot 143.95475=47.98492
\end{gathered}
$$

When divided into 20 parts:

$$
J_{20}=\int_{-1}^{9} \sqrt{x^{2}+4} d x \approx
$$

$$
\begin{gathered}
\approx \frac{9-(-1)}{20 \cdot 3}\left(y_{0}+4\left(y_{1}+y_{3}+\ldots+y_{17}+y_{19}\right)+2\left(y_{2}+y_{4}+\ldots+y_{16}+y_{18}\right)+y_{20}\right)= \\
=\frac{10}{20 \cdot 3} \cdot 287.92215=47.98702
\end{gathered}
$$

The accuracy of the calculations:

$$
e=\left|J_{10}-J_{20}\right|=|47.98492-47.98702|=0.0021
$$

It is known that for the same number of partition points, Simpson's rule provides a more accurate result.

## 5. FUNCTIONS OF SEVERAL VARIABLES

## 5.1. Partial Derivatives and Differential of a Function