I'm having trouble getting Mathematica (, OSX High Sierra) to evaluate the following sum:

$\sum_{i=0}^{\infty} f(i) \, g(i) \, \delta_{i,j}$

My code is

Sum[f[i] g[i] KroneckerDelta[i, j], {i, 0, Infinity}]

The output I was expecting was

f[j] g[j] UnitStep[j]

but instead I get the original sum. When I remove f[i] or g[i] from the expression, however, I get the expected result.


Try using assumptions:

    j ∈ Integers && j >= 0,
    Sum[f[i] g[i] KroneckerDelta[i, j], {i, 0, Infinity}]

f[j] g[j]

  • 1
    $\begingroup$ Hmm, that doesn't seem to work -- I just get the sum back. $\endgroup$ – Richard Townsend Feb 24 '18 at 3:00
  • $\begingroup$ @RichardTownsend Seems like this was improved in M11.2. $\endgroup$ – Carl Woll Feb 24 '18 at 3:03
  • $\begingroup$ Unfortunately, my University site licence appears to be stuck at I'll have to find out what the plans are for updating it. But in the meantime, many thanks for the quick response. $\endgroup$ – Richard Townsend Feb 24 '18 at 3:08
  • $\begingroup$ Ok, managed to upgrade to 11.2, and your solution works perfectly. Many thanks again, Carl! $\endgroup$ – Richard Townsend Feb 24 '18 at 3:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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