<s>[INST] If x,y and z are positive integers and $\frac 1x + \frac 1y = \frac 1z$ then $\sqrt{x^2+y^2+z^2}$ is rational. To solve this problem I first started off by factoring to get $z^2=(x-z)(y-z)$ only to realise that this does nothing so I then tried squaring both sides to get the reciprocals of $x,y$ and $z$ squared minus $2$ over $xy$ but after this I have no idea what to do any form of help would be appreciated.(sorry for not using mathjax as my browser does not support it)
 [/INST] Because $x\neq-y$, $z=\frac{xy}{x+y}$, $x^2+xy+y^2>0$ and
$$\sqrt{x^2+y^2+z^2}=\sqrt{x^2+y^2+\frac{x^2y^2}{(x+y)^2}}=$$
$$=\frac{\sqrt{(x^2+y^2+xy-xy)(x^2+y^2+xy+xy)+x^2y^2}}{x+y}=\frac{x^2+xy+y^2}{x+y}.$$
</s>