# Solve $(xz)^2+(yz)^2=(xy)^2$ over the integers

I'm attempting to solve $(xz)^2+(yz)^2=(xy)^2$ over the integers. So far, I have that $x^2+y^2=\Big(\frac{xy}{z}\Big)^2$, and I can represent the triple $(x,y,xy/z)$ as a Pythagorean triple ($m,n\in \mathbb{Z})$:

$$x=m^2-n^2$$ $$y=2mn$$ $$\Big(\frac{xy}{z}\Big)=m^2+n^2$$

But, I'm not sure how to proceed from here. Solving for $z$ in the last equation gives $z = \frac{xy}{m^2+n^2}$, and as $z$ is supposed to be an integer, I'm not sure where to go from here. A hint would be appreciated.

• Because I need to ensure that $z$ is an integer. – zz20s Dec 5 '17 at 16:22

If $a^2+b^2=c^2$ then $x=ac$, $y=bc$, $z=ab$ is a solution.
Conversely, assume that $x,y,z$ have no common factor.
Lets say $$x=ac$$ and $$y=bc$$ with $(a,b)=1$. Then $$(acz)^2+(bcz)^2=(abc^2)^2$$
$$(az)^2+(bz)^2=(abc)^2$$ this implies that $z=abd$, since $a$ and $b$ are relatively prime. Thus we have $$(ad)^2+(bd)^2=c^2$$ which gives that $d|c$ and thus $d$ is a common factor of $x,y,z$ so $d=1$ and we have $z=ab$, and that $$a^2+b^2=c^2.$$