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}]