4

After FullSimplify, Mathematica usally gives some coefficients like

((-1)^(1/5)) 

But I don't want this form, I want

E^(I/5 π)

But

(-1)^(1/5) /. -1 -> E^(I π)

is not working.

So how to transform power of -1 into exponential form?

PS

I also want to transform -1 into E^[I π]

matheorem
  • 17,132
  • 8
  • 45
  • 115

3 Answers3

6
PowerExpand[(-1)^(1/5), Assumptions -> True]

enter image description here

Assumptions -> True is necessary here, which is documented in PowerExpand.

ybeltukov
  • 43,673
  • 5
  • 108
  • 212
4

Here is a function JM wrote for this task.

polarForm[z_] := 
 Module[{rt, f}, If[Im[z] == 0 && Positive[Re[z]], Return[z]];
  rt = Through[{Abs, Arg}[z]];
  f = Which[rt[[1]] == 1, Defer[E^(I #2)] &, rt[[2]] == 1, 
    Defer[#1 E^I] &, True, Defer[#1 E^(I #2)] &]; f @@ rt]

For example:

polarForm[1 + I]

Sqrt[2] E^((I π)/4)

polarForm[-1]

E^(I π)

polarForm[(-3)^(1/5)]

3^(1/5) E^((I π)/5)
bill s
  • 68,936
  • 4
  • 101
  • 191
3

A simple replacement is

(-1)^(1/5) /. z_ :> Abs[z]*Exp[I*Arg[z]]

E^((I*Pi)/5)

While equivalent for the specific example of (-1)^(1/5), this approach is more general than PowerExpand. For example

n = 5; 
Prepend[
  Table[{
    x = (-3)^(m/n),
    PowerExpand[x, Assumptions -> True],
    x /. z_ :> Abs[z]*Exp[I*Arg[z]]},
   {m, n - 1}],
  {"x", "PowerExpand", "Rule"}] //
 Grid[#, Frame -> All] &

enter image description here

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198