6
$\begingroup$

Bug introduced in 10.2.0 or earlier and fixed by 11.0.


Integrate[Exp[c x]/x, {x, -a, a}]

returns

ConditionalExpression[-ExpIntegralEi[-a c] + ExpIntegralEi[a c], Re[a] > 0 && Im[a] == 0]

but the integral does not actually converge for any values of c or a (because near x = 0, Exp[c x] ~ 1, so the integrand has a 1/x singularity). If I replace either c or a with an actual number, then Mathematica correctly says that the integral does not converge - even if I replace c with a positive real number, satisfying the returned condition.

$\endgroup$
0

3 Answers 3

6
$\begingroup$

Expanded in response to comment by OP

The result in the question also is obtained with Mathematica "10.3.0 for Microsoft Windows (64-bit) (October 9, 2015)".

Integrate[Exp[c x]/x, {x, -a, a}]
(* ConditionalExpression[-ExpIntegralEi[-a c] + ExpIntegralEi[a c], 
   Re[a] > 0 && Im[a] == 0] *)

which can be simplified for a > 0 && c > 0.

FullSimplify[s1, a > 0 && c > 0]
(* 2 SinhIntegral[a c] *)

(The same result is obtained for a > 0 && c < 0 but not for a > 0 && c == 0.) This is the Cauchy Principal Value result.

Integrate[Exp[c x]/x, {x, -a, a}, Assumptions -> a > 0, PrincipalValue -> True]
(* 2 SinhIntegral[a c] *)

which seems strange, because PrincipalValue -> False is the default. Thus,

Integrate[Exp[c x]/x, {x, -a, a}, Assumptions -> a > 0 && c > 0]

returns unevaluated with the expected error message

Integrate::idiv: Integral of E^(c x)/x does not converge on {-a,a}. >>

Giving a and c specific real values likewise produces this error message, as noted by the OP's comment. Perhaps, Integrate becomes confused, when no constraints are placed on the parameters a and c.

$\endgroup$
4
  • $\begingroup$ The Cauchy principal value is a very specific method for dealing with divergent integrands, and I do not think it is standard to assume it is being used when not specified. And more to the point, why does Mathematica assume it should only use the CPV when c and a are left as variables, but not for specific numerical values? $\endgroup$
    – tparker
    Dec 5, 2015 at 10:02
  • $\begingroup$ I assumed the setting for PrincipalValue was Automatic, but you're right, it's False. I guess a user-setting for PrincipalValue makes Integrate choose an approach that does not try to avoid the singularity. $\endgroup$
    – Michael E2
    Dec 5, 2015 at 15:24
  • 1
    $\begingroup$ @MichaelE2 Setting PrincipalValue -> False does not change the result cited in the question. Perhaps, this might be described as a bug. By the way, +1 for your answer. $\endgroup$
    – bbgodfrey
    Dec 5, 2015 at 15:32
  • $\begingroup$ Of course. Somehow I confused myself. I'll update my answer. $\endgroup$
    – Michael E2
    Dec 5, 2015 at 15:38
4
$\begingroup$

It appears that this is a bug, and Mathematica is incorrectly evaluating the Cauchy Principal Value of the integral despite the default PrincipalValue -> False (and continues to do so even if you manually specify this).

$\endgroup$
3
$\begingroup$

Since PrincipalValueis by default set it to False (thanks, @bbgodfrey), it helps to indicate that a is a positive real number:

Integrate[Exp[c x]/x, {x, -a, a}, Assumptions -> a > 0]

Mathematica graphics

The way to look at Integrate is that it tries to find a generic integral over a complex line. Sometimes you have to give it extra information to get it to think right. Sometimes even when you do, it still has trouble analyzing the complex-number situation.

Compare with this complex line integral that goes around zero:

Integrate[Exp[c x]/x, {x, -a, I, a}, Assumptions -> a > 0]
(*
ConditionalExpression[
 -ExpIntegralEi[-a c] + ExpIntegralEi[a c],
 (c == 0 || Im[c] <= 0 || Re[c] <= 0 || a Im[c] + Re[c] <= 0) &&
  (Re[c] >= 0 || c == 0 || Im[c] <= 0 || a Im[c] <= Re[c])]
*)

Note: This integral is off by Pi I, so this falls into the doesn't-quite-get-it-right category.


A more direct way to get divergence, assuming you know where the singularity is:

Integrate[Exp[c x]/x, {x, -a, 0, a}]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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