Inconsistency in evaluating a definite integral?

Consider the integral $ \int_1^{\infty } \log
\left(1-\frac{\alpha
}{x}\right) , dx$ where 0<\alpha <1

This integral is divergent as can be verified by evaluating the indefinite integral: $x \log \left(1-\frac{\alpha
}{x}\right)-\alpha \log
(x-\alpha )$ between the two limits.

However, the Mathematica input: $\text{Assuming}\left[0<\alpha
<1,\int_1^{\infty } \log
\left(1-\frac{\alpha
}{x}\right) , dx\right]$

produces the output: $(\alpha -1) \log (1-\alpha
)-\alpha$

Inconsistency in Evaluating Definite Integral

It seems to be a correct output as both the limits (x->1,x->\infty) tend to -\infty.
I attached the nb file with the code I used for an experiment.

I am unclear as to your statement, “It seems to be a correct output”. The integral is either convergent or divergent, it can’t be both.
The evaluation of the indefinite integral is correct as can be verified by differentiation. Clearly, this approach proves that the integral is divergent. As you verified, the input: $\text{Assuming}\left[0<\alpha
<1,\int_1^{\infty } \log
\left(1-\frac{\alpha
}{x}\right) , dx\right]$ yields a finite result; a contradiction !
Note that if we evaluate the integral with \alpha=1/2 i.e $\int_1^{\infty } \log
\left(1-\frac{1}{2
x}\right) , dx$, Mathematica says that the integral diverges.

I have used

Manipulate[Evaluate[Assuming[0 < a < 1, Integrate[Log[1 - a/x], {x, 1, \[Infinity]}]]], {a, 0.001, 0.999}]

and for all the values of a \in [0.001; 0.999] the integral values are finite. It’s very confusing…

Mathematica gets the parametric integral wrong:

Assuming[0 < a < 1, Integrate[Log[1 - a/x], {x, 1, \[Infinity]}]]

but it gets it right when the parameter a is a number:

With[{a = 1/2}, Integrate[Log[1 - a/x], {x, 1, \[Infinity]}]]

If you force Evaluate on the integral, the wrong result will win the evaluation race, before the parameter a gets a numeric value. Remove Evaluate and the parameter a will become numeric before the integral is evaluated:

Manipulate[
Integrate[Log[1 - a/x], {x, 1, [Infinity]}], {a, 0.001, 0.999}]

3 Likes

Reported as a bug.

There seem to be more inconsistencies, for example (sorry, I must include this as picture) the following. The funny thing is that the result depends minutely on how the formula is entered:

I find it impossible to believe that the code could not have been included in this message. I am unable to copy/paste an image.

If that helps:

Simplify[\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(r1\), \(r2\)]\(
\*FractionBox[\(1\), \(
\*SuperscriptBox[\(r\), \(2\)]\ 
\*SqrtBox[\(\((r - r1)\) \((r2 - r)\)\)]\)] \[DifferentialD]r\)\), 
 Assumptions -> (r1 > 0) && (r2 > 0) && (r2 > r1)] 

2nd formula:

Simplify[\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(a\), \(b\)]\(
\*FractionBox[\(1\), \(
\*SuperscriptBox[\(r\), \(2\)]\ 
\*SqrtBox[\(\((r - a)\) \((b - r)\)\)]\)] \[DifferentialD]r\)\), 
 Assumptions -> (a > 0) && (b > 0) && (b > a)] 

3rd one:

Integrate[1/(r^2 Sqrt[(r - r1) (r2 - r)]), {r, r1, r2}, 
 Assumptions -> (r1 > 0) && (r2 > 0) && (r2 > r1)]

Is there a compelling reason to enter the first two using the box formatting? (This is a rhetorical question. The answer is “no”. The problems with that formatting are that it is not readable and also does not copy/paste into a raw kernel on my Linux machine.) General rule: the simpler the code provided, the more likely one is to get a response.

As for the issue at hand, it appears that the integral, when not provided the assumptions, is off by a sign.

Compelling reason? No, but not forbidden either. One can enter formulae like this either with escape syntax or using the class room editor.

Anyway, I have more gems of this sort:

Integrate[Csc[t] Log[1 + x Sin[t]], {t, -(\[Pi]/2), \[Pi]/2}, 
 Assumptions -> 0 < x < 1]

Mathematica evaluates this to 0. The correct result would be

\[Pi] ArcSin[x]

as can be seen from series expansions.

One more item (this time a limit instead of an integral):

Limit[ParabolicCylinderD[\[Nu], -t]/(
 Sqrt[2 Pi]/Gamma[-\[Nu]] t^(-\[Nu] - 1) Exp[t^2/4]) , 
 t -> \[Infinity]]

Mathematica evaluates to

-\[Infinity] Gamma[-\[Nu]] Gamma[1 + \[Nu]] Sin[\[Pi] \[Nu]]

The correct value would be -1, according to Gradshteyn-Ryzhik formula 9.246 part 2.

Numerical checks make me suspect that the limit should be 1 rather than -1. But clearly the current behavior is wrong. I’ll file a bug report for that.

1 Like

Thanks!

This will also be filed as a bug.

1 Like

Thanks!