2
$\begingroup$

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?

$\endgroup$
6
  • 1
    $\begingroup$ Limit[((-I)*(-1+E^(IkOmegaT)))/(kOmega), k -> 0] gives the right answer:T. $\endgroup$
    – Apple
    Commented Jul 2, 2014 at 13:59
  • 1
    $\begingroup$ Assuming[k == 0, Integrate[E^(IkOmega*t), {t, 0, T}]] also gives T. $\endgroup$
    – Bob Hanlon
    Commented Jul 2, 2014 at 14:16
  • $\begingroup$ 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. $\endgroup$
    – Jommy
    Commented Jul 2, 2014 at 18:05
  • 2
    $\begingroup$ (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). $\endgroup$ Commented Jul 2, 2014 at 18:20
  • 4
    $\begingroup$ This question appears to be off-topic because its asker simply does not understand that the result he contests is actually correct. $\endgroup$
    – m_goldberg
    Commented Jul 3, 2014 at 1:56

1 Answer 1

2
$\begingroup$

@Daniel Lichtblau's comment seems like an answer that is worth putting in an answer:

(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.

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$
    – Jommy
    Commented Jul 5, 2014 at 10:23
  • $\begingroup$ @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. $\endgroup$
    – Michael E2
    Commented Jul 5, 2014 at 15:43
  • $\begingroup$ @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. $\endgroup$
    – Michael E2
    Commented Jul 5, 2014 at 18:05

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