# Symbolic evaluation of the sum of KroneckerDelta

I want to evaluate this simple expression $$\sum_n f(n)\delta_{mn} = f(m)$$ using this:

Sum[KroneckerDelta[m, n] f[n], {n, Infinity}]


However Mathematica didn't reduce this expression. Could someone tell me how to do this correctly?

• Jun 24, 2014 at 21:25
• In my opinion this should be tagged as a bug because it's a regression. In version 9, the sum works with any finite numerical upper limit, but not with Infinity. But in version 8, the simplification works even when the upper limit is Infinity.
– Jens
Jun 25, 2014 at 17:24

Edit: The following solution works in Mathemtica 8.0.4, but not in 9.0.1:

This requires an assumption about the parameter m:

Assuming[m > 0 && m ∈ Integers,
Sum[KroneckerDelta[m, n] f[n], {n, Infinity}]]

(* ==> f[m] *)

• I have tried your code, but mathematica didn't reduce the expression neither. I am using Mathematica 9. Jun 25, 2014 at 12:57
• @entron You're right, it works in version 8 and not in version 9! I'll think about it. Seems like a bug to me.
– Jens
Jun 25, 2014 at 17:14
• Does this work in 8? Assuming[m > 0 && m ∈ Integers && nn > m, Sum[KroneckerDelta[m, n] f[n], {n, nn}]]  Jun 25, 2014 at 17:57
• @george2079 yes - that works fine. It's the infinite case that causes trouble.
– Jens
Jun 25, 2014 at 18:07
• that then suggests another approach to the linked question Jun 25, 2014 at 18:28