0
$\begingroup$

My code returns this result involves trigonometric functions,

ComplexExpand[Sqrt[a + b I], TargetFunctions -> {Re, Im}]
Assuming[{a > 0, b > 0}, FullSimplify@ReIm@Refine@%]

enter image description here

In fact, it can be rewrie by radical form, following is the equivalently result from Maple enter image description here

How can I get the radical form result with Mathematica?

$\endgroup$
  • 1
    $\begingroup$ Assuming[{a > 0, b > 0}, FullSimplify[Through@{Re, Im}@Refine@%, ComplexityFunction -> (100 Count[#, _ArcTan, {0, Infinity}] + LeafCount[#] &)]]? $\endgroup$ – kglr May 25 '18 at 7:56
1
$\begingroup$

Not what you expect, but as a possibility, if nothing else pops up:

eq1 = Sqrt[a + b I] == x + I*y;
eq2 = Map[#^2 &, eq1] // Expand;
eq3 = eq2 /. Complex[0, n_] -> 0
eq4 = Equal @@ MapThread[Subtract, {List @@ eq2, List @@ eq3}] // 
  Simplify

(*   a == x^2 - y^2

b == 2 x y    *)

Then

Solve[{eq3, eq4}, {x, y}] // Simplify

(*  {{x -> -(Sqrt[a - Sqrt[a^2 + b^2]]/Sqrt[2]), 
  y -> (Sqrt[a - Sqrt[a^2 + b^2]] (a + Sqrt[a^2 + b^2]))/(
   Sqrt[2] b)},...   *)

Have fun!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.