# Thread: diophantine equation

1. ## diophantine equation

Find all solutions in positive integers of each Diophantine equation below.

a)

2. Originally Posted by bigb
Find all solutions in positive integers of each Diophantine equation below.

a)
Let $x^2 + 2y^2 = z^2$ be positive integers.
We can consider the case when $\gcd(x,y,z)=1$.
In such a case we require that $x,z \text{ odd }$ and $y \text{ even}$.
Another observation is that $\gcd(x,z)=1$.

Given two positive odd integers $x it turns out that either $4|(z+x)$ or $4|(z-x)$.
These will be our two cases to consider.

Case 1 $z+x \equiv 0 (\bmod 4)$: We can write $2y^2 = (z+x)(z-x)$ and so $2(\tfrac{y}{2})^2 = \left( \tfrac{z+x}{2} \right)\left( \tfrac{z-x}{2} \right)$
Notice that, $\gcd\left( \tfrac{z+x}{2},\tfrac{z-x}{2} \right) = 1$
Now write, $(\tfrac{y}{2})^2 = \left( \tfrac{z+x}{4} \right) \left( \tfrac{z-x}{2} \right)$ with $\gcd \left( \tfrac{z+x}{4}, \tfrac{z-x}{2} \right) = 1$
We have a situation when product of two relatively prime integers is a square, so each integer is a square.
This gives, $\tfrac{z+x}{4} = a^2 \text{ and }\tfrac{z-x}{2} = b^2 \implies z+x = 4a^2 \text{ and }z-x = 2b^2 \text{ with }\gcd(a,b)=1$
Solving this we get, $x = 2a^2 - b^2, ~ y=2ab, ~ z = 2a^2 + b^2$
Also, $(2a^2 - b^2)^2 + 2(2ab)^2 = (2a^2 + b^2)^2$
This shows that the parametric description of the equations above give us a complete list for solutions.

Case 2: $z-x\equiv 0(\bmod 4)$: We can write $2y^2 = (z+x)(z-x)$ and so $2(\tfrac{y}{2})^2 = \left( \tfrac{z+x}{2} \right)\left( \tfrac{z-x}{2} \right)$
Notice that, $\gcd\left( \tfrac{z+x}{2},\tfrac{z-x}{2} \right) = 1$
Now write, $(\tfrac{y}{2})^2 = \left( \tfrac{z+x}{2} \right) \left( \tfrac{z-x}{4} \right)$ with $\gcd \left( \tfrac{z+x}{2}, \tfrac{z-x}{4} \right) = 1$
This gives, $\tfrac{z+x}{2} = a^2 \text{ and }\tfrac{z-x}{4} = b^2 \implies z+x =2a^2 \text{ and }z-x=4b^2 \text{ with }\gcd(a,b)=1$
Solving this we get, $x= a^2 - 2b^2, ~ y=2ab, ~ z = a^2 + 2b^2$
Also, $(a^2 - 2b^2)^2 + 2(2ab)^2 = (a^2 + 2b^2)^2$
This shows that the parametric description of the equations above give us a complete list for solutions.

Case 1 and Case 2 can be combined by saying: $x=|a^2 - 2b^2|, ~ y=2ab, ~ z = a^2 + 2b^2$ as a complete list