Diophantine equation. Three.

There are solutions with $(x,y)\ne (0,0)$ for every $q\ne 0$. To see this, recall that the equation $x^2+y^2=w$ has a non-trivial solution if the prime power factorization of $w$ has all primes of the form $4k+3$ appearing to an even power. So if some prime $p$ of the form $4k+3$ appears to an odd power in the prime power factorization of $q$, we just pick $z$ with $p$ appearing to an odd power in the prime power factorization of $z$.


For the equation: $$X^2+qY^2=Z^3$$

You can write this simple solution:

$$X=(p^2+qs^2)((p^4-q^2s^4)t^3-3(p^2+qs^2)^2kt^2+3(p^4-q^2s^4)tk^2-(p^4-6qp^2s^2+q^2s^4)k^3)$$

$$Y=2ps(p^2+qs^2)((p^2+qs^2)t^3-3(p^2+qs^2)tk^2+2(p^2-qs^2)k^3)$$

$$Z=(p^2+qs^2)((p^2+qs^2)t^2-2(p^2-qs^2)tk+(p^2+qs^2)k^2)$$

$q - $The ratio is given for the problem.

$p,s,t,k - $ integers asked us.