Wolfram Alpha graph of ln(x) shows as ln(abs(x))

Click For Summary

Discussion Overview

The discussion revolves around the interpretation of the natural logarithm function, specifically how Wolfram Alpha distinguishes between ln(x) and ln(abs(x)). Participants explore the implications of using complex numbers in this context and how it affects the outputs for various inputs, particularly in relation to integrals.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • Some participants note that Wolfram Alpha appears to treat ln(x) as ln(abs(x)), which raises questions about its handling of negative values.
  • Others explain that ln is well-defined for negative numbers in the context of complex analysis, leading to outputs that include an imaginary component.
  • A participant mentions that the traditional definition of ln(x) does not allow for x ≤ 0, contrasting it with ln(abs(x)).
  • There is a discussion about the historical context of the term "log," which has varied meanings in different fields, including computer science.
  • Some participants express uncertainty about how to present results from Wolfram Alpha that include complex components when discussing with instructors.
  • One participant points out that Wolfram Alpha has options for complex and real-valued plots, which may influence how results are interpreted.
  • Another participant discusses the mathematical nuances of integrating functions involving ln, highlighting the importance of specifying conditions on x.
  • There are references to the implementation of logarithmic functions in Mathematica and programming languages, noting the handling of arguments along the real axis.

Areas of Agreement / Disagreement

Participants express differing views on the interpretation of ln(x) versus ln(abs(x)), with some agreeing on the complexities introduced by the use of complex numbers while others emphasize the traditional definitions. The discussion remains unresolved regarding the best way to communicate these differences in educational contexts.

Contextual Notes

Participants mention limitations in the definitions of logarithmic functions, particularly regarding their applicability to negative values and the implications for integration. There is also a recognition of the ambiguity in the term "log" across different disciplines.

rudy
Messages
45
Reaction score
9
Hello-

I was checking an answer to an integral on Wolfram Alpha and noticed I don't know how they distinguish between ln(x) and ln("absolute value of"(x)). It appears all of their inputs and outputs imply absolute value (taking positive and negative x-values)

Is anyone here familiar with their site and can explain why this is or how they distinguish between the two?

Here is a link to "ln(x)" on wolfram alpha:

https://www.wolframalpha.com/input/?i=lnx

P.S. In case anyone is wondering why the input says "log(x)", Wolfram Alpha only deals with ln, so log = ln on W.A.

Thanks,

Rudy
 

Attachments

  • Screen Shot 2017-10-14 at 7.25.37 PM.png
    Screen Shot 2017-10-14 at 7.25.37 PM.png
    15.1 KB · Views: 1,470
Physics news on Phys.org
How about ln(abs(x)) or ln|x|? And yes, meanwhile log without an explicit basis means ln.
 
Hi Rudy,

By default Wolfram uses complex numbers.
Ln is well defined for negative numbers then, which shows up as having an imaginary part of pi (for the principle branch).
It just looks like the ln of an absolute value, which happens to be the real part.
For the principle branch we have:
$$\ln(-x)=\ln(e^{\pi i}\cdot x)=\pi i + \ln x$$
 
Last edited:
fresh_42 said:
How about ln(abs(x)) or ln|x|? And yes, meanwhile log without an explicit basis means ln.
It -- log(x) -- didn't always mean ln(x). Back in the "old days" log(x) meant ##log_{10}(x)## and ln(x) meant ##log_e(x)##.

Also, in many computer science books, log(x) means ##log_2(x)##.
 
Yes, I know, and I like ##\ln (x)##. That's why I said "meanwhile". But someone once said about me: If it was you to decide, we would still start our cars with a handle. Hmm, why not? Better than a battery failure in a cold winter.

I remember a discussion we had on PF before about ##\ln (x)## and I still can't see the advantage of ##\log (x)##. It's a letter more, ambiguous and ##\ln (x)## isn't assigned another usage and is easy to write by hand. I'm not sure, but I think I've even seen ##\operatorname{lb}## for ##\log_2## as well.
 
I like Serena said:
Hi Rudy,

By default Wolfram uses complex numbers.
Ln is well defined for negative numbers then, which shows up as having an imaginary part of pi (for the principle branch).
It just looks like the ln of an absolute value, which happens to be the real part.
For the principle branch we have:
$$\ln(-x)=\ln(e^{\pi i}\cdot x)=\pi i + \ln x$$

Interesting, so is there no way to express ln(x) in the "traditional" (not using complex #s) sense on W.A.? In other words, is there a way I can use W.A. to check integrals with ln(abs(x)) in the answer? (Subtract pi*i for example...). Or should I just tell my professor that all my answers are formatted as outputs from W.A. :-p
 
rudy said:
Interesting, so is there no way to express ln(x) in the "traditional" (not using complex #s) sense on W.A.? In other words, is there a way I can use W.A. to check integrals with ln(abs(x)) in the answer? (Subtract pi*i for example...). Or should I just tell my professor that all my answers are formatted as outputs from W.A. :-p
ln(x) "in the 'traditional sense'" does not allow x ≤ 0. That is not the fault of WA, that is standard mathematics. ln(x) is not the same as ln(abs(x)), which WA handles easily. WA handles them both correctly.
 
Last edited:
Just noticed that W|A has a button on the right side of the graph that says Complex-valued plot, which we can change to Real-valued plot. :)
 
Last edited:
  • Like
Likes   Reactions: FactChecker
fresh_42 said:
I'm not sure, but I think I've even seen ##\operatorname{lb}## for ##\log_2## as well.
lb? I have seen ld once in a while.

WolframAlpha typically understands things like “where x>0”, but for integrals over positive x that doesn’t matter anyway.
 
  • #10
mfb said:
WolframAlpha typically understands things like “where x>0”, but for integrals over positive x that doesn’t matter anyway.
I think the classical problem here is:
$$\int \frac {dz}z = \ln z + C$$
which is what W|A reports.
(Aside from the fact that they use the ambiguous ##\log##. I'm still wondering what their rationale is.)
For reals this becomes:
$$\int \frac {dx}x = \begin{cases}\ln x + C_1 &\text{if }x > 0 \\ \ln(-x) + C_2 & \text{if }x < 0\end{cases}$$
which is defined for negative x, and which is only properly defined if the bounds are either both positive or both negative.
And usually, somewhat erroneously though due to the different integration constants, it is abbreviated to:
$$\int \frac{dx}x = \ln|x| + C$$
which I'm guessing is what Rudy is being taught, and what he is supposed to verify.
 
Last edited:
  • Like
Likes   Reactions: mfb
  • #11
I like Serena said:
I think the classical problem here is:
$$\int \frac {dz}z = \ln z + C$$
which is what W|A reports.
(Aside from the fact that they use the ambiguous ##\log##. I'm still wondering what their rationale is.)
For reals this becomes:
$$\int \frac {dx}x = \begin{cases}\ln x + C_1 &\text{if }x > 0 \\ \ln(-x) + C_2 & \text{if }x < 0\end{cases}$$
which is defined for negative x, and which is only properly defined if the bounds are either both positive or both negative.
And usually, somewhat erroneously though due to the different integration constants, it is abbreviated to:
$$\int \frac{dx}x = \ln|x| + C$$
which I'm guessing is what Rudy is being taught, and what he is supposed to verify.

THIS sounds like the explanation I was looking for. I need to look over your explanation as I don't fully follow at first glance but thank you very much!
 
  • Like
Likes   Reactions: jim mcnamara and I like Serena
  • #12
fresh_42 said:
If it was you to decide, we would still start our cars with a handle.
Two of my motorcycles are started using a "handle" (kickstarter).
 
  • Like
Likes   Reactions: fresh_42
  • #13
I like Serena said:
Hi Rudy,

By default Wolfram uses complex numbers.
Ln is well defined for negative numbers then, which shows up as having an imaginary part of pi (for the principle branch).
It just looks like the ln of an absolute value, which happens to be the real part.
For the principle branch we have:
$$\ln(-x)=\ln(e^{\pi i}\cdot x)=\pi i + \ln x$$
Well, in Mathematica it's correctly implemented, i.e., when I plot log[x] it leaves out anything with arguments ##x \leq 0##.

It's also not true that ln is uniquely defined everywhere on the complex plane, but it has an essential singularity (or branching point) at ##z=0##. The standard definition is to cut the complex plane along the negative real axis. The value along the branch cut on one sheet of the corresponding Riemann surface jumps by the value ##2 \pi \mathrm{i}##. On the principal sheet, ##ln z \in \mathbb{R}## for ##z>0##. Consequently on this sheet the principal values along the negative real axis are
$$\ln(z \pm \mathrm{i} 0^+)=\ln(|z|) \pm \mathrm{i} \pi.$$
That's how it's implemented in Mathematica as well as in standard programming languages.

Obviously Wolfram alpha plots real and imaginary part for arguments along the real axis, assuming an infinitesimal positive imaginary part of the argument.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 33 ·
2
Replies
33
Views
6K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
149K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K