I have piecewise continuous function defined below:

  {15 + 1/6*(# - 3), # <= 27},
  {# - 12 + 4 * Exp[-5/24*(#-27)], 27 < #}

This function is monotonically increasing and therefore should be invertible, but Mathematica cannot find the inverse. It spits out an inverse with with a variable C[1] in it that cannot be evaluated. (sorry in advance for poor formatting)

(* ConditionalExpression[1/5 (60 + 24 ProductLog[C[1], -(5/6) E^(25/8 - (5 #1)/24)] + 5 #1), 
    24 Im[ProductLog[C[1], -(5/6) E^(25/8 - (5 #1)/24)]] + 5 Im[#1] == 0 && 
    24 Re[ProductLog[C[1], -(5/6) E^(25/8 - (5 #1)/24)]] + 5 Re[#1] > 75] & *)

I believe this is happening because the 2nd piece of the equation isn't invertible on its own and is really only invertible on the specified domain. However, if you call InverseFunction on this piece by itself you do get an inverse (for the latter part of the function starting from the minimum). Not sure why it doesn't do the same thing for the piecewise case?

I have tried the solution found on this response but it too fails in this case. Is there a way to symbolically invert a piecewise function

I am sure I could iterate through each piece of the function and invert it independently and then evaluate the function at the beginning and end of the condition range to get the domain on the inverse but there has to be a more efficient way. Any suggestions would be appreciated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.