Example 2. To determine the parameters $a_{1}$ and $a_{2}$ in the formula $y=a_{1} e^{a_{2} x}$, values of $y$ were measured at different values of $x$. The obtained sample is

$$
\begin{array}{rrrrrrrrrr}
x_{k} & -1 & -0.75 & -0.5 & -0.25 & 0 & 0.25 & 0.5 & 0.75 & 1 \\
y_{k} & 7.14 & 4.46 & 2.81 & 1.68 & 0.99 & 0.50 & 0.36 & 0.33 & 0.40
\end{array}
$$

Using these data, determine the parameters $a_{1}$ and $a_{2}$ by the method of least squares. The measurement errors of $x_{1}, \ldots, x_{9}$ and the computational errors can be neglected.
Solution. Since the function $y=a_{1} e^{a_{2} x}$ is not a polynomial, the point at which function (1) takes the smallest value can only be found using a numerical method. However, in this case,

$$
\ln y=a_{2} x+\ln a_{1}=a_{2} x+b
$$

Considering the errors $\xi_{k}$ in the measurement of $y_{k}$ to be small, we have

$$
\ln \left(y_{k}-\xi_{k}\right) \approx \ln y_{k}-\frac{1}{y_{k}} \xi_{k}
$$

Therefore, $\xi_{k} \approx\left(\ln y_{k}-a_{2} x_{k}-b\right) y_{k}$ and the parameters $a_{1}$ and $a_{2}$ are determined from the condition

$$
S\left(a_{2}, b\right)=\sum_{k=1}^{9}\left(\ln y_{k}-a_{2} x_{k}-b\right)^{2} y_{k} \longrightarrow \min
$$

1. We find the partial derivatives

$$
\frac{\partial S}{\partial a_{2}}=-2 \sum_{k=1}^{9}\left(\ln y_{k}-a_{2} x_{k}-b\right) y_{k} x_{k}, \quad \frac{\partial S}{\partial b}=-2 \sum_{k=1}^{9}\left(\ln y_{k}-a_{2} x_{k}-b\right) y_{k}
$$

2. We determine the parameters $a_{2}$ and $b$ as the solution to the system of equations:

$$
\frac{\partial S}{\partial a_{2}}=0, \quad \frac{\partial S}{\partial b}=0
$$

We have

$$
\left\{\begin{array}{l}
a_{2} \sum_{k=1}^{9} y_{k} x_{k}^{2}+b \sum_{k=1}^{9} y_{k} x_{k}=\sum_{k=1}^{9} x_{k} y_{k} \ln y_{k} \\
a_{2} \sum_{k=1}^{9} x_{k} y_{k}+b \sum_{k=1}^{9} y_{k}=\sum_{k=1}^{9} y_{k} \ln y_{k}
\end{array}\right.
$$

Using the known $x_{k}, y_{k}$, we compute

$$
\begin{gathered}
\sum_{k=1}^{9} y_{k} x_{k}^{2}=11.16, \quad \sum_{k=1}^{9} y_{k} x_{k}=-11.36, \quad \sum_{k=1}^{9} x_{k} y_{k} \ln y_{k}=-21.63 \\
\sum_{k=1}^{9} y_{k}=18.7, \quad \sum_{k=1}^{9} y_{k} \ln y_{k}=23.0
\end{gathered}
$$

Substituting these values into system (5), we reduce it to the form

$$
\left\{\begin{aligned}
11.16 a_{2}-11.36 b & =-21.63 \\
-11.36 a_{2}+18.7 \quad b & =23
\end{aligned}\right.
$$

Solving this system, we get $a_{2}=1.798, b=0.13766$. Since $b=\ln a_{1}$, we have $a_{1}=1.1476$.

Answer. $y=1.15 e^{-1.8 x}$.

Remark. The method of linearization used requires control of the accuracy of approximate formulas like (4). For example, the error in formula (4) increases for $k=7, k=8, k=9$, as for such $k$ $y_{k} x_{k}$ is -1 | $a_{1} x^{2}+$  -0.75 | $a_{2} x+a$  -0.5 | ${ }^{l_{3}},-0.25$ | 0 | 0.25 | 0.5 | 0.75 | 1 |
| $y_{k} \quad 2.98$ | 2.47 | 2.13 | 2.00 | 1.95 | 2.05 | 2.31 | $2.46 \quad 3$. |  |
| $\begin{aligned} 6. & \(y= \\ x_{k} & -1\end{aligned}$\) | $a_{1} x^{2}+$  -0.75 | $a_{2} x+a$  -0.5 | ${ }^{3},-0.25$ | 0 | 0.2 | 0. | 0.7 | 1 |
| $y_{k} \quad 2.04$ | 0.92 | -0.37 | -0.86 | -1.20 | 0 $-1.1^{\prime}$ | 7 -1.1 | $17 \quad-0.6$ | -0.26 |
| $\begin{aligned} 7. & \(y= \\ x_{k} & -1\end{aligned}$\) | $a_{1} e^{a_{2} x}$,  -0.75 | -0.5 | -0.25 | 0 | 0.25 | 0.5 | 0.75 | 1 |
| $y_{k}$ 6.94 | 4.65 | 3.16 | 2.30 | 1.37 | 0.74 | 0.73 | $0.25 \quad 0$. |  |
| 8. $y=$  $x_{k}$ -1 | $a_{1} e^{a_{2} x}$  -0.75 | -0.5 | -0.25 | 0 | 0.25 | 0.5 | 0.75 | 1 |
| $y_{k}$ 0.10 | -0.08 | -0.14 | -0.83 | -1.95 | -5.53 | $3-14.6$ | 6 -40.3 | -109 |
| $\begin{aligned} 9. & \(y= \\ x_{k} & -1\end{aligned}$\) | $\operatorname{tg}\left(a_{1} x\right.$  -0.75 | $\left.+a_{2}\right)$,  -0.5 | -0.25 | 0 | 0.25 | 0.5 | 0.75 | 1 |
| $y_{k}$ 2.57 | 1.47 | 1.12 |