When is the sum of two squares the sum of two cubes When does $a^2+b^2 = c^3 +d^3$ for all integer values $(a, b, c, d) \ge 0$. I believe this only happens when: $a^2 = c^3 = e^6$ and $b^2 = d^3 = f^6$. With the following exception:


*

*$1^3+2^3 = 3^2 + 0^2$


Would that statement be correct?
Is there a general formula for when this happens?

Let $c=x^2,d=y^2,i=\sqrt{-1}$, then $$c^3+d^3=x^6+y^6=(x^3-(yi)^3)(x^3+(yi)^3)\\
=(x-yi)(x^2+xyi-y^2)(x+yi)(x^2-xyi-y^2)$$
Let $a+bi=(x-yi)(x^2-xyi-y^2),a-bi=(x+yi)(x^2+xyi-y^2)$, then $a^2+b^2=c^3+d^3$.
We get $a=x^3-2xy^2,b=y^3-2x^2y,c=x^2,d=y^2.$
If $a<0$ or $b<0$, we can take the absolute value.
For example, let $x=1,y=2$ we get $a=-7,b=4,c=1,d=4$ hence $7^2+4^2=1^3+4^3,$
let $x=3,y=2,$ we get $a=3,b=-28,c=9,d=4$ hence $3^2+28^2=9^3+4^3.$
