8. Find the minimum value of the function $f(x, y)=2 x^{2}+y^{2}+2 x(1-y)+\frac{1}{y^{2}}+\frac{1}{y}(2 x+2)+1$.
8. Given $f(x, y)=(x-y)^{2}+\left(-x-1-\frac{1}{y}\right)^{2}$, this expression can be viewed 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 $xy=1$. By plotting the graph, we can see that $A(1,1), B(-1,1), C\left(-\frac{1}{2}, \frac{1}{2}\right)$. Therefore, the required minimum value is $|BC|^{2}=\left(\sqrt{2}-\frac{\sqrt{2}}{2}\right)^{2}=\left(\frac{\sqrt{2}}{2}\right)^{2}=\frac{1}{2}$, which means the minimum value is $\frac{1}{2}$.