Parametrization of $x^2+ay^2=z^k$, where $\gcd(x,y,z)=1$ $x,y,z$ be three coprime integers, $a \in \mathbb{Z}&gt;0$ and $k$ an odd integer. How do I find all the non-trivial solutions of the diophantine equation? $$x^2+ay^2=z^k$$
Does the method which consists in assuming that: $$x^2+ay^2=(p^2+aq^2)^k$$ (where $p,q$ are two coprime integers) provide the general parametrization?
well, no. If $k$ divides the order of the class group, there will be others. For example, along with $x^2 + 11 y^2,$ we also have $3x^2 + 2xy+4y^2$ and $3x^2 - 2xy+4y^2.$ The class group has order 3, and any number $n,$ including but not limited to primes, that has a primitive expression $n = 3 x^2 + 2xy+4y^2,$ also has a primitive expression $$ n^3 = x^2 + 11 y^2. $$
The first few primes represented by $3x^2 + 2xy + 4 y^2$ are
$$    3,      5,     23,     31,     37,     59,     67,     71,     89,     97, $$
other numbers primitively represented include $4$ and $9.$

We find
$$ 27 = 16 + 11, $$
$$ 125 = 81 + 11 \cdot 4, $$
$$ 12167 = 54^2 + 11 \cdot 29^2, $$
$$ 64 = 16 + 11 \cdot 4, $$
$$ 729 = 25 + 11 \cdot 64, $$

Tuesday afternoon. Finding individual parametrizations can be left to Dirichlet's version of Gauss composition for binary quadratic forms. If I have a binary form $A x^2 + B xy + A^{k-1}y^2,$ it has order $k$ in its class group.  For example, using $3 x^2 + 8 y^2 + 9 y^2,$ we construct
$$  r = x^3 - 9 x y^2 - 8 y^3, $$
$$  s = 27 x^2 y + 72 x y^2 + 37 y^3, $$ the result (not the most appealing way to write it, I admit)
$$  27 r^2 + 8 rs + s^2 = (3x^2 + 8xy+9 y^2)^3. $$
One may adjust the left hand side by $s = t - 4 r,$ or $t = s+4r,$ to get $t^2 + 11 r^2.$ Not pretty, but deriving it is algorithmic and deterministic. 

For $t^2 + 47 r^2 = k^5,$ we may proceed with $3 x^2 + 28 xy + 81 y^2$ of order $5$ in its class group.

Went through it,
$$ (14x^5 + 405yx^4 + 3780y^2x^3 + 13410y^3x^2 + 11550y^4x - 14647y^5)^2 + 47  ( x^5 - 270y^2x^3 - 2520y^3x^2 - 8115y^4x - 8344y^5)^2 = (3   x^2 + 28  x  y + 81  y^2 )^5 $$

Below as it actually is done in gp-pari:

a=3; a1=3; b=28; c=27; z = x; w = y;

zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;

? a=3; a1=3; b=28; c=27; z = x; w = y;
? zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;
? z
%3 = x^2 - 27*y^2
? w
%4 = 6*y*x + 28*y^2

a1 = 9; c = 9; zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;

? a1 = 9; c = 9; zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;
? z
%6 = x^3 - 81*y^2*x - 252*y^3
? w
%7 = 27*y*x^2 + 252*y^2*x + 541*y^3

a1 = 27; c = 3; zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;
? a1 = 27; c = 3; zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;
? 
? z
%9 = x^4 - 162*y^2*x^2 - 1008*y^3*x - 1623*y^4
? w
%10 = 108*y*x^3 + 1512*y^2*x^2 + 6492*y^3*x + 8344*y^4

a1 = 81; c = 1; zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;


? a1 = 81; c = 1; zz = x * z - c * y * w  ;  ww = a * x * w + a1 * y * z + b * y * w; z = zz; w = ww;
? 
? z
%12 = x^5 - 270*y^2*x^3 - 2520*y^3*x^2 - 8115*y^4*x - 8344*y^5
? w
%13 = 405*y*x^4 + 7560*y^2*x^3 + 48690*y^3*x^2 + 125160*y^4*x + 102169*y^5
? 
? 243 * z^2 + 28 * z * w + w^2
%14 = 243*x^10 + 11340*y*x^9 + 244485*y^2*x^8 + 3200400*y^3*x^7 + 28137390*y^4*x^6 + 173498248*y^5*x^5 + 759709530*y^6*x^4 + 2333091600*y^7*x^3 + 4812198255*y^8*x^2 + 6026540940*y^9*x + 3486784401*y^10
? 243 * z^2 + 28 * z * w + w^2 - (3 * x^2 + 28 * x * y + 81 * y^2)^5
%15 = 0
? 

t = w + 14 * z

? t = w + 14 * z
%16 = 14*x^5 + 405*y*x^4 + 3780*y^2*x^3 + 13410*y^3*x^2 + 11550*y^4*x - 14647*y^5
? z
%17 = x^5 - 270*y^2*x^3 - 2520*y^3*x^2 - 8115*y^4*x - 8344*y^5
? 

t^2 + 47 * z^2 
? 
? t^2 + 47 * z^2
%18 = 243*x^10 + 11340*y*x^9 + 244485*y^2*x^8 + 3200400*y^3*x^7 + 28137390*y^4*x^6 + 173498248*y^5*x^5 + 759709530*y^6*x^4 + 2333091600*y^7*x^3 + 4812198255*y^8*x^2 + 6026540940*y^9*x + 3486784401*y^10
? 
? t^2 + 47 * z^2 -  (3 * x^2 + 28 * x * y + 81 * y^2)^5
%19 = 0
?
One approach is to write the General formula.  For the equation.

$$x^2+ay^2=z^{k}$$

The formula looks for simplicity without coprime solutions.  

$$x=(p^2-as^2)(p^2+as^2)^{k-1}$$

$$y=2ps(p^2+as^2)^{k-1}$$

$$z=(p^2+as^2)^2$$

After substituting numbers  $p,s - $  to reduce common divisor.

$x,y - $ in such a number. $d^k$

$z - $ in such a number. $d^2$