Find all natural numbers $x, y, z$ such that

$$
x^{2}+y^{2}=9+z^{2}-2 x y
$$
The equation can be rewritten as

$$
x^{2}+2 x y+y^{2}-z^{2}=9
$$

thus

$$
(x+y)^{2}-z^{2}=9
$$

and

$$
(x+y-z)(x+y+z)=9
$$

$x+y+z$ is therefore a positive divisor of 9, and thus equals 1, 3, or 9.

- If $x+y+z=9$, then $x+y-z=1$ and by summing, $2(x+y)=10$ so $x+y=5$, thus $z=9-5=4$. We obtain the solutions $(0,5,4),(1,4,4),(2,3,4),(3,2,4),(4,1,4)$ and $(5,0,4)$, and we verify that they work.
- If $x+y+z=3$, then $x+y-z=3$ and by summing, $2(x+y)=6$ so $x+y=3$, thus $z=3-3=0$. We obtain the solutions $(0,3,0),(1,2,0),(2,1,0)$ and $(3,0,0)$, and we verify that they work.
- If $x+y+z=1$, then $x+y-z=9$. However, since $z \geq 0, x+y+z \geq x+y-z$ so this is absurd.