Example 11 Find the minimum value of the bivariate function $f(x, y)=(x-y)^{2}+\left(x+\frac{1}{y}+1\right)^{2}$.
Solution: Since $(x-y)^{2}+\left(x+\frac{1}{y}+1\right)^{2}$
$$
=(x-y)^{2}+\left[(-x-1)-\frac{1}{y}\right]^{2},
$$

the above expression can be seen as the square of the distance between a point $(x,-x-1)$ on the line $y=-x-1$ and a point $\left(y, \frac{1}{y}\right)$ on the hyperbola $x y=1$, as shown in Figure 4-1.

Therefore, the minimum value sought is the square of the shortest distance between the line and the hyperbola. From the graph of the function, it is known that the coordinates of points $A, B, C$ are $(1,1)$, $(-1,1)$, and $\left(-\frac{1}{2},-\frac{1}{2}\right)$, respectively. Thus, the required minimum value is $|B C|$. Also, $|B C|=\sqrt{2}-\frac{\sqrt{2}}{2}=\frac{\sqrt{3}}{2}$, and $|B C|^{2}=\frac{1}{2}$. Hence, $f(x, y)_{\text {min }}=\frac{1}{2}$ is the answer.

Note: By $(x-y)^{2}+\left(x+\frac{1}{y}+1\right)^{2}=(x-y)^{2}+\left[(x+1)-\left(-\frac{1}{y}\right)\right]^{2}$, we consider the square of the distance between a point $\left(y,-\frac{1}{y}\right)$ on the hyperbola $x y=-1$ and the line $y=x+1$.