1. If $x+y+x y=1$, where $x, y$ are nonzero real numbers, find the value of
$$
x y+\frac{1}{x y}-\frac{y}{x}-\frac{x}{y} .
$$
1. Observe that
$$
\begin{aligned}
x y+\frac{1}{x y}-\frac{y}{x}-\frac{x}{y} & =\frac{(x y)^{2}+1-x^{2}-y^{2}}{x y} \\
& =\frac{\left(x^{2}-1\right)\left(y^{2}-1\right)}{x y} \\
& =\frac{(x+1)(y+1)(x-1)(y-1)}{x y} \\
& =(x y+x+y+1) \frac{(x y-x-y+1)}{x y} .
\end{aligned}
$$

Since, $x y+x+y=1$, the first term will equal to 2 . Moreover, dividing both sides of the equation $x y+x+y=1$ by $x y$, we obtain
$$
1+\frac{1}{y}+\frac{1}{x}=\frac{1}{x y}
$$
which is equivalent to
$$
1=\frac{1}{x y}-\frac{1}{y}-\frac{1}{x} .
$$

Hence, $(x y+x+y+1) \frac{(x y-x-y+1)}{x y}=2 \cdot 2=4$.