MathGroup Archive 2010

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

Search the Archive

Re: Newby Q: How to specify reals

  • To: mathgroup at
  • Subject: [mg110545] Re: Newby Q: How to specify reals
  • From: Daniel Lichtblau <danl at>
  • Date: Fri, 25 Jun 2010 07:25:49 -0400 (EDT)

AES wrote:
> In article <hvs7n2$8v0$1 at>,
>  "David Park" <djmpark at> wrote:
>> When working with complex expressions your best friend is the ComplexExpand
>> command. For some reason, this command doesn't immediately jump to the
>> notice of beginners and this leads to frequent questions on MathGroup.
> It doesn't immediately jump to the notice of beginners because:
> 1)  Unlike familiar commands or functions or operators such as Sin, Cos, 
> Exp, SquareRoot, or even Re[-] or Im[-] or complex conjugate, there is 
> no such command or operator in "ordinary mathematics."  

Ordinary mathematics generally has an implied context. And it does not 
have the vagaries of trying to guess how much work should be done to 
evaluate an expression. In Mathematica functions such as Re and 
Conjugate need to behave sensibly. Complexexpand is provided as a means 
to allow one some control over the outcome, ability to make assumptions 
about what variables are to be regarded as real, etc.

I should mention also that it predates Assumptions and Refine. Those do 
not make ComplexExpand obsolete, but they sometimes provide an alternate 
route for handling the real-vs-complex realm.

> No one _says_ "ComplexExpand" in ordinary mathematical discourse, and 
> the term would not have been encountered by the ordinary high school or 
> even college graduate.
> 2)  It's bizarrely named.  SeriesExpand _expands_ into a series.  
> ComplexExpand[Re[expr]] trims, or selects.

(1) There is no Mathematica function "SeriesExpand".

(2) ComplexExpand does in fact "expand" its argument into a sum of 
explicit real plus I times explicit imaginary parts. It certainly could 
have been given a different name, way back when. But the name it has it 
not by any means outrageously far from the mark, in terms of describing 
what it does.

> 3)  And, because of Mathematica's generally dysfunctional documentation 
> -- e.g. "ComplexExpand" is not even mentioned in tutorial/ComplexNumbers
> and if it's mentioned in ref/Conjugate, it's buried somewhere down in 
> the nested and closed subsections and therefore cannot be _searched_ for 
> using any kind of Find command.

I typed Complex in the Documentation Center pane. ComplexExpand showed 
up in the See Also links.

I then typed "assume real" (sans quotes) and got multiple links. The 
seventh was to ComplexExpand. If I use quotes in that search I do not 
get ComplexExpand. But I do get a link to something called "Expressions 
Involving Complex Variables" (ninth link listed), and that discusses 

Moreover ComplexExpand is a See Also link from Conjugate. Also listed as 
a link from guide/ComplexNumbers. The list goes on.

> Would anyone suggest that the occurrence of "frequent questions on 
> MathGroup" might indicate a weakness, or even a product defect, in this 
> particular Mathematica design decision?

What you note above indicates possibly a weakness in documentation, 
though I have to say it does not look as though you made more than a 
token effort. (I'm being charitable, and assuming you did not find more 
and simply neglect to mention that). It certainly does not indicate a 
product defect. Of course there may well be defects in ComplexExpand, 
but nothing you mention shows the least sign of one.

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: precedence for ReplaceAll?
  • Next by Date: Re: Newby Q: How to specify reals
  • Previous by thread: Re: Newby Q: How to specify reals
  • Next by thread: Re: Newby Q: How to specify reals