Example 3 (to item $2^{\circ}$). On the hyperbola $x^{2}-y^{2}=9$, find the point that is closest to the point $A(0,-3)$.
Solution. Let's investigate the function expressing the square of the distance of point $M(x, y)$ from point $A(0,-3)$:

$$
A M^{2}=f(x, y)=x^{2}+(y+3)^{2}
$$

under the condition that the coordinates of point $M(x, y)$ satisfy the equation of the hyperbola $x^{2}-y^{2}-9=0$.

We form the Lagrange function:

$$
F(x, y)=x^{2}+(y+3)^{2}+\lambda\left(x^{2}-y^{2}-9\right)
$$

The coordinates of the points where the function $f(x, y)$ has a conditional extremum will be found by solving the system of equations

$$
\left\{\begin{array}{l}
\frac{\partial F}{\partial x}=2 x+2 \lambda x=2 x(1+\lambda)=0 \\
\frac{\partial F}{\partial y}=2(y+3)-2 \lambda y=2(y+3-\lambda y) \\
x^{2}-y^{2}=9
\end{array}\right.
$$

We obtain: $\lambda=-1, y=-\frac{3}{2}, x= \pm \frac{3 \sqrt{5}}{2}$. The function $f(x, y)$ may have a conditional extremum at two points: $M_{1}\left(-\frac{3 \sqrt{5}}{2},-\frac{3}{2}\right)$ and $M_{2}\left(\frac{3 \sqrt{5}}{2},-\frac{3}{2}\right)$. We will check the sufficient conditions for them by finding the second-order differential of the function $F(x, y)$ at the found points. We have:

$$
\begin{gathered}
F_{x^{2}}^{\prime \prime}=2(1+\lambda), \quad F_{x y}^{\prime \prime}=0, \quad F_{y^{2}}^{\prime \prime}=2(1-\lambda) \\
d^{2} F=2(1+\lambda) d x^{2}+2(1-\lambda) d y^{2}
\end{gathered}
$$

If $\lambda=-1$, then $d^{2} F=4 d y^{2}>0$. Therefore, both points $M_{1}\left(-\frac{3 \sqrt{5}}{2},-\frac{3}{2}\right)$ and $M_{2}\left(\frac{3 \sqrt{5}}{2},-\frac{3}{2}\right)$ are points of conditional minimum of our function. In this case,

$$
f_{\min }(x, y)=f\left(-\frac{3 \sqrt{5}}{2},-\frac{3}{2}\right)=f\left(\frac{3 \sqrt{5}}{2},-\frac{3}{2}\right)=26, \quad A M=3 \sqrt{\frac{3}{2}}
$$

## Exercises

Investigate the functions for extremum.

1. $z=2 x y-3 x^{2}-2 y^{2}+10$. 2. $z=4(x-y)-x^{2}-y^{2}$
2. $z=x^{2}+x y+y^{2}+x+y+1$. 4. $z=4 x^{2} y+24 x y+y^{2}+32 y-6$.
3. $z=x^{3}+x^{2}-6 x y-39 x+18 y+20$. 6. $z=x y+\frac{50}{x}+\frac{20}{y}$.
4. $z=e^{-x^{2}-y^{2}}\left(2 x^{2}+y^{2}\right)$. 8. $z=4-\sqrt[3]{\left(x^{2}+y^{2}\right)^{2}}$.

Investigate the functions $z=f(x, y)$ for conditional extremum under the given condition (9-14).
9. $f(x, y)=x^{2}+(y-2)^{2}, x^{2}-y^{2}-4=0$.
10. $f(x, y)=\frac{1}{x}+\frac{1}{y}, x+y-2=0$.
11. $f(x, y)=x+y, \frac{1}{x^{2}}+\frac{1}{y^{2}}-\frac{1}{2}=0$.
12. $f(x, y)=x^{2}+y^{2}, \frac{x}{4}+\frac{y}{3}-1=0$.
13. $f(x, y)=x y, 2 x+3 y-5=0$.
14. $f(x, y)=x^{2}+y^{2} x y=2$.

15. On the parabola $y^{2}=4 x$, find the point that is closest to the line $y=x+4$.

## Answers

1. $(0,0)-\max$ 2. $(2,-2)-\max .3 \cdot(-1,1)-\min .4 \cdot(-3,2)-\min$, $(-4,0) ;(-2,0)-$ no extremum. 5. $(5,6)-\min .6$. $(5,2)-\min$. 7. $(0,0)-\min$, no extremum at points $(0, \pm 1)$; $\max$ at points $( \pm 1,0)$. 8. $(0,0)-\max .9$. $M( \pm \sqrt{5}, 1)-$ point of minimum with $f_{\min }=\sqrt{6}$. 10. $f_{\min }=f(1,1)=2$. 11. $f_{\max }=f(-2,-2)=-4$. 12. $f_{\min }=\frac{144}{25}$ at point $M_{0}\left(\frac{36}{25}, \frac{48}{25}\right)$. 13. $f_{\max }=\frac{25}{24}$ at point $M_{0}\left(\frac{5}{4}, \frac{5}{6}\right)$. 14. $f_{\min }^{25}=2$ at point $M_{0}(\sqrt{2}, \sqrt{2})$. 15. $f_{\min }=f(1,2)=\frac{3}{\sqrt{2}}$.

## § 9. Greatest and Least Values of a Function

When finding the greatest and least values of a function in a certain closed domain, it is necessary to find all internal points of the domain where the function may have an extremum. Then, the function should be investigated for extremum on the boundary of the domain. Often, it is necessary to divide the boundary of the domain into parts defined by different equations. By calculating the values of the function at all found extremal points, the greatest (least) of these values is the greatest (least) value of the function in the entire closed domain.

## Examples with Solutions