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

Click For Summary
SUMMARY

The discussion centers on the behavior of the natural logarithm function, ln(x), in Wolfram Alpha, particularly its treatment of negative values. Users noted that Wolfram Alpha defaults to complex numbers, allowing ln to be defined for negative inputs, which results in outputs that include an imaginary component. The conversation also clarified that ln(x) is not equivalent to ln(abs(x)), as Wolfram Alpha handles both correctly, but the traditional definition of ln(x) restricts x to positive values. Additionally, the ambiguity of the term "log" was discussed, with users emphasizing that in many contexts, "log" refers to ln, while in others it may denote log base 10 or log base 2.

PREREQUISITES
  • Understanding of complex numbers and their properties
  • Familiarity with logarithmic functions and their definitions
  • Knowledge of Wolfram Alpha's functionality and output interpretation
  • Basic calculus concepts, particularly integration involving logarithmic functions
NEXT STEPS
  • Explore the properties of logarithmic functions in complex analysis
  • Learn about the principal branch of logarithms and its implications
  • Investigate how to use Wolfram Alpha for complex-valued functions
  • Study the differences between ln(x) and ln(abs(x)) in calculus
USEFUL FOR

Mathematicians, students studying calculus, anyone using Wolfram Alpha for mathematical computations, and educators explaining logarithmic functions.

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,457
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
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
149K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K