Example 1. To determine the parameters $a_{1}, a_{2}$, and $a_{3}$ in the formula $y=a_{1} x^{2}+a_{2} x+a_{3}$, 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} & 6.01 & 5.07 & 4.30 & 3.56 & 3.07 & 2.87 & 2.18 & 2.00 & 2.14
\end{array}
$$

Using these data, determine the parameters $a_{1}, a_{2}$, and $a_{3}$ by the method of least squares. The measurement errors of $x_{1}, \ldots, x_{9}$ and the computational errors can be neglected.
Solution. The function (1) is given by

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

1. We find the partial derivatives

$$
\begin{aligned}
\frac{\partial S}{\partial a_{1}} & =-2 \sum_{k=1}^{9}\left(y_{k}-a_{1} x_{k}^{2}-a_{2} x_{k}-a_{3}\right) x_{k}^{2} \\
\frac{\partial S}{\partial a_{2}} & =-2 \sum_{k=1}^{9}\left(y_{k}-a_{1} x_{k}^{2}-a_{2} x_{k}-a_{3}\right) x_{k} \\
\frac{\partial S}{\partial a_{3}} & =-2 \sum_{k=1}^{9}\left(y_{k}-a_{1} x_{k}^{2}-a_{2} x_{k}-a_{3}\right)
\end{aligned}
$$

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

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

We have

$$
\left\{\begin{aligned}
a_{1} \sum_{k=1}^{9} x_{k}^{4}+a_{2} \sum_{k=1}^{9} x_{k}^{3}+a_{3} \sum_{k=1}^{9} x_{k}^{2} & =\sum_{k=1}^{9} y_{k} x_{k}^{2} \\
a_{1} \sum_{k=1}^{9} x_{k}^{3}+a_{2} \sum_{k=1}^{9} x_{k}^{2}+a_{3} \sum_{k=1}^{9} x_{k} & =\sum_{k=1}^{9} y_{k} x_{k} \\
a_{1} \sum_{k=1}^{9} x_{k}^{2}+a_{2} \sum_{k=1}^{9} x_{k}+a_{3} \sum_{k=1}^{9} 1 & =\sum_{k=1}^{9} y_{k}
\end{aligned}\right.
$$

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

$$
\begin{gathered}
\sum_{k=1}^{9} x_{k}=0, \quad \sum_{k=1}^{9} x_{k}^{2}=3.750, \quad \sum_{k=1}^{9} x_{k}^{3}=0, \quad \sum_{k=1}^{9} x_{k}^{4}=2.7656 \\
\sum_{k=1}^{9} y_{k}=31.2, \quad \sum_{k=1}^{9} y_{k} x_{k}=-7.4, \quad \sum_{k=1}^{9} y_{k} x_{k}^{2}=14.15
\end{gathered}
$$

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

$$
\left\{\begin{array}{l}
2.7656 a_{1}+3.750 a_{3}=14.15 \\
3.750 a_{2}=-7.4 \\
3.750 a_{1}+9 a_{3}=31.2
\end{array}\right.
$$

Solving this system, we get

$$
a_{1}=0.95586, \quad a_{2}=-1.9733, \quad a_{3}=3.0684
$$

Answer. $y=0.96 x^{2}-1.97 x+3.07$