Re: How to obtain numberical value from an InverseFunction?

• To: mathgroup at smc.vnet.net
• Subject: [mg80970] Re: [mg80916] How to obtain numberical value from an InverseFunction?
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Thu, 6 Sep 2007 05:36:10 -0400 (EDT)
• References: <200709050658.CAA27206@smc.vnet.net>

```
On 5 Sep 2007, at 08:58, Nasser Abbasi wrote:

> Hello;
>
> Are inverse function in Mathematica only have symbolic form and
> can't be
> used to evaluate numerically?
>
> Anything I am trying is not working, this is a very simple example:
>
> f[x_] := x
> InverseFunction[f][x]
>
> Now, how to evaluate anything out of the above? say for x=0.5, I
> expected to
> get .5, but all I get is just
> f(^-1)[x][.5]
>
> any ideas? Very little help on InverseFunctions.
>
> Nasser
>
>
InverseFunction works only for certain built in Mathematica functions
such as:

InverseFunction /@ {Sin, Exp, Log, Tan}
{ArcSin, Log, Exp, ArcTan}

This only works if Mathematica actually knows the inverse function of
the argument of InverseFucntion (in other words, the inverse funciton
has to be a buil-in Mathematica function itself). In all other cases
InverseFunction[f] is left unevaluated, which is what you are

This behaviour is entirely reasonable because there are no general
algorithms for computing inverse functions symbolically (even when
they exist). On the other hand, it is easy to compute numerical
approximations to inverse functions (when they exist) over finite
intervals  by using interpolation. For example, to find approximately
the inverse function of Sin[x] over the interval {0,Pi/2} all you
need to do is to compute:

f = Interpolation[Table[{Sin[x], x}, {x, 0, Pi/2, 0.01}]]

If you plot f and ArcSin[x] on the same plot over the interval 0.01
to Pi/2 you will see that the graphs conicide almost perfectly:

Plot[{f[x], ArcSin[x]}, {x, 0.01, 1}]

Andrzej Kozlowski

```

• Prev by Date: Re: How to compile this module?
• Next by Date: Re: random points!
• Previous by thread: How to obtain numberical value from an InverseFunction?
• Next by thread: Re: How to obtain numberical value from an InverseFunction?