[Date Index] [Thread Index] [Author Index]
Re: ComplexExpand confusion
mike_in_england2000 at yahoo.co.uk wrote: > Hi > > The Mathematica help system says that > > "ComplexExpand[expr] expands expr assuming that all variables are > real." > > which is fine and explains why expressions such as > ComplexExpand[Conjugate[x +I y]] work.All seems obvious so far. > > What is confusing me though is why does > > ComplexExpand[(-1)^(1/4)] > > give the result > > (1 + I)/Sqrt > > I know this the correct result but in the expression (-1)^(1/4) there > are no variables. The numbers involved are real so what on earth is > ComplexExpand doing? Is this a stupid question? Should I have drank > more coffee before posting this. > > Thanks > Mike > ??? Hi Mike, I guess that the problem is about what the term ?variables? means. In Mathematica, the notion of variable is broader than in mathematics and in computer sciences: a variable can hold a value (x = 12 for example, CS meaning), can be a variable within a function (f(x):=12, a constant function), but it can be any expression that return a value (similar concept in LISP/Scheme family of languages) (f(g(x)) for instance, g(x) is a ?variable?, as well as x and f). So here you can think of (-1)^(1/4) as a ?constant? variable/function that returns its own value. Best regards, /J.M.