# Generate conditions seems to not work [closed]

I am trying to compute the following integral

Integrate[E^(I*k*Omega*t), {t,0,T}, GenerateConditions->True]


for which Mathematica returns

((-I)*(-1+E^(I*k*Omega*T)))/(k*Omega)


apparently not recognizing that k can be 0. Why GenerateConditions doesn't work as expected?

• Limit[((-I)*(-1+E^(IkOmegaT)))/(kOmega), k -> 0] gives the right answer:T. Jul 2, 2014 at 13:59
• Assuming[k == 0, Integrate[E^(IkOmega*t), {t, 0, T}]] also gives T. Jul 2, 2014 at 14:16
• Thank you for your replies, but here the point is to automatically generate the conditions for which the result changes. The reason is that in the real case I have several k-variables, and I expect that there will be lots of conditions. Jul 2, 2014 at 18:05
• (1) Integrate will not catch conditions that are discrete. (2) As was pointed out already in comments, the result is correct anyway; the singularity is removable (e.g. via Limit). Jul 2, 2014 at 18:20
• This question appears to be off-topic because its asker simply does not understand that the result he contests is actually correct. Jul 3, 2014 at 1:56

(1) Integrate will not catch conditions that are discrete. (2) As was pointed out already in comments, the result is correct anyway; the singularity is removable (e.g. via Limit).
Edit: I might add that GenerateConditions might yield a ConditionalExpression but not a piecewise function, which is what the complete specification of the OP's integral would require. ConditionalExpression[expr, condition] implies that the answer is Undefined when the condition is not met.
• It seems that @Daniel Lichtblau is right, since I've tried Integrate[x^n, x, GenerateConditions -> True], and the result fails by setting n to -1. However for this case also the Limit is not correct. Jul 5, 2014 at 10:23
• @Jommy Limit does not work because the integral is indefinite. It works on Integrate[x^n, {x, a, b}, Assumptions -> 0 < a < b]. I believe GenerateConditions defaults to True for single integrals. See mathematica.stackexchange.com/a/13458 and mathematica.stackexchange.com/a/46492. Jul 5, 2014 at 15:43
• @Jommy Here's an example where Limit fails: Integrate[Sin[a/x]/x, {x, 0, 1}]. The answer (or its limit) does not agree with the actual integral for a == 0 + t I, for any real value for t. Jul 5, 2014 at 18:05