Example 1. Find the maximum and minimum values of the function $z=2 x^{3}-6 x y+3 y^{2}$ in the closed region bounded by the $O y$ axis, the line $y=2$, and the parabola $y=\frac{x^{2}}{2}$ for $x \geqslant 0$.

![](https://cdn.mathpix.com/cropped/2024_05_22_8f5be56c3f01f571fd60g-105.jpg?height=300&width=376&top_left_y=1600&top_left_x=119)

Fig. 8.3
Solution. The corresponding area is shown in Fig. 8.3.

1) The points at which the function takes its maximum and minimum values can be located both inside the area and on its boundary. We set the partial derivatives $\frac{\partial z}{\partial x}=6 x^{2}-6 y$ and $\frac{\partial z}{\partial y}=-6 x+6 y$ to zero.
Solving the system of equations

$$
\left\{\begin{array}{l}
6 x^{2}-6 y=0 \\
-6 x+6 y=0
\end{array}\right.
$$

we find two stationary points $O(0,0)$ and $M(1,1)$. The first lies on the boundary of the area, the second inside the area. Therefore, if the function $z$ takes its maximum (minimum) value at an internal point of the area, then this can only be at the point $M(1,1)$. In this case, $z(1,1)=12$.

2) We investigate the function on the boundary of the area.

a) On the segment $O A$ we have $x=0$. Therefore, on this segment we investigate the function $z=3 y^{2}, 0 \leqslant y \leqslant 2$. This is an increasing function of one variable $y$; its maximum and minimum values are taken at the ends of the segment $O A, z(0,0)=0, z(0,2)=12$.

b) On the segment $A B$ we have $y=2$ and $0 \leqslant x \leqslant 2$. Therefore, on this segment we investigate the function of one variable $z=2 x^{3}-6 x \cdot 2 + 3 \cdot 2^{2}=2 x^{3}-12 x+12, 0 \leqslant x \leqslant 2$. Its maximum and minimum values are found among its values at the stationary points and at the ends of the segment.

We find the derivative $z^{\prime}=6 x^{2}-12$. Solving the equation $z^{\prime}=0$, or $6 x^{2}-12=0$, we find $x_{1,2}= \pm \sqrt{2}$.

Inside the segment $0 \leqslant x \leqslant 2$ there is only one stationary point $x=\sqrt{2}$; the corresponding point on the segment $A B$ is the point $Q(\sqrt{2}, 2)$. Therefore, the maximum and minimum values of the function $z$ on the segment $A B$ are found among its values at the points $A(0,2), Q(\sqrt{2}, 2)$, and $B(2,2)$.

c) On the arc $O B$ of the parabola we have $y=\frac{x^{2}}{2}$,

$$
z=2 x^{3}-6 x \frac{x^{2}}{2}+3\left(\frac{x^{2}}{2}\right)^{2}=\frac{3}{4} x^{4}-x^{3}, \quad 0 \leqslant x \leqslant 2
$$

We solve the equation $z^{\prime}=3 x^{3}-3 x^{2}=0$, or $x^{2}(x-1)=0$ and find its roots: $x_{1,3}=0$ and $x_{2}=1$. Thus, the maximum and minimum values of the function $y$ on the arc $O B$ are found among its values at the points $O(0,0), P\left(1, \frac{1}{2}\right)$, and $B(2,2)$.

Therefore, the maximum and minimum values of the function $z=2 x^{3}-6 x y+3 y^{2}$ in the given closed area are found among its values at the points $O, A, Q, B, P, M$, i.e., among the values $z(O)=z(0,0)=0, \quad z(A)=z(0,2)=12, \quad z(Q)=z(\sqrt{2}, 2)=12-8 \sqrt{2}$, $z(B)=z(2,2)=4, \quad z(P)=z\left(1, \frac{1}{2}\right)=-\frac{1}{4}, z(M)=z(1,1)=-1$. The maximum and minimum of these values are 12 and -1, respectively. They are the maximum and minimum values of the given function in the given closed area:

$$
z_{\text {max }}=z(0,2)=12, \quad z_{\text {min }}=z(1,1)=-1
$$

## Exercises

Investigate the functions for extremum (1-4).

1. $z=e^{-\left(x^{2}+y^{2}\right)}, \quad$ 2. $z=x y$.

![](https://cdn.mathpix.com/cropped/2024_05_22_8f5be56c3f01f571fd60g-106.jpg?height=98&width=703&top_left_y=336&top_left_x=132)

5. Find the maximum and minimum values of the function $z=x^{2}-$ $-2 y^{2}+4 x y-6 x-1$ in the triangle bounded by the lines $x=0$, $y=0, x+y=3$.
6. Find the maximum and minimum values of the function $z=x+y$ in the circle $x^{2}+y^{2} \leqslant 1$.
7. Find the maximum and minimum values of the function $z=f(x, y)$ in the region $S$ :
1) $f(x, y)=x^{2} y(2-x-y), S$ : triangle $x=0, y=0, y+x=6$;
2) $f(x, y)=x y, S:$ circle $x^{2}+y^{2} \leqslant 1$
3) $f(x, y)=1-x^{2}-y^{2}, S$ : circle $(x-1)^{2}+(y-1)^{2} \leqslant 1$.

## Answers

1. $z_{\max }=z(0,0)=1$. 2. No extrema. 3. $z_{\min }=z\left(\frac{1}{4}, \frac{7}{6}\right)=$ $=-6.625$. 4. $z_{\min }=z(0,0)=0$. 5. $z_{\text {min }}(0,3)=-19 ; \quad z_{\text {max }}(0,0)=$ $=-1 . \quad 6 . \quad z_{\text {min }}\left(-\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)=-\sqrt{2} ; \quad z_{\text {max }}\left(\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}\right)=\sqrt{2}$. 7. 1) $\left.z_{\text {min }}(4,2)=-128, z_{\text {max }}\left(0, \frac{1}{2}\right)=\frac{1}{4} ; 2\right) z_{\text {min }}\left(-\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}\right)=$ $\left.=-\frac{1}{2}, z_{\text {max }}\left(\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}\right)=\frac{1}{2} ; 3\right) z_{\text {min }}\left(\frac{\sqrt{2}+2}{2}, \frac{\sqrt{2}+2}{2}\right)=-2(\sqrt{2}+1)$, $z_{\text {max }}\left(\frac{2-\sqrt{2}}{2}, \frac{2-\sqrt{2}}{2}\right)=2(\sqrt{2}-1)$.

## § 10. Method of Least Squares

$1^{\circ}$. Suppose that during the conduct of a certain experiment, $n$ values of the function $y$ are obtained for $n$ values of the argument $x$. The corresponding experimental data are placed in the table:

| $x$ | $x_{1}$ | $\overline{x_{2}}$ | $\overline{x_{3}}$ | $\cdots$ | $x_{n}$ |
| :--- | :--- | :--- | :--- | :--- | :--- |
| $y$ | $y_{1}$ | $y_{2}$ | $y_{3}$ | $\cdots$ | $y_{n}$ |

$2^{\circ}$. Using the data in the table, we plot points with coordinates $(x, y)$ (Fig. 8.4). Suppose these points are located near some straight line. We need to find the equation $y=k x+p$ of this line by the method of least squares, i.e., the coefficients $k$ and $p$ should minimize the function of two variables $k$ and $p$:

$$
\delta^{2}=\delta^{2}(k, p)=\sum_{i=1}^{n}\left(k x_{i}+p-y_{i}\right)^{2} \rightarrow \min
$$

$3^{\circ}$. If $\delta^{2}(k, p)$ has a minimum at some point, then the partial derivatives of this function should be equal to zero:

