Prove the equation has infinitely many solutions 
Let $a,b$ be coprime integers. Show that the equation $ax^2+by^2=z^3$ has an infinite set of solutions $(x,y,z)$ with $x,y,z \in \mathbb{Z}$ and $x,y$ mutually coprime (in each solution).

I thought of doing like $x = a^4$ and $y = b^4$, but then we get $a^9+b^9 = z^3$, which has no solutions by Fermat's Last Theorem. I was trying to get it into a Pythagorean form such as $x^2+y^2 = z^2$, which we know has an infinite number of solutions, but I wasn't able to do that.
 A: $$ (A x^2 + B y^2)^3 = A (A x^3 - 3 B x y^2)^2 + B (3 A x^2 y - B y^3)^2   $$
We have
$$ U = (Ax^2 - 3By^2), \; \; \; V = (3Ax^2 - B^2).  $$
To begin with, we certainly need the restrictions
$$ \gcd(A,B) = 1, \gcd(x,y) = 1, \gcd(A,y) = 1, \gcd(B,x) = 1. $$
Getting there: the prime $2.$ If $A$ is odd but $B$ even, we must have $x$ odd. If $A$ is even but $B$ odd, we must have $y$ odd. 
If $A,B$ are both odd,  we must have $x + y$ odd. 
NEXT: the prime $3:$ just a minute... If $A$ is prime to $3$ but $3 | B,$ we must have $x$ prime to $3.$ If $B$ is prime to $3$ but $3 | A,$ we must have $y$ prime to $3.$ If both $A,B$ are prime to $3,$ we need nothing more than $\gcd(x,y) = 1,$ insofar as we already know $x,y$ are not both divisible by $3.$ 
Next we consider $$ \gcd(xU, yV).  $$
In particular, we consider a prime $p \neq 2,3,$ such that $$ p | \gcd(xU, yV).  $$
I see five cases: I am going to use the symbol $\perp$ to mean does not divide. Nope, we can use backslash nmid giving $\nmid $
(I) if $p|x,$ then $p \nmid y,  $ $p \nmid B,$ so $p \nmid yV.$
(II) if $ p | y,$ then $p \nmid x,$ $p \nmid A,$ so $p \nmid xU$
(III) if $p | A,$ then $ p \nmid y,$ $ p \nmid B,$ so $p \nmid yV$
(IIII) if $p | B,$ then $ p \nmid x,$ $ p \nmid A,$ so $p \nmid xU$
(IIIII) if $p | U$ and $p | V,$ then
$$ A x^2  \equiv 3 B y^2 \pmod p $$ and
$$ B y^2 \equiv 3 A x^2 \pmod p. $$
Therefore
$$ A x^2 \equiv 9 A x^2 \pmod p, $$
$$  8 A x^2 \equiv 0 \pmod p. $$
after case III, we conclude $x \equiv 0 \pmod p.$ After case IIII, we conclude $y \equiv 0 \pmod p.$ That is, $p | \gcd(x,y),$ which contradicts $\gcd(x,y) = 1.$
Apparently this was written first by Euler in 1770, where he complains that not all solutions can be found this way. Indeed, if the class number is divisible by three, and we have some form $e x^2 + f xy + g y^2$ whose cube in the class group is the identity, then the cube of any number primitively represented by this form is then represented primitively by the principal form. I get it: from his example, we can also use any form whose square in the class group is the identity. Such forms are traditionally called ambiguous. His example is $2x^2 - 5 y^2.$ Well, something to think about.

