The problem is as below:
Solve all solutions to $x^2+\dfrac{p}{q}(xy)+y^2=z^2$ for $x$, $y$, $z\in\mathbb{Q}$ and $p$, $q\in\mathbb{N}$ with $\gcd{(p,q)}=1$.
My attempt: Noticing that for a Diophantine Equation $x^2+axy+y^2$, it's solution is given by:
\begin{equation*} \begin{split} x&=k(an^2-2mn) \\ y&=k(m^2-n^2) \\ z&=k(amn-m^2-n^2). \\ \end{split} \end{equation*}
By multiplying the whole equation with $q^2$ gives $(qx)^2+pqxy+(qy)^2=(qz)^2$. And I'm stuck from here.
Can someone please help? This seems like an interesting problem.
$$x^2+\dfrac{p}{q}(xy)+y^2=z^2$$
Let $X = \dfrac xz$ and $Y = \dfrac yz$.
$qX^2 + pXY + qY^2 =q$
A solution is $(X, Y) = (1,0)$
So consider a solution of the form $$Y = \dfrac st( X - 1)$$
a line with rational slope which passes through a known solution.
We find\begin{align} qX^2 + pXY + qY^2 &= q \\ qX^2 + p \dfrac st X(X - 1) + q\dfrac{s^2}{t^2}(X^2 - 2X + 1) &= q \\ \left( q + p \dfrac st + q\dfrac{s^2}{t^2} \right)X^2 + \left(-p\dfrac st - 2q\dfrac{s^2}{t^2}\right)X + \left( q\dfrac{s^2}{t^2} - q \right) &= 0 \\ (qt^2 + pst + qs^2)X^2 + (-pst - 2qs^2)X + (qs^2 - qt^2) &= 0 \end{align}
We know that $X = 1$ is a solution. So $X-1$ must be a factor. Dividing by $X-1$ we get $(qt^2 + pst + qs^2)X + (qt^2 - qs^2) = 0$
So $X = \dfrac{qs^2 - qt^2}{qs^2 + pst + qt^2}$ and $Y = \dfrac{-ps^2 - 2qst}{qs^2 + pst + qt^2}$
Hence $(x,y,z) = (qs^2 - qt^2, -ps^2 - 2qst, qs^2 + pst + qt^2)$