# 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?

-
–  george2079 Jun 24 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 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. –  entron Jun 25 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 at 17:14
Does this work in 8? Assuming[m > 0 && m ∈ Integers && nn > m, Sum[KroneckerDelta[m, n] f[n], {n, nn}]]  –  george2079 Jun 25 at 17:57
@george2079 yes - that works fine. It's the infinite case that causes trouble. –  Jens Jun 25 at 18:07
that then suggests another approach to the linked question –  george2079 Jun 25 at 18:28