MathGroup Archive 2004

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

Search the Archive

Re: canonical mathematical expression represenation?

Yes it is annoying the way Mathematica tends to get the minus signs where we
would prefer not to have them. One way to fix this, in simple expressions at
least, is to Map Minus to the two factors you would wish to change.

Sum[a^k, {k, 0, M}]
MapAt[Minus, %, {{1, 1}, {2}}]
(-1 + a^(1 + M))/(-1 + a)
(1 - a^(1 + M))/(1 - a)

I find that it is almost always possible to manipulate expressions to the
form you want, textbook form say, but it is a bit of an art and sometimes
even I have to come to MathGroup to learn the trick.

David Park
djmp at

From: nospam nospam [mailto:nospam_please at]
To: mathgroup at

I noticed that Mathematica represents expressions with
some specific 'way' or order.

For example,

Sum[a^k, {k, 0, M}]

          -1 + a^(1+M)
            -1 + a

How can I make it display the expression, in what I would consider
a more 'natural' way, as follows

           1 - a^(1+M)
            1 - a

I am sure there is a way to do, and why do you think
Mathematica does it the way it does? what is the logic
of how it represents things? is there a command to convert
the first output to the second? I tried few commands, but
can not figure it out.

thank you,

  • Prev by Date: Re: sort procedure
  • Next by Date: Re: canonical mathematical expression represenation?
  • Previous by thread: canonical mathematical expression represenation?
  • Next by thread: Re: canonical mathematical expression represenation?