On the complete solution to $x^2+y^2=z^k$ for odd $k$? While trying to answer this question, I was looking at a computer output of solutions to $x^2+y^2 = z^k$ for odd $k$ and noticed certain patterns. For example, for $k=5$ we have $x,y,z$,
$$10, 55, 5\\25, 50, 5\\38, 41, 5\\117, 598, 13\\122, 597, 13\\338, 507, 13\\799, 884, 17$$
Question: Is it true that all integer solutions to $x^2+y^2=z^k$ for odd $k>1$ are given by just two formulas, namely,


*

*Primitives $\gcd(x,y)=1$:
$$A^2+B^2 = (a^2+b^2)^k\tag1$$
where $A,B$ is the expansion of $(a+bi)^k = A+Bi$. Example, $$(a+bi)^3 =(a^3 - 3 a b^2)+ (3 a^2 b - b^3)i$$ hence, $$(a^3 - 3 a b^2)^2+ (3 a^2 b - b^3)^2 = (a^2+b^2)^3$$ and so on for other $k$.

*Non-primitives $\gcd(x,y)\neq1$:
$$a^2(a^2+b^2)^{k-1}+b^2(a^2+b^2)^{k-1} = (a^2+b^2)^k\tag2$$
where, for both Forms $1$ and $2$, we use some rational $a,b$?


Example. The first three solutions for $k=5$ above use:
$$a,b = 2/5,\;11/5\quad \text{Form 2}$$
$$a,b = 1,\;2\quad \text{Form 2}$$
$$a,b = -2,\;1\quad \text{Form 1}$$

If $x^2+y^2=z^k$, then $(x+iy)(x-iy)=z^k$. The Gaussians are a UFD, so if $\gcd(x+iy,x-iy)=1$ then this forces $x+iy=(r+si)^k$ for some integers $r$ and $s$. I think this is your form 1. 
If there exists $d$ dividing both $x+iy$ and $x-iy$, then $d$ must divide their sum, $2x$, and their difference, $2iy$. So if $x$ and $y$ are relatively prime, then $d$ is nontrivial if and only if $x$ and $y$ are both odd, and $d=1+i$. But if $x$ and $y$ are odd, then $x^2+y^2\equiv2\bmod4$, while $z^k\equiv0\bmod4$, contradiction. 
So we're left with the case where there is an integer $d>1$ dividing both $x$ and $y$. To be continued....
