There are some dangerous pitfalls that can happen when evaluating some integrals, assuming that some parameters are integers. For example, consider the following:

Assuming[m \[Element] Integers, Integrate[Exp[I m x], {x, 0, 2 \[Pi]}]] (*output: 0*)

The correct result should have been $2 \pi \delta_0^m$. Is there a proper way to do such an integral? There is another thread discussing a similar issue, but GenerateConditions does not do anything in this case. Is there really no other way other than trying lots of values of $m$ until one find the one ($m=0$) for which the integral is not trivial?

  • 3
    $\begingroup$ Assuming[m \[Element] Integers, Integrate[Piecewise[{{1, m == 0}}, Exp[I m x]], {x, 0, 2 \[Pi]}]] $\endgroup$
    – Bob Hanlon
    May 9 at 23:58


Your Answer

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

Browse other questions tagged or ask your own question.