       Re: KroneckerDelta in sum

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

```In a message dated 2001/11/23 8:25:10 AM,
reichelt at ax1348.physik.uni-marburg.de writes:

>I guess I have a rather simple problem. If I write
>Sum[a[i, j]KroneckerDelta[i - j], {i, -Infinity, Infinity}]
>
>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

Attributes[Sum]

Either, manually separate the sums

Sum[Evaluate[Sum[a[i,j]KroneckerDelta[i-j],
{j,-Infinity,Infinity}]],
{i, -Infinity, Infinity}]

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

or use a replacement rule to separate the sums

Off[Sum::itform];

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

Sum[a[i, i], {i, -Infinity,
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?