Prove that if a rectangle's sides are all odd, then it's diagonal is irrational? In trying to write an alternate and simple proof that at least one leg of a right triangle is a multiple of 4 using Dickson's method of generating triples, I came across quite an interesting observation that ifall the sides of a rectangle is odd, then it's diagonal is irrational. For example, consider a rectangle of length 5 units and breadth 3 units. It's diagonal,by the Pythagorean theorem is 34^0.5, which is irrational. This is the same for lots of rectangles. Is there a general proof for this, or can this whole thing be disproved?
 A: $$(2a+1)^2+(2b+1)^2=4a^2+4a+4b^2+4b+2=2(2c+1).$$
This number cannot be a perfect square as its prime factorization includes $2^1$.
A: If the sides of the rectangle are integers, then the square of the length of the diagonal is also an integer since 
$d^2 = l^2 + w^2$
and the integers are closed under multiplication and addition.  
The only integers that have rational square square roots are perfect squares.  Since  
$d = \sqrt{l^2 + w^2}$
the length of the diagonal is irrational unless $d^2 = l^2 + w^2$ is a perfect square.
If an integer is a perfect square, then it is either the square of an even number or an odd number.  
If the diagonal is an even number, then $d = 2k$ for some $k \in \mathbb{N}$, so $d^2 = (2k)^2 = 4k^2$.
If the diagonal is an odd number, then $d = 2k - 1$ for some $k \in \mathbb{N}$, so $d^2 = (2k - 1)^2 = 4k^2 - 4k + 1 = 4(k^2 - k) + 1$.
Hence, the square of any integer will have remainder $0$ or $1$ when divided by $4$.
If both the length and width are odd numbers, then $l^2 + w^2$ has remainder $2$ when divided by $4$.  To see this, suppose that $l = 2m - 1$ and $w = 2n - 1$, where $m$ and $n$ are positive integers.  Then
\begin{align*}
d^2 & = l^2 + w^2\\
    & = (2m - 1)^2 + (2n - 1)^2\\
    & = 4m^2 - 4m + 1 + 4n^2 - 4n + 1\\
    & = 4(m^2 - m + n^2 - n) + 2
\end{align*}
Since $d^2 = l^2 + w^2$ has remainder $2$ when divided by $4$, it is not a perfect square.  Thus, $d = \sqrt{l^2 + w^2}$ is irrational.
What I have not shown is why the only integers that have rational square roots are perfect squares.  It hinges on unique factorization.  You can show that $n$ is a perfect square if and only if each prime in its prime factorization appears an even number of times.  For example, $$144 = 2^4 \cdot 3^2 = (2^2 \cdot 3)^2 = 12^2$$ while $12 = 2^2 \cdot 3$ is not a perfect square.  If $n$ is not a perfect square, then some prime in its factorization must appear an odd number of times.  Suppose $n$ is not a perfect square and $$\sqrt{n} = \frac{r}{s}$$ where $r, s$ are integers with $s \neq 0$.  Then 
\begin{align*}
n & = \frac{r^2}{s^2}\\
ns^2 & = r^2   
\end{align*}
If $p$ is a prime that appears in the prime factorization of $n$ an odd number of times, then its appears in the prime factorization of $ns^2$ an odd number of times, while it appears in the prime factorization of $r^2$ an even number of times, a contradiction of unique factorization.  
A: If a and b is odd then $a^2= 1(mod 4)$. Thus, if a,b are odd, $a^2 +b^2 =2 (mod 4)$. If c is even,then $ c^2=0 (mod4)$. If c is odd, $c=1 (mod4)$. Therefore, $a^2 +b^2$ cannot be a perfect square, which implies that its square root is irrational.
A: Suppose $c^2 = (2a+1)^2+(2b+1)^2=4a^2+4a+1+4b^2+4b+1=4(\ldots)+2$. So it's an even number not divisible by $4$.
But if $c^2$ is divisible by $2$, then $c$ has to be even and therefore $c^2$ is divisible by $4$. This proves it can't be a square of an integer.
If $c$ were rational, but not an integer, then $c^2$ is also a rational number which isn't an integer, so we don't need to worry about that.
A: I Think there is an answer to this here, since I posted a comment which explains the question in a line: prove that the sum of two odd perfect squares can never be a perfect square.
This one is similar to the one that Yves Daoust posted.
We will obtain a result: 2 * [odd number]. Even if we assume the odd number to be a perfect square, we have a 2 over there.
Thanks,
S Sandeep.
