Prove that is a perfect square. Let $x,y$ and $z$ be positive integers such that $$\frac{1}{x}-\frac{1}{y}=\frac{1}{z}.$$ Let $h=(x,y,z).$ Prove that $hxyz$ is a perfect square.
Solution: Let $z=hc, x=ha,y=hb$ so $(a,b,c)=1$. Notice that:
\begin{align*}
hxyz=h^4abc
\end{align*}
We need to see that $abc$ is an square. Notice that from the equation,
\begin{align*}
z=\frac{xy}{y-x}&=\frac{h^2ab}{h(b-a)}=\frac{hab}{b-a}\\
c&=\frac{ab}{b-a}\\
\Rightarrow ab=c(b-a)
\end{align*}
So from the first equation:
$$hxyz= (h^4c)(c(b-a))=h^2c^2(b-a)$$
So we need to check that $b-a$ is an square. From the last equation, $c(b-a)=ab$, if $d\mid b-a$ is a prime, then $d\mid ab$, so $d\mid a$ or $b$, but any of them lets that $d$ divides the other, so $d^2\mid ab$. Since $(a,b,c)=1$, as we have $c(b-a)=ab$, $d^2\mid c(b-a)$, but $(d,c)=1$, so $d^2\mid (b-a)$, implying that for each prime divisor of $b-a$, there are two. If there is no $d$ prime such that $d\mid b-a$, then $b-a=1$, that is a square too. Then you have that
$$hxyz=h^4c^2(b-a)$$
Is really an square.
Question: Why $z=\frac{xy}{y-x}$?


Why is $z=\frac{xy}{y-x}$?

Initially, $x,y,z$ satisfy
$$\frac 1 x - \frac 1 y = \frac 1 z$$
Therefore, by solving for $z$,
$$z = \dfrac{1}{\left( \dfrac 1 x - \dfrac 1 y \right)} = \dfrac{1}{\left(\dfrac{y-x}{xy} \right)} = \dfrac{xy}{y-x}$$
