Re: Re: simplifying inside sum, Mathematica 5.1

• To: mathgroup at smc.vnet.net
• Subject: [mg53775] Re: [mg53749] Re: simplifying inside sum, Mathematica 5.1
• From: DrBob <drbob at bigfoot.com>
• Date: Thu, 27 Jan 2005 05:41:11 -0500 (EST)
• References: <ct4h70\$av2\$1@smc.vnet.net> <ct56p1\$eca\$1@smc.vnet.net> <200501260936.EAA00194@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Richard,

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:

a[0]

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}]]

a[0]

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

0

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.

Bobby

On Wed, 26 Jan 2005 04:36:30 -0500 (EST), Richard Fateman <fateman at cs.berkeley.edu> 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).
>
> RJF
>>
> 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 cs.berkeley.edu> schrieb im Newsbeitrag
>> news:ct4h70\$av2\$1 at smc.vnet.net...
>>
>>> 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 bigfoot.com
www.eclecticdreams.net

```

• 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