I want to solve the following quadratic Diophantine equation:
$$\frac{x(x-1)}{y(y-1)}=\frac{p}{q} \hspace{5 mm}, \hspace{5 mm}p\le q$$ For $p=1$ and $q=2$, it is easy to solve.
Let $y=x+z$. Then after some simplification we get
$x^2-(2z+1)x-(z^2-z)=0$
For integral solution, the discriminant of this equation must be a whole square. Hence
$8z^2+1=k^2$
Now it is a standard Pell's equation which can easily be solved. But for arbitrary $p$ and $q$, using similar approach I get
$(2pz+q-p)^2+4p(q-p)(z^2-z)=k^2$
I am stuck here. Can someone help me?
Here's a broad solution in integers. Given,
$$\frac{x(x-1)}{y(y-1)}=\frac{p}{q}\tag1$$
All you do is directly solve $(1)$ as a quadratic in $x$ and make its discriminant a square. After some manipulation, I find,
$$x = pv(u+qv)$$
$$y = qv(u+pv)$$
and $u,v$ solve,
$$u^2-pqv^2 = \color{red}-1\tag2$$
Or,
$$x = pv(u+qv)+1$$
$$y = qv(u+pv)+1$$
and $u,v$ solve,
$$u^2-pqv^2 = 1\tag3$$