Can two perfect squares average to a third perfect square? [duplicate]

$$ \frac{1 + 49}{2} = 25$$

There are infinitely many solutions to $x^2 + y^2 = 2 z^2.$ I am pretty sure that version has been asked on MSE before, and formulas giving all integer answers were given. Give me a few minutes, I will find that or do it over.

here is a recent discussion Diophantine Equations : Solving $a^2+ b^2=2c^2$


Parametric solution: $$ a = |x^2 - 2 x y - y^2|, \ b = x^2 + y^2,\ c = x^2 + 2 x y - y^2 $$


If $b^2=|x+iy|^2$, then $2b^2=|(1+i)(x+iy)|^2$, so all you need to get rolling are Pythagorean triples (written here as $b^2=x^2+y^2$).


This is an off-the-wall answer/consequence but I think it's interesting.

Consider the equation $$x^2 + y^2 = 2z^2$$ this can be rewritten as $$(x + z)(x - z) = (z + y)(z - y).$$

Let $A = x + z, \quad B = x - z, \quad D = z + y, \quad C = z - y.$

Also let $P = AB = CD.$

Note that

\begin{align} (\xi + A)(\xi - B) &= \xi^2 + 2z\xi - P\tag{1}\\ (\xi + C)(\xi + D) &= \xi^2 + 2z\xi + P\tag{2}\\ \end{align}

This implies that each of the four polynomials $\xi^2 \pm 2z\xi \pm P$ is factorable over the set of integers.

Further, if $A, B, C, $ and $ D$ that solve $(1)$ and $(2)$ can be found, then

$$ x = \frac 1 2 (A + B), \quad y = \frac 1 2(D - C), \quad z = \frac 1 2(A - B) = \frac 1 2(C + D)$$

Actually, $x, y, $ and $z$ as show above will usually come out to be multiples of $\frac 1 2.$ If that is the case, then you have to use $2x, 2y, $ and $2z$.

I have a heuristic for remembering how to find values of $A, B, C, $ and $ D.$ Choose any two relatively prime, opposite-parity numbers $ n > m$ and fill in the following table.

\begin{array}{|c|c|c} \hline n & n+m & A = n(n+m) \\ \hline n-m & m & B = m(n-m) \\ \hline C = n(n-m) & D = m(n+m) & \end{array}

It follows that $$x = \dfrac{n^2 - m^2}{2} + mn, \quad y = \dfrac{n^2 - m^2}{2} - mn, \quad z = \dfrac{n^2 + m^2}{2}$$

To show what this is like with some numbers, let n = 3 and m = 2. We get

\begin{array}{|c|c|c} \hline 3 & 5 & A = 15 \\ \hline 1 & 2 & B = 2 \\ \hline C = 3 & D = 10 & \end{array}

We see that \begin{align} (\xi + 15)(\xi - 2) &= \xi^2 + 13\xi - 30\\ (\xi + 3)(\xi + 10) &= \xi^2 + 13\xi + 30\\ \end{align}

And, doubling our answers, $ 2x = 17, \quad 2y = 7, \quad 2z = 13$

And we see that $x^2 + y^2 = z^2$

To augment the answer of Álvaro Lozano-Robledo, I add this picture. proof without words

Which generalizes to

this