MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: More strange behavior by ComplexExpand


On 22 Sep 2005, at 15:08, Andrzej Kozlowski wrote:

> This expression is completely correct. ComplexExpand is allowed to
> return imaginary numbers in its output, even if the input is real.

It has occured to me that this may not be so obvious so perhaps it  
might be a good idea to illustrate it. In Raul's case the expression  
to which ComplexExpand was applied was not actually "real": it was  
only real when the parameter a was assumed to be positive. But  
ComplexExpand may produce a seemingly complex expression even when  
applied to something that is unambiguously real, in fact even a  
numeric real. Here is an example:


ComplexExpand[1 - ArcTan[Sqrt[5]], TargetFunctions ->
    {Abs}]


1 - (1/2)*I*Log[1 - I*Sqrt[5]] +
   (1/2)*I*Log[1 + I*Sqrt[5]]

even though



ComplexExpand[Im[1 - ArcTan[Sqrt[5]]]]

0

I don't think this can happen with the default setting of  
TargetFunctions ->{Re,Im}  but still this illustrates can return  
seemingly non-real forms  even for purely real input (not just real  
parameters). (Of course I think this is just as it should be).

Andrzej Kozlowski 


  • Prev by Date: WORD document
  • Next by Date: Re: Bugs in Mathematica 5+
  • Previous by thread: Re: More strange behavior by ComplexExpand
  • Next by thread: Re: More strange behavior by ComplexExpand