Solving the complex equation $z^2=1+2\,i$ using
Solve[z^2 == 1 + 2 I]
returns $\left\{\left\{z\to -\sqrt{1+2\,i}\right\},\left\{z\to\sqrt{1+2\,i}\right\}\right\}$, but how do I force Mathematica to always output on the form $a+b\,i$, $a,b\in\mathbb{R}$? Or, if there is no output form from Solve
to do this, to convert/transform the answer to the $a+b\,i$ form?
I tried
z = a + b I;
Solve[{z^2 == 1 + 2 I, {a, b} ∈ Reals}, {a, b}]
which returns
$$\left\{\left\{a\to-\sqrt{\frac{1}{2}\left(1+\sqrt{5}\right)},b\to\sqrt{\frac{1}{2}\left(1+\sqrt{5}\right)}-\frac{\left(1+\sqrt{5}\right)^{3/2}}{2\sqrt{2}}\right\},\left\{a\to \sqrt{\frac{1}{2}\left(1+\sqrt{5}\right)},b\to\frac{\left(1+\sqrt{5}\right)^{3/2}}{2\sqrt{2}}-\sqrt{\frac{1}{2}\left(1+\sqrt{5}\right)}\right\}\right\}$$ but don't think it's a very elegant (and short) way to solve the equation.
One solution is, in its best presentation
$$z_1=\sqrt{\frac{1+\sqrt{5}}{2}}+i\sqrt{\frac{2}{1+\sqrt{5}}}$$
Can this be output from Solve
(or transformation of the output from Solve)?
Solve[z^2 == 1 + 2 I] // ComplexExpand // FunctionExpand
gets you pretty close. $\endgroup$ – Bill Watts Sep 9 '18 at 23:57