How to solve the equation $‎x^2-2y=z^2$? Consider the following equation
$$‎x^2-2y=z^2,$$
according some theorems in my research, I found that the only integer solution of the equation such that $xy\neq 0$ is $$(x,y,z)=(2,2,0).$$ Now my question is: how to solve the equation (or what is the way or method)? Anyone can help me. Thanks in advance(
I tried to rewrite the equation as follows
\begin{align}
2y=x^2-z^2 ‎\Rightarrow 2y=(x-z)(x+z)‎\Rightarrow y=\frac{(x-z)(x+z)}{2}
\end{align}
but it did not work).
 A: Your rewrite to $y=\frac 12(x-z)(x+z)$ is exactly what you want.  You need $x$ and $z$ to have the same parity (both even or both odd) so the factors are even and the division by $2$ works.  Then you can choose any $x,z$ pair and compute $y$.  If you want positive integers, you must have $x \gt z$.  For example $(3,4,1)$ works.
A: 
Not a 'real' answer, but it was too big for a comment. I think that you're looking for a solution without using a calculator or PC but maybe this gives some insight. I did only a quick search with the following bounds: $-10\le x\le10$, $-10\le y\le10$, $-10\le z\le10$, and $x$, $y$, $z$ are all integers with $xy\ne0$.

I wrote and ran some Mathematica-code:
In[1]:=Clear["Global`*"];
FullSimplify[
 Solve[{x^2 - 2*y == z^2, 
   x*y != 0 && -10 <= x <= 10 && -10 <= y <= 10 && -10 <= z <= 
     10}, {x, y, z}, Integers]]

Running the code gives:
Out[1]={{x -> -6, y -> 10, z -> -4}, {x -> -6, y -> 10, z -> 4}, {x -> -5, 
  y -> 8, z -> -3}, {x -> -5, y -> 8, z -> 3}, {x -> -4, y -> -10, 
  z -> -6}, {x -> -4, y -> -10, z -> 6}, {x -> -4, y -> 6, 
  z -> -2}, {x -> -4, y -> 6, z -> 2}, {x -> -4, y -> 8, 
  z -> 0}, {x -> -3, y -> -8, z -> -5}, {x -> -3, y -> -8, 
  z -> 5}, {x -> -3, y -> 4, z -> -1}, {x -> -3, y -> 4, 
  z -> 1}, {x -> -2, y -> -6, z -> -4}, {x -> -2, y -> -6, 
  z -> 4}, {x -> -2, y -> 2, z -> 0}, {x -> -1, y -> -4, 
  z -> -3}, {x -> -1, y -> -4, z -> 3}, {x -> 1, y -> -4, 
  z -> -3}, {x -> 1, y -> -4, z -> 3}, {x -> 2, y -> -6, 
  z -> -4}, {x -> 2, y -> -6, z -> 4}, {x -> 2, y -> 2, 
  z -> 0}, {x -> 3, y -> -8, z -> -5}, {x -> 3, y -> -8, 
  z -> 5}, {x -> 3, y -> 4, z -> -1}, {x -> 3, y -> 4, 
  z -> 1}, {x -> 4, y -> -10, z -> -6}, {x -> 4, y -> -10, 
  z -> 6}, {x -> 4, y -> 6, z -> -2}, {x -> 4, y -> 6, 
  z -> 2}, {x -> 4, y -> 8, z -> 0}, {x -> 5, y -> 8, 
  z -> -3}, {x -> 5, y -> 8, z -> 3}, {x -> 6, y -> 10, 
  z -> -4}, {x -> 6, y -> 10, z -> 4}}

So, using these bounds I get $36$ number of solutions. Extending the bounds to $-10^3$ and $10^3$ gives $12716$ number of solutions. Extending the bounds, again, to $-10^4$ and $10^4$ gives $173364$ number of solutions.
A: Write
$$
x^2-z^2=2y\tag 1
$$
Assume now that $d$ runs through all even divisors of $2y$. Then all  solutions  of (1) are (with given $y$):
$$
x=\frac{d}{2}+\frac{y}{d}\textrm{ and }z=-\frac{d}{2}+\frac{y}{d}\tag 2
$$
A: The original equation suggests that $x,y,z$ are components $C,B,A$ of a Pythagorean triple except the y-term is not generated directly. We will accept $2y=B^2$.
$$x^2-2y=z^2\implies x^2=2y+z^2$$
There are infinite solutions. One method of generating them is with Euclid's formula (modified):
$$ z=A=m^2-k^2\qquad y=\frac{B^2}{2}=\frac{(2mk)^2}{2}=2(mk)^2\qquad x=C=m^2+k^2$$
where $m>1$ and $m>k$. Since we do not care about primitives, we can ignore the normal restriction of $GCD(m,k)=1$.
What this means is that, for any Pythagorean triple such as $(A,B,C)=(3,4,5)$, the solution we seek will be
$(C,\frac{B^2}{2},A)=(5,8,3)\quad$ or $\quad (5,12,13)\rightarrow (13,72,5)\quad$ or $\quad (15,8,17)\rightarrow (17,32,15)$
Another formula which generates only non-trivial positive $A,B,C$ components is
$$A=(2n-1)^2+2(2n-1)k\quad B=2(2n-1)k+2k^2\quad C=(2n-1)^2+2(2n-1)k+2k^2$$
This one works with any pair of natural numbers $n,k$ and generates only primitives and odd square multiples of primitive Pythagorean triples. The translation is the same for either formula: $(x,y,z)=(C,\frac{B^2}{2},A)$
Here is a list of $x,y,z$ where $x<100$
$$
(5,8,3)\\ 
(13,72,5)\quad 
(17,32,15)\quad 
(25,288,7)\quad 
(29,200,21)\quad 
(37,72,35)\quad 
(41,800,9)\\
(45,648,27)\quad 
(53,392,45)\quad 
(61,1800,11)\quad 
(65,128,63)\quad 
(65,1568,33)\\ 
(73,1152,55)\quad
(85,3528,13)\quad 
(85,648,77)\quad 
(89,3200,39)\quad 
(97,2592,65) $$
Given Pythagorean triple properties, we can expect $z$ to be a multiple of any odd number greater than one. Also, since $B$ can be any odd multiple of $4, B=4r\implies y=8r^2, r\in\mathbb{N}$. Not all combos will work but those that do work will be of this form.
