Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 '14 at 17:24
up vote 3 down vote accepted

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] *)
share|improve this answer
I have tried your code, but mathematica didn't reduce the expression neither. I am using Mathematica 9. – dadaism Jun 25 '14 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 '14 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 '14 at 17:57
@george2079 yes - that works fine. It's the infinite case that causes trouble. – Jens Jun 25 '14 at 18:07
that then suggests another approach to the linked question – george2079 Jun 25 '14 at 18:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.