1

I feel confident this problem has been posed before but alas I cannot find it.

Clear[k, m];
Assuming[Element[{k, m}, NonNegativeIntegers], 
 Integrate[E^(2 Pi I (k - m) t), {t, 0, 1}]]

yields 0, which is only valid when $k \neq m$. The answer should instead be a KroneckerDelta with indices $k$ and $m$.

How do I ensure the case $k=m$ is also included in the result?

Domen
  • 23,608
  • 1
  • 27
  • 45
David G. Stork
  • 41,180
  • 3
  • 34
  • 96
  • Mathematica gives result which is generic. You could always add extra assumption. Here is screen shot Mathematica graphics which gives zero only when k!=m and gives 1 when k=m but I do not know if there is way to make Integrate do that on its own. – Nasser Nov 22 '23 at 19:48
  • @Nasser: Thanks. The result $0$ isn't exactly "generic," but instead the typical case. I realize I could split the cases into $k=m$ and $k \neq m$, but I would have thought that Mathematica could do this explicitly. – David G. Stork Nov 22 '23 at 19:50
  • 1
    Should be a Kronecker delta, not a Dirac delta. – Roman Nov 22 '23 at 19:58
  • On 13.3.0.0 with Integrate[Exp[2 \[Pi] I (k - m) t], {t, 0, 1}, Assumptions -> {k \[Element] NonNegativeIntegers, m \[Element] NonNegativeIntegers}] I get a non-zero expression (-((I (-1 + E^(2 I (k - m) \[Pi])))/(2 (k - m) \[Pi]))) which exhibits the appropriate behavior (assuming Limit is used for the $k=m$ case). – eyorble Nov 22 '23 at 23:22
  • 1
    Using FullSimplify on that result with the same assumptions reduces it to 0 though. – eyorble Nov 22 '23 at 23:23
  • int[k_, m_] = Assuming[{k, m} \[Element] NonNegativeIntegers, Piecewise[{{Assuming[k == m , Integrate[E^(2*Pi*I*(k - m)*t), {t, 0, 1}]], {k, m} \[Element] NonNegativeIntegers && k == m }, {Assuming[k != m , Integrate[E^(2*Pi*I*(k - m)*t), {t, 0, 1}]], {k, m} \[Element] NonNegativeIntegers && k != m}}]] – Bob Hanlon Nov 23 '23 at 04:20
  • Thanks... helpful... but again essentially a solution "by hand." – David G. Stork Nov 23 '23 at 08:14
  • Another "by hand" solution: integrate over the reals and then specialize on the integers. Integrate[Exp[2π*I*q*t], {t,0,1}] == Sinc[2π*q] + I*Sinc[π*q]*Sin[π*q] // FullSimplify gives True. The imaginary part is zero $\forall q\in\mathbb{Z}$. The real part is 1 for $q=0$ and zero for all other integers. – Roman Nov 23 '23 at 10:44
  • 1
    Here is one older version among several others. – Daniel Lichtblau Nov 24 '23 at 02:28

0 Answers0