Message Boards Message Boards

Invert function using InverseFunction and avoid discontinuity?

Posted 8 years ago

I want to invert this function:

f[x_] = FullSimplify[
  ConditionalExpression[
   x + (-70 + 21 x^2 + 
     Sqrt[7] Sqrt[
      700 + 3 x (-800 + 3 x (300 + x (-80 + 7 x)))])/(-140 + 42 x) - (
    x (-70 + 21 x^2 + 
       Sqrt[7] Sqrt[
        700 + 3 x (-800 + 3 x (300 + x (-80 + 7 x)))]))/(-140 + 42 x),
    0 <= x <= 1]]

I plot the function together with its inverse like this:

Plot[{f[x], InverseFunction[f][x]}, {x, 0, 1}, AspectRatio -> 1]

But this results in a discontinuous function. Is there a way to get around this using InverseFunction? (I use Mathematica 11.0.1.0.)

enter image description here

POSTED BY: Øistein H.
2 Replies
Posted 8 years ago

OK, thanks, helpful to know! I got the same result using Solve too.

POSTED BY: Øistein H.

InverseFunction must be used with circumspection, because it is not well defined, and it has no Reals option. It seems that Reduce is wrong in your particular case too. Remove for simplicity the ConditionalExpression:

g[x_] = x + (-70 + 21 x^2 + 
      Sqrt[7] Sqrt[
        700 + 3 x (-800 + 3 x (300 + x (-80 + 7 x)))])/(-140 + 
      42 x) - (x (-70 + 21 x^2 + 
        Sqrt[7] Sqrt[
          700 + 3 x (-800 + 3 x (300 + x (-80 + 7 x)))]))/(-140 + 
      42 x);

Then the output of the following is wrong in Mma 11.0.1:

Reduce[y == g[x], x, Reals]

You can check it with a plot:

h[y_] = Piecewise[{{Root[-700 y + 
        700 y^2 + (1300 - 490 y - 420 y^2) #1 + (-2190 + 840 y + 
           63 y^2) #1^2 + (1920 - 399 y) #1^3 + (-804 + 63 y) #1^4 + 
        117 #1^5 &, 1], 
     y < 1}, {Root[-700 y + 
        700 y^2 + (1300 - 490 y - 420 y^2) #1 + (-2190 + 840 y + 
           63 y^2) #1^2 + (1920 - 399 y) #1^3 + (-804 + 63 y) #1^4 + 
        117 #1^5 &, 2], y >= 1}}];
ParametricPlot[{h[y], y}, {y, -1, 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