Message Boards Message Boards

1
|
4038 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

InverseFunction of x^3 warning::ifun: Inverse functions are being used...

Posted 3 years ago

I'm trying to get the inverse function of x^3 by using InverseFunction. Can anyone explain the result please? I really didn't get the meaning of the symbols # and & in this context.

I got the error: InverseFunction::ifun: Inverse functions are being used. Values may be lost for multivalued inverses.

f[x_] := x^3
InverseFunction[f]

enter image description here

POSTED BY: Gennaro Arguzzi
3 Replies
Posted 3 years ago

Hi Gennaro,

Plotting the real and imaginary parts of the solutions is a nice way to visualize the problem.

SolveValues[x^3 == y, x] //
  Map[ReImPlot[#, {y, -2, 2},
       Frame -> True,
       PlotLabel -> Style[#, Black],
       PlotLabels -> "Expressions",
       ReImStyle -> {Automatic, Directive[Red, Dashing[{0.02, 0.01}]]},
       ImageSize -> Large] &] //
  Partition[#, UpTo@2] & //
  Grid[#,
   Frame -> All,
   Alignment -> Top,
   Spacings -> {1, 1}] &

enter image description here

POSTED BY: Rohit Namjoshi

Thank you very much @Gianluca Gorni for your useful explanantion.

POSTED BY: Gennaro Arguzzi

It is not an error, but rather a warning that you are trying to inverte a function that is not invertible in the complex plane. If you wanted the inverse of x^3 on the real line, the answer given by InverseFunction is wrong for negative inputs:

In[176]:= InverseFunction[Function[#^3]][-1.]

Out[176]= 0.5 + 0.866025 I

What you need is either Solve[x^3 == y, x, Reals] or Surd[y, 3], but I don't know a way to get those with InverseFunction, which is not sophisticated in this respect:

Solve[x^3 == y, x, Reals]
Plot[Root[-y + #1^3 &, 1], {y, -2, 2}]
Plot[Surd[y, 3], {y, -2, 2}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract