Diophantine parametrization, can replace $5$ by some other number? I'm reading a paper that says that the solutions to this Diophantine system can be parametrized (system and parametrization below):$$u^2 - 5x^2 = y^2, \quad u^2 - x^2 = v^2.$$They say that every solution is of the form$$u = p^2 + 5q^2, \quad x = 2pq,$$$$u = m^2 + n^2, \quad x = 2mn.$$(The second is just the Pythagorean parametrization.) But they just say this comes from "methods expounded in standard number theory textbooks".
I'm interested in whether the parametrization still holds if we replace $5$ by some other number. But I can't find a reference for the proof.
Any way to prove this/any book you can direct me to?
Thanks!
 A: These are two separate equations, and the two solutions given are basically correct.
For the first, $y=(p^2-5q^2)$
The second, as you say, is just a Pythagorean tripe, but $x$ could just as well be $m^2-n^2$
As to "can you replace the 5", in all three places, for the first equation, why not try it and see?
Update 17/9/2016
To prove that a parametric solution to the first equation is as given just calculate
$$(p^2+5q^2)^2-(p^2-5q^2)^2-5(2pq)^2$$
to show it’s $0$
Similarly, when you replace 5 by $w$ 
$$(p^2+wq^2)^2-(p^2-wq^2)^2-w(2pq)^2 = 0$$
(Sorry, I can’t find the identically equal code.)
As it’s a homogeneous equation, we can add a linear factor, giving a parametric solution to $u^2-wx^2=y^2$ as
$$y = k(p^2+wq^2)$$
$$u = k(p^2-wq^2)$$
$$x = 2kpq$$
Proof is longwinded, basically assuming a solution $(a,b,c)$ to $u^2-wx^2=y^2$ then showing it leads to this result.
Proof for the Pythagorean triple formula is given, for example, in Number Theory, J Hunter, Oliver & Boyd, 1964.
A: Rather than using "methods expounded in standard number theory textbooks" (perhaps along the usual determination of the Pythagorean triples?), and because your diophantine equations are homogeneous in $x, y, u, v$ , I prefer to put $X = x/u, Y = y/u, V = v/u$ . Then the original system is equivalent to the following system of two rational equations $ V^2 + X^2 = 1 , Y^2 + 5X^2 = 1$, which can easily be solved using Galois theory, more precisely Hilbert's theorem 90: in a cyclic extension of fields $L/K$, the elements of $L$ which have norm $1$ are exactly of the form $z/s(z)$, where $s$ is a generator of $Gal(L/K)$. 
The first equation above reads $N(V + iX) = 1$, where $N$ is the norm of the quadratic extension $\mathbf Q(i)/\mathbf Q$ , with $i^2 = -1$ . Hilbert's 90 can be applied, taking $s$ = complex conjugation.  By mere identification, one gets $u = m^2 + n^2 , v = m^2 - n^2 , x = 2mn$. Similarly, by applying Hilbert's 90 to $\mathbf Q(\sqrt-5)/\mathbf Q$ , one gets $u = p^2 + 5q^2 , y = p^2 - 5q^2 , x = 2pq$, as announced . So the answer to your question is YES, the same method can be applied to obtain the same type of parametrization  when 5 is replaced by any positive integer. 
