1. Let $P$ be any point on the graph of the function $y=x+\frac{2}{x}(x>0)$, and draw perpendiculars from $P$ to the line $y=x$ and the $y$-axis, with the feet of the perpendiculars being $A$ and $B$ respectively. Then $\overrightarrow{P A} \cdot \overrightarrow{P B}=$ $\qquad$
- 1. -1 .

Solution 1 Let $P\left(x_{0}, x_{0}+\frac{2}{x_{0}}\right)$.
Then $l_{P A}: y-\left(x_{0}+\frac{2}{x_{0}}\right)=-\left(x-x_{0}\right)$, which is $y=-x+2 x_{0}+\frac{2}{x_{0}}$.
Solving the above equation with $y=x$ yields point $A\left(x_{0}+\frac{1}{x_{0}}, x_{0}+\frac{1}{x_{0}}\right)$.
Also, point $B\left(0, x_{0}+\frac{2}{x_{0}}\right)$, then $\overrightarrow{P A}=\left(\frac{1}{x_{0}},-\frac{1}{x_{0}}\right), \overrightarrow{P B}=\left(-x_{0}, 0\right)$. Therefore, $\overrightarrow{P A} \cdot \overrightarrow{P B}=\frac{1}{x_{0}}\left(-x_{0}\right)=-1$.
Solution 2 As shown in Figure 3, let $P\left(x_{0}, x_{0}+\frac{2}{x_{0}}\right)\left(x_{0}>0\right)$.
Figure 3

Then the distances from point $P$ to the line $x-y=0$ and the $y$-axis are respectively
$$
|P A|=\frac{\left|x_{0}-\left(x_{0}+\frac{2}{x_{0}}\right)\right|}{\sqrt{2}}=\frac{\sqrt{2}}{x_{0}},|P B|=x_{0} \text {. }
$$

Since $O, A, P, B$ are concyclic, we have
$$
\angle A P B=\pi-\angle A O B=\frac{3 \pi}{4} \text {. }
$$

Therefore, $\overrightarrow{P A} \cdot \overrightarrow{P B}=|\overrightarrow{P A}||\overrightarrow{P B}| \cos \frac{3 \pi}{4}=-1$.