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 2001

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

Search the Archive

Re: KroneckerDelta in sum

  • To: mathgroup at
  • Subject: [mg31687] Re: [mg31675] KroneckerDelta in sum
  • From: BobHanlon at
  • Date: Sat, 24 Nov 2001 16:44:00 -0500 (EST)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/11/23 8:25:10 AM, 
reichelt at writes:

>I guess I have a rather simple problem. If I write
>Sum[a[i, j]KroneckerDelta[i - j], {i, -Infinity, Infinity}]
>Mathematica answers
>a[j, j]
>Now, if I use a two-fold sum
>Sum[a[i, j]KroneckerDelta[i - j], {i, -Infinity, Infinity}, {j, -Infinity,
>    Infinity}]
>the expression is not simplified.
>How can I force Mathematica to give results like
>Sum[a[j,j],{j,-Infinity, Infinity}]

Sum has the attribute HoldAll


{HoldAll, Protected, ReadProtected}

Either, manually separate the sums

  {i, -Infinity, Infinity}]

Sum[a[i, i], {i, -Infinity, 

or use a replacement rule to separate the sums


    {j,-Infinity,Infinity}] /. 
  Sum[expr_, iter1_, iter2_] :> 
      Evaluate[Sum[expr, iter2]], iter1]

Sum[a[i, i], {i, -Infinity, 

Note that with Sum, multiple iterators are listed from the outside in.

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Re: square wave function
  • Next by Date: Re: Aligning subplots nicely?
  • Previous by thread: KroneckerDelta in sum
  • Next by thread: Aligning subplots nicely?