# Is there a parametrization for $a^2+2b^2=c^2$ (analoguous to that for pythagorean triples)?

In looking at solutions for the currently occuring 3x3-magic-squares-of-squares problem I ran into the question how I can parametrize $$a^2 + 2b^2 = c^2$$ where $a,b,c$ are parametrizable like in the problem of finding all pythagorean triples, where we have $a=f(n,m),b=f(n,m),c=f(n,m)$ with $n,m \in \Bbb N$ with few additional conditions on $n,m$ like coprimality (I've just looked at the wikipedia entry for pythagorean triples).

I've at the moment not even an idea for an ansatz to that question, but because I'll have later the problem of getting three square terms on the lhs, I'd like to get help for an initial idea, how to approach that. (Surely I could try pattern-detection based on long lists of examples, but possibly this is essentially easy...)

Just for a bit more background: the final problem for me is, to find a solution in squares in a set of three or four term equations of quadratics - or to arrive at that there is no solution possible. Basic condition: all unknowns must be different.

The first two three-term-equations can be solved by the asked parametrization of $-2e^2+1i^2=a^2$ and $-2e^2+1h^2=b^2$ where of course the $e$ are meant to be equal, and to have different solutions for $a$ and $b$ the unknown $e$ must have a structure of $2nm =2n'm'$ where $n \ne n'$ , so must contain at least 3 primefactors. Here is the set of equations:

$$\small \begin{array}{r} e²&h²&i²&&&\\ *&*&*&&&\\ \hline -2&0&1&&=&a²&& \text{three-term equations}\\ -2&1&0&&&b²\\ \hline -1&1&1&&=&c²&& \text{four-term equations}\\ -2&1&2&&&d²\\ 4&-1&-2&&&f²\\ 3&-1&-1&&&g²\\ \end{array}$$

• $$X^2+aY^2=Z^2$$ $$X=p^2-as^2$$ $$Y=2ps$$ $$Z=p^2+as^2$$ – individ Oct 10 '16 at 8:48
• Ah, that was sort of lightning answer, thank you very much. Just tried a handful of examples. Is the set of solutions complete for all $p,s>0$? – Gottfried Helms Oct 10 '16 at 8:57
• For this equation, all decisions of the formula are described. You can then reduce to a common divisor. – individ Oct 10 '16 at 9:01
• We'll have to do too much. Unknown small and the equation to solve fail. My friend on the squares specializes. Ask her a question in the subject line. mathhelpplanet.com/… Or is there a number of open topic. – individ Oct 10 '16 at 10:53
• dear individ - no problem, I can take your input into an answer box. Concerning the link to mathhelpplanet.com Unfortunately I can't read russia so I can't ask for help there, but thanks anyway! – Gottfried Helms Oct 10 '16 at 11:18

The following could possibly serve as a factorization for odd $n$ and even $m$: $$a = \frac{|m^2-2n^2|}{2} ; b = mn; c = \frac{m^2+2n^2}{2}$$

For example, you could take $m=4;n=3$ to get $1^2 + 2\cdot 12^2 = 17^2$.

The integer solutions of $a^2+2b^2=c^2$ correspond to rational points on the curve $x^2+2y^2=1$.
$(1,0)$ is a rational point on such ellipse $\Gamma$: if we consider a line through $(1,0)$ with rational slope, the other intersection with $\Gamma$ is a rational point by Vieta's theorem. On the other hand, a line through two distinct rational points on $\Gamma$ clearly has a rational slope, hence all the rational points on $\Gamma$ are given by the solutions of $$\left\{\begin{array}{rcl}x^2+2y^2 &=& 1\\ m(x-1)+y &=& 0\end{array}\right.$$ for $m\in\mathbb{Q}$. That leads to $x=\frac{2m^2-1}{2m^2+1}, y=\frac{2m}{2m^2+1}$, hence $$a = 2p^2-q^2,\quad b=2pq,\quad c=2p^2+q^2$$ is a parametrization of the primitive integer solutions of $a^2+2b^2=c^2$.
There is a unified approach to the parametrization of all the solutions of all the diophantine equations of the form $a^2 + db^2 = c^2 , d\in \mathbf N$, including in particular (see e.g. https://math.stackexchange.com/a/1959297/300700) the pythagorean triples. Since the given diophantine equation is homogeneous, it is equivalent to the rational equation $A^2 + dB^2 = 1$. Appeal then to Hilbert's theorem 90, which describes elements of norm $1$ in a cyclic extension $L/K$ with Galois group $<s>$ : $N_{L/K} (x) = 1$ iff $x$ is of the form $x = y/s(y)$. Here take $K = \mathbf Q , L = \mathbf Q (\sqrt {-d})$, $s$ = complex conjugation, $x = A + i\sqrt d B$, with $i^2 = -1$. Then $x$ is of the form $(M +i\sqrt d N) / (M -i\sqrt d N)$ , hence, by mere identification, $A = (M^2 - dN^2)/(M^2 + dN^2) , B = 2 MN/(M^2 + dN^2)$. Or, coming back to the diophantine equation, $a =m^2 - dn^2 , b = 2 mn , c = m^2 + dn^2$, with $m , n \in \mathbf Z$ (these are also the solutions given by @individ).
Of course this approach remains valid for the diophantine equation $a^2 - db^2 = c^2$ , but in this case we know moreover that the solutions of the Pell-Fermat equation $a^2 - db^2 = 1$ form a cyclic multiplicative group thanks to Dirichlet's unit theorem for the quadratic field $\mathbf Q (\sqrt {d})$.