Show that every perfect square can be written as the sum of the squares of two non integer rationals

elementary-number-theorynumber theory

I was trying to prove the following statement:

Show that if $n$ is an integer, then $n^2$ can be written as $n^2=r^2+s^2$ where $r, s \in \mathbb{Q} \backslash \mathbb{Z}$, that is, $r$ and $s$ are non integer rationals.

My first idea was the most obvious one: to write $r=\frac{a}{b}$ and $s=\frac{c}{d}$ where $a, b, c, d \in \mathbb{Z}$ with $(a, b)=(c, d)=1$ and $b, d>1$.

I then tried a few things, but none of them lead to anything interesting. Could anyone help me? I'm looking for an elementary proof. I already know which integers can be expressed as the sum of two squares, and that primes of the form $4n+1$ have a unique representation as the sum of two squares, but I'm not sure how any of those would help me here.

Best Answer

There are infinitely many primitive Pythagorean triples (i.e., where $a$, $b$ and $c$ are coprime), such as explained in Pythagorean triple. Choose any one where the $c$ in

$$a^2 + b^2 = c^2 \implies 1 = \frac{a^2}{c^2} + \frac{b^2}{c^2} \tag{1}\label{eq1A}$$

has $c \not\mid n$, e.g., $c \gt n$. Multiplying both sides of \eqref{eq1A} by $n^2$ gives

$$n^2 = \frac{(na)^2}{c^2} + \frac{(nb)^2}{c^2} \tag{2}\label{eq2A}$$

This shows we can use $r = \frac{na}{c}$ and $s = \frac{nb}{c}$ since both values are non-integral.

For example, since $(68, 285, 293)$ is a Pythagorean triple, for any $n \lt 293$ (actually, since $293$ is a prime number, we can do this for any $n$ which doesn't have a factor of $293$), we get

$$n^2 = \frac{(68n)^2}{293^2} + \frac{(285n)^2}{293^2} \tag{3}\label{eq3A}$$