2
$\begingroup$

I have a function $\log(x) - \log(1- x)$,

and I wish to evaluate the limit as $x \to \infty$. I thought this was just $\infty$ since the limit as $x \to \infty$ of each term is $\infty$, but Mathematica somehow is returning $i \pi$ when I tried it. Does anyone know the reason for this?

Thanks!

$\endgroup$
  • 5
    $\begingroup$ $\log(1-x)$ is not defined (except in complex sense) when $x>1$. That explains the Mathematica result. Because the "limit" is $\log(-1) = i\pi$ $\endgroup$ – Gautam Shenoy Sep 4 '17 at 14:34
  • 1
    $\begingroup$ The domain of your function is the open interval $(0,1)$. There is no meaning in considering $x \to \infty$. $\endgroup$ – Crostul Sep 4 '17 at 14:36
  • 2
    $\begingroup$ Might you have meant $\log x - \log(x-1)\text{?} \qquad$ $\endgroup$ – Michael Hardy Sep 4 '17 at 14:40
  • $\begingroup$ @GautamShenoy Even then, Mathematica should be using principal branches, which would result in $-\pi i$. $\endgroup$ – Simply Beautiful Art Sep 4 '17 at 14:57
  • 2
    $\begingroup$ Mathematica 11.1 and Maple 2017.2 give me: $ - i \pi$ $\endgroup$ – Mariusz Iwaniuk Sep 4 '17 at 15:09
7
$\begingroup$

With some algebra,$$\log x - \log(1 - x) = \log \frac{x}{1 - x} \to \log(-1)$$

which Mathematica interprets as $i\pi$, and you can too if you choose that particular branch of the complex logarithm. It's a natural choice because $e^{i\pi} = -1$.


On a different but important note, however, the reasoning

I thought this was just $\infty$ since the limit as $x \to \infty$ of each term is $\infty$

is unfortunately very mistaken. For example, $\lim_{x \to \infty} (x - x) = 0$, but each term obviously goes to infinity.

$\endgroup$
  • $\begingroup$ But, I don't understand: Spivak Theorem 5.2: $\lim_{x \to a} (f + g)(x) = \lim_{x \to a} f + \lim_{x \to a} g$ $\endgroup$ – Thomas Moore Sep 4 '17 at 14:36
  • 2
    $\begingroup$ This assumes that both limits exist and are finite. $\endgroup$ – Xander Henderson Sep 4 '17 at 14:37
  • $\begingroup$ When the limits are both real numbers, this is true. (And if they are the same signed infinity, this is true too). But when the first limit is $+\infty$ and the second is $-\infty$, there is a real problem. Check out indeterminate forms. $\endgroup$ – T. Bongers Sep 4 '17 at 14:37
  • 3
    $\begingroup$ @ThomasMoore Yes, that is correct, assuming both limits exist and are finite. $\infty-\infty$ is an indeterminate form. $\endgroup$ – Simply Beautiful Art Sep 4 '17 at 14:43
6
$\begingroup$

I'm going to hazard a guess that what was meant was $\log x - \log(x-1).$

One can write $\log x - \log(x-1) = \log \dfrac x {x-1}$ and then

\begin{align} \lim_{x\to\infty} \log\frac x {x-1} & = \log \lim_{x\to\infty} \frac x {x-1} \quad \text{because log is continuous} \\[10pt] & = \log 1 =0. \end{align}

Or one can say that by the mean value theorem there exists $c_x$ between $x-1$ and $x$ for which $$ \log x - \log(x-1) = \log' c_x = \frac 1 {c_x} < \frac 1 {x-1} \to 0 \text{ as } x\to\infty. $$

$\endgroup$
  • $\begingroup$ Isn't $\ln c_x = \frac{d(c_x)}{c_x dx}$ using chain rule? $\endgroup$ – user263326 Sep 4 '17 at 17:01
  • $\begingroup$ @user263326 : No. $\dfrac d {dx} \ln c_x$ would indeed be equal to $\dfrac 1 {c_x} \cdot \dfrac d {dx} c_x,$ provided $c_x$ is a differentiable function of $x.$ But that's $\dfrac d{dx} \ln c_x,$ not $\ln c_x$ without $\text{“} \dfrac d{dx}\text{''}.$ But your comment is irrelevant: I never sought $\dfrac d{dx} \ln c_x.$ The expression $\log' c_x$ is NOT the same thing as $\dfrac d{dx} \log c_x$ and was not intended to be the same thing. $\qquad$ $\endgroup$ – Michael Hardy Sep 4 '17 at 17:37
3
$\begingroup$

Assuming principal branches, Mathematica is actually wrong. Note that the identity

$$\log(a)-\log(b)=\log(a/b)$$

holds for $a,b\in\Bbb R_{>0}$, but not generally for any other $a,b$. Using principle branches and assuming $x>1$, we actually have

$$\log(1-x)=\log|1-x|+i\arg(1-x)=\log(x-1)+\pi i$$

hence,

\begin{align}\log(x)-\log(1-x)&=\log(x)-\log(x-1)-\pi i\\&=\log\left(\frac x{x-1}\right)-\pi i\\&\to\log(1)-\pi i\\&=-\pi i\\&\ne\pi i\end{align}


Note that Mathematica 11.1 returns $-\pi i$.

$\endgroup$
  • $\begingroup$ Unless someone who uses Mathematica knows what sort of branch it uses is not the principal branch? Would be nice to know... $\endgroup$ – Simply Beautiful Art Sep 4 '17 at 15:00
  • $\begingroup$ It's also possible that Mathematica was not wrong, but instead Mathematica's answer was misreported. Has the $\pi i$ answer been confirmed by someone other than the OP? wolframalpha.com/input/… gives $-\pi i$. $\endgroup$ – LarsH Sep 4 '17 at 15:22
  • $\begingroup$ @LarsH Possibly. Unfortunately, we don't know what version the OP was using. $\endgroup$ – Simply Beautiful Art Sep 4 '17 at 15:23

Your Answer

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

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