Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Oct 14, 2017 #1

    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:


    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.



    Attached Files:

  2. jcsd
  3. Oct 14, 2017 #2


    Staff: Mentor

    How about ln(abs(x)) or ln|x|? And yes, meanwhile log without an explicit basis means ln.
  4. Oct 14, 2017 #3

    I like Serena

    User Avatar
    Homework Helper

    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: Oct 14, 2017
  5. Oct 14, 2017 #4


    Staff: Mentor

    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)##.
  6. Oct 14, 2017 #5


    Staff: Mentor

    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.
  7. Oct 14, 2017 #6
    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
  8. Oct 14, 2017 #7


    User Avatar
    Science Advisor
    Gold Member

    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: Oct 15, 2017
  9. Oct 15, 2017 #8

    I like Serena

    User Avatar
    Homework Helper

    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: Oct 15, 2017
  10. Oct 15, 2017 #9


    User Avatar
    2016 Award

    Staff: Mentor

    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.
  11. Oct 15, 2017 #10

    I like Serena

    User Avatar
    Homework Helper

    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: Oct 15, 2017
  12. Oct 15, 2017 #11
    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!!
  13. Oct 18, 2017 #12


    Staff: Mentor

    Two of my motorcycles are started using a "handle" (kickstarter).
  14. Nov 1, 2017 #13


    User Avatar
    Science Advisor
    2016 Award

    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.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Discussions: Wolfram Alpha graph of ln(x) shows as ln(abs(x))
  1. Ln x (Replies: 12)

  2. Integrate (ln ln x)^n (Replies: 5)

  3. Derivative of Ln(x) (Replies: 6)