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?
k!=mand gives 1 whenk=mbut I do not know if there is way to make Integrate do that on its own. – Nasser Nov 22 '23 at 19:48Integrate[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 (assumingLimitis used for the $k=m$ case). – eyorble Nov 22 '23 at 23:22FullSimplifyon that result with the same assumptions reduces it to0though. – eyorble Nov 22 '23 at 23:23int[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:20Integrate[Exp[2π*I*q*t], {t,0,1}] == Sinc[2π*q] + I*Sinc[π*q]*Sin[π*q] // FullSimplifygivesTrue. 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