MathGroup Archive 2002

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

Search the Archive

Re: Misbehaving Sum[..,{n,0,Infinity}]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37703] Re: [mg37676] Misbehaving Sum[..,{n,0,Infinity}]
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Sat, 9 Nov 2002 00:29:04 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Here is one way that works:

In[3]:=
cn = KroneckerDelta[n, 0] - (1/2)*KroneckerDelta[n, 1];
Sum[Evaluate[x^(n - 1)*cn], {n, 0, Infinity}]

Out[4]=
-(1/2) + 1/x

However, I really do think you ought to use;

In[5]:=
c[n_] := KroneckerDelta[n, 0] - (1/2)*KroneckerDelta[n, 1]

In[6]:=
Sum[x^(n - 1)*c[n], {n, 0, Infinity}]

Out[6]=
-(1/2) + 1/x

Note that this way you do not even need Evaluate.

And, by the way, the reason why your approach does not work is simply 
that Mathematica does not expect having to deal with an If[...] in an 
infinite sum. After all, in the case of infinite sums (unlike in the 
finite one) no actual summation takes place: Mathematica has to work 
out the answer by means of various transofrmation and the rules it 
knows about. In the finite case it just counts ...

Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/



On Friday, November 8, 2002, at 04:15 PM, David M. Wood wrote:



> Aaaargh.
>
> What is with Mathematica (4.2 here) and infinite sums?!  (The
> following has annoyed me for years.  I'm finally indignant enough to
> pose this query.)
>
> A nominally infinite sum for which only a finite number of terms
> contribute FAILS to evaluate for an uppper index limit of Infinity,
> but evaluates PROPERLY for an (arbitrary) finite upper index limit.
>
> Example:
>
> cn = If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0];
> Sum[x^(n-1) cn,{n,0,Infinity}]
>
> gives
>
> If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0]/((1 - x) x)
>
> while
>
> Sum[x^(n-1) cn,{n,0,731}]
>
> gives
>
> -1/2 + 1/x
>
> (which is, of course, what I want).  I've Google-searched to no avail,
> nested Evaluate every which way, but only a finite upper limit works
> properly--inconvenient for formal results.
>
> Can anybody explain what's going on, or how to coerce Mathematica into 
> not
> choking on an infinite number of non-contributing terms?
>
> Thanks!
>
> David M. Wood, Department of Physics, Colorado School of Mines,
> Golden, CO 80401; Phone: (303) 273-3853; Fax: (303) 273-3919
> http://www.mines.edu/Academic/physics/people/pages/wood.html
>
>
>
> -- 
> David M. Wood,  Dept. of Physics, Colorado School of Mines, Golden, CO 
> 80401
> Phone: (303) 273-3853; Fax: (303) 273-3919; e-mail: dmwood at Mines.EDU
>
>
>



  • Prev by Date: Re: Misbehaving Sum[..,{n,0,Infinity}]
  • Next by Date: Re: problem
  • Previous by thread: Re: Misbehaving Sum[..,{n,0,Infinity}]
  • Next by thread: Representing integers as sums of 3 squares