Complex numbers of the form $a+\imath b$ with $a,b \in \mathbb{Z}$ are called Gaussian integers.
Here we will consider the problem of finding Gaussian integers that are "perfect squares". For example, we are interested in when the result $\sqrt{a+\imath b}$ is still a Gaussian integer.
The problem is solved for example in W. Sierpinski (chapter XIII is dedicated to Gauss integers), page 450, Problem 4. We see that this problem is related to Pythagorean triples. This problem is not completed, unlike Problem 2 about representing as sums of two squares.
What is said here is only a necessary and sufficient condition that solves our problem :
"The complex integer $a+\imath b$ is the square of a complex integer if and only if
$a^2+b^2=c^2,\;\;\;c+a=2x^2,\;\;\;c-a=2y^2$
where $c$ is a natural number and $x,\;y$ are rational integers. Then
$a+\imath b=(\pm x\pm y\imath)^2$
the sign should be identical if $b>0$ and opposite if $b<0$."
So the perfect squares in the set of Gauss integers are related to the solutions of the equation of Pythagorean numbers. As shown in another post, for the numbers $a$ and $b$ we have the possibilities :
$a=d\cdot 2st,\;\;b=d\cdot (s^2-t^2) \tag{1}$
$a=d\cdot (s^2-t^2),\;\;b=d\cdot 2st \tag{2}$
where $d\in \mathbb{Z}$ and $s,\;t$ are coprime integers of opposite parity.
In the first case $c+a=d\cdot (s^2+t^2)+d\cdot 2st=d\cdot (s+t)^2$, and $c-a=d\cdot (s^2+t^2)-d\cdot 2st=d\cdot (s-t)^2$. Hence
$\frac{c\pm a}{2}=\frac{d}{2}\cdot (s \pm t)^2 \tag{3}$
In the second case $c+a=d\cdot (s^2+t^2)+d\cdot (s^2-t^2)=2ds^2$, and $c-a=d\cdot (s^2+t^2)-d\cdot (s^2-t^2)=2dt^2$, hence
$\frac{c+a}{2}=d\cdot s^2,\;\; \frac{c-a}{2}=d\cdot t^2 \tag{4}$
So for $\frac{c\pm a}{2}$ to be perfect squares, $d$ must be $2\alpha^2$ in (3) and $\alpha^2$ in (4).
Answer CiP: The perfect squares in the set of Gaussian integers are
$4\alpha^2st+2\alpha^2(s^2-t^2)\imath=\left ( \pm\alpha[(s+t)+(s-t)\imath]\right )^2$
$\alpha^2(s^2-t^2)+2\alpha^2st \imath=\left (\pm \alpha [s+t\imath] \right )^2$
where $\alpha \in \mathbb{Z}$, and $s,t$ are coprime integers of opposite parity.
Examples CiP
$3+4\imath=(2+\imath)^2=(-2-\imath )^2$ : $3^2+4^2=5^2,\;\frac{5\pm 3}{2}\in \{4,\;1\}$
$2\imath=(1+\imath)^2=(-1-\imath)^2$ : $0^2+2^2=2^2,\;\frac{2\pm 0}{2}=1$
$5\pm 12 \imath=(3\pm 2\imath)^2$ : $5^2+12^2=13^2,\;\frac{13\pm 5}{2}\in \{9,\;4\}$
$12\pm 5\imath \neq perfect\;squares$ : $12^2+5^2=13^2$ although $\frac{13\pm 12}{2}\in \left \{\frac{25}{2},\;\frac{1}{2}\right \}$
$24\pm 10\imath=(5\pm \imath)^2$ : $24^2+10^2=26^2,\;\frac{26\pm 24}{2}\in\{25,\;1\}$



.png)




