MathGroup Archive 2004

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

Search the Archive

Re: Bug? Wrong result from infinite sum.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49652] Re: Bug? Wrong result from infinite sum.
  • From: "Carl K. Woll" <carlw at u.washington.edu>
  • Date: Mon, 26 Jul 2004 04:01:56 -0400 (EDT)
  • Organization: University of Washington
  • References: <cdt6j4$6jq$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Ben,

One approach, which I've mentioned in previous posts, is to add definitions
to D as follows:

Unprotect[D];
D[a[i_],a[j_],NonConstants->{a}]:=DiscreteDelta[i-j]
D[HoldPattern[Sum[a_,b_]],c__]:=Sum[D[a,c],b]
Protect[D];

Now, if we try your examples, we get the results you want:

In[5]:=
D[a[2],a[1],NonConstants->{a}]
D[a[2],a[2],NonConstants->{a}]
D[a[2],a[Infinity],NonConstants->{a}]
D[Sum[a[n],{n,1000}],a[2],NonConstants->{a}]
D[Sum[a[n],{n,Infinity}],a[2],NonConstants->{a}]
D[Sum[a[n],{n,m}],a[2],NonConstants->{a}]
Out[5]=
0
Out[6]=
1
Out[7]=
0
Out[8]=
1
Out[9]=
1
Out[10]=
UnitStep[-2 + m]

Good luck!

Carl Woll

"Ben" <serpent11 at hotmail.com> wrote in message
news:cdt6j4$6jq$1 at smc.vnet.net...
> I'm trying to get Mathematica to evaluate Poisson brackets for me, but
> I am encountering a problem where the sum returns the wrong number.
> Try this:
>
> In a new notebook, evaluate:
>
> the partial derivative with respect to a[2] of a[1] (returns 0)
>
> the partial derivative with respect to a[2] of a[2] (returns 1)
>
> the partial derivative with respect to a[2] of a[infinity] (returns 0)
>
> the sum from n = 1 to 1000 of the derivative with respect to a[2] of
> a[n] (returns 1)
>
> the sum from n = 1 to infinity of the derivative with respect to a[2]
> of a[n]
>
> This final sum returns 0 in Mathematica 4.1, and in Mathematica 5.0,
> it raises an error, indeterminate expression encountered.  If I
> instead take the limit of the sum from n = 1 to m of the derivative
> with respect to a[2] of a[n], I get zero regardless of the value I let
> m approach.
>
> Can anyone suggest a workaround or fix for this problem?  It could be
> a bug with Mathematica, or could be that I am doing something
> technically wrong.
>
> Thanks,
> ~Ben
>



  • Prev by Date: Re: In Plot, horizontal range is reduced depending on PlotRange
  • Next by Date: Re: Functions of Functions
  • Previous by thread: Bug? Wrong result from infinite sum.
  • Next by thread: 3D Pascal's beta cube