I try to get the inverse of a simple function like x^2,x≥0. Still, when I use InverseFunction Mathematica gives me back -(y^0.5) which is indeed an inverse, but for x≤0:

InverseFunction[#^2 &]

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

-Sqrt[#1] &

I know I could just fix the problem putting a minus before InverseFunction. But is there a way to choose which of the inverse function I can get back, when I deal with a non-injective function like x^2? In other words, which is the option so that InverseFunction gives me back (y^0.5) instead fo -(y^0.5)? Thank you


1 Answer 1


You can use ConditionalExpression to control which branch InverseFunction uses:

InverseFunction @ Function[x, ConditionalExpression[x^2, x<0]]
InverseFunction @ Function[x, ConditionalExpression[x^2, x>0]]

Function[x, ConditionalExpression[-Sqrt[x], x >= 0]]

Function[x, ConditionalExpression[Sqrt[x], x >= 0]]

  • 1
    $\begingroup$ Can we find all possible inverse of a function? For example, how can we find all inverse functions of (2^(x-1)-1)/x? $\endgroup$
    – GarouDan
    May 19, 2018 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.