Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Re: simplifying inside sum, Mathematica 5.1

  • To: mathgroup at
  • Subject: [mg53775] Re: [mg53749] Re: simplifying inside sum, Mathematica 5.1
  • From: DrBob <drbob at>
  • Date: Thu, 27 Jan 2005 05:41:11 -0500 (EST)
  • References: <ct4h70$av2$> <ct56p1$eca$> <>
  • Reply-to: drbob at
  • Sender: owner-wri-mathgroup at


If the sum doesn't simplify because Mathematica is missing an "arguably correct" rule, that's unfortunate ("arguably"). But it doesn't reach the level of "bug" until it simplifies to something WRONG, and I don't mean "arguably" wrong.

If a[1]=Infinity, (or the same for ANY i>0) it's hard to see why Sum[a[i]x^i,{i,0,Infinity}]/.x->0 should resolve to a[0] -- since one of the terms is Indeterminate.

Allowing the possibility that unknown terms might be Infinity, ComplexInfinity, or Indeterminate can be inconvenient, and it may not be a good reason Sum shouldn't simplify in this case. It probably isn't the reason Mathematica doesn't simplify it, in fact.

Still, if it did simplify, and if one of the a[i] WERE one of those values, the simplification would be wrong, and we'd rightly call it a bug. As things are, your "arguably correct" expectation is simply a rule Mathematica doesn't know, among infinitely many other rules no CAS happens to know and apply.

Anyway, a simple way to get the result you're seeking is the statement:


or, if you prefer,

First[Sum[a[i]*x^i, {i, 0, Infinity}]] /. i -> 0

A more complete method is:

firstTerm[s_Sum] :=
   Block[{i = s[[2,1]]}, If[s[[2,2]] > 0, 0, s[[1]] /. i -> 0]]
firstTerm[Sum[a[i]*x^i, {i, 0, Infinity}]]


firstTerm[Sum[a[i]*x^i, {i, 1, Infinity}]]


This kind of control would be harder if Mathematica had already applied a rule that, in a given situation, turned out to be wrong. Also note that all three methods avoid the 0^0 quandary -- as of course we should, in mathematics or Mathematica.

Still, I agree that we often want the simple answer, without working for it.


On Wed, 26 Jan 2005 04:36:30 -0500 (EST), Richard Fateman <fateman at> wrote:

> Since the answer given by this process is 0 instead of the
> arguably   correct a[0],
> the question remains. (Similarly for Dr. Bob and Andrzej).
> Jens-Peer Kuska wrote:
>   Hi,
>> since 0^0 is indefined *and* i run over i=0,1,... Mathematica will not
>> simplify this expression. In other cases you may remove the HoldAll
>> attribut from Sum[] to force the evaluation or you can try
>> s = Sum[a[i]*x^i, {i, 0, Infinity}];
>> (s /. x -> 0) /.  Verbatim[Sum][s_, iter__] :>
>>                         (Sum @@ {Simplify[s, Element[i, Integers] && i > 0],
>> iter})
>> clearly the assumption in the Simplify[] call contradicts
>> the bounds of the iterator.
>> Regards
>>   Jens
>> "Richard Fateman" <fateman at> schrieb im Newsbeitrag
>> news:ct4h70$av2$1 at
>>> Sum[a[i]*x^i,{i,0,Infinity}]
>>> %/. x->0
>>> leaves 0^i  inside the sum, unsimplified.
>>> So does the sum from 1 to Inf.
>>> The correct answers are presumably a[0] and 0.
>>> Is there a way to get Mathematica to do this?
>>> RJF

DrBob at

  • Prev by Date: Re: compile / optimize
  • Next by Date: Re: Re: simplifying inside sum, Mathematica 5.1
  • Previous by thread: Re: Re: simplifying inside sum, Mathematica 5.1
  • Next by thread: Re: Re: simplifying inside sum, Mathematica 5.1