Message Boards Message Boards

9 Replies
3 Total Likes
View groups...
Share this post:

ProductLog shows incorrect plot.

Posted 9 years ago

I am trying to find a inverse function for x/ln(x). Wolfram alpha shows me this function and inverse function, which is -xW(-1/x), where W is ProductLog. I also want to compare -xW(-1/x) and x^1.1(or x^N, where 1 < N < 2), and when I plot -xW(-1/x) function, Wolfram alpha shows another function. The question is how to plot function -xW(-1/x), without using InverseFunction? What am I doing wrong or why -xW(-1/x) looks different in those 2 cases.

POSTED BY: Vladislav Bondur
9 Replies

If you plot f(x) vs x, a plot of the inverse function x(f) is obtained by interchanging the vertical and horizontal axes. You might do this using ParametricPlot[{f[x],x},{x,x1,x2}]

POSTED BY: S M Blinder
Posted 9 years ago

Mathematica definitely gives the same values (where I've plotted the real part of the inverse using the two definitions):

f[x_] := x/Log[x];
fInverse = InverseFunction[f];
Plot[{Re[fInverse[x]], Re[-x ProductLog[-1/x]]}, {x, -15, 15}, 
 PlotStyle -> {{Thickness[0.05], LightBlue}, {Thin, Red}}, 
 PlotRange -> {{-15, 15}, {-1, 3}}]

with output Inverse function

In Wolfram Alpha where is it that you see the wrong plot? The link you show displays the real part and the imaginary part of the inverse and not the original function and its inverse.

POSTED BY: Jim Baldwin
Posted 9 years ago

Maybe "incorrect" is too strong a term but I think I see why it looks wrong (rather than "is wrong"). When curves go off to infinity (I know, that's pretty loose talk) and only a finite number of points approximate a curve where there is a discontinuity, the plotted extreme points get joined (inappropriately). If you are mainly interested in x >= 0, then the plot of x / Log[x] vs. x should look like

graph of x/Log[x] vs. x

Same issue for the inverse.

POSTED BY: Jim Baldwin

Thanks. ParametricPlot not exactly what I asked, but it has helped me in calculations. It`s just interesting, why the result of InverseFunction(x/ln(x)) = -xW(-1/x) and direct plot(-xW(-1/x)) looks different.

PS: One of links was incorrect. Have fixed it.

POSTED BY: Vladislav Bondur

Do you wanna to say, that InverseFunction in wolfram displays the real part and the imaginary part of the inverse? Then, why on Legend displays two caption x/log(x) and -xW(-1/x) (not re(...) and im(...)), or why, for example, InverseFunction(x^2) displays x^2 and sqrt(x) (not re[sqrt(x)] and im[sqrt(x)]).


I don't see anything in common between your and my pictures. And more, x/log(x) different from my picture. I got totally confused.

POSTED BY: Vladislav Bondur
Posted 9 years ago

Yes. The link you provided (shown below) shows two curves and explicitly states that it is showing the real and the imaginary part of the inverse. So I was trying to determine why you were saying that one of the curves was wrong.

inverse function

Was there another link that I didn't see that shows the issue you raise?

POSTED BY: Jim Baldwin

I realize, what you was talking about in previous reply)

My first post contains 3 links. Two of them links on inverse function for x/ln(x). Wolfram alpha says that result of inversion is -xW(-1/x). There are also displayed two graphics mirrored relatively to dash-line y=x. So, those two graphics must be x/ln(x) and InverseFunction(x/ln(x)).

My question was "Why InverseFunction(x/ln(x)) = -xW(-1/x) and plot(-xW(-1/x)) looks different?" I didn`t know how actually -xW(-1/x) looks. Now, thanks for you, I understand that -xW(-1/x) is correct. Then InverseFunction(x/ln(x)) in wolfram alpha is incorrect, or I am doing something wrong?

POSTED BY: Vladislav Bondur

Accidentally duplicated

POSTED BY: Vladislav Bondur

Seems I realize it. So, blue horizontal line segment like part of asymptote? enter image description here

POSTED BY: Vladislav Bondur
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract