Re: Finding the inverse of a function?

• To: mathgroup at smc.vnet.net
• Subject: [mg24196] Re: [mg24193] Finding the inverse of a function?
• From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
• Date: Fri, 30 Jun 2000 01:57:25 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```on 6/29/00 11:51 AM, heathw at in-tch.com at heathw at in-tch.com wrote:

> Hi,
> Is there some way to make Mathematica find the inverse of a user defined
> function? I read the Mathematica Book and found InverseFunction[ ] but
> it will only show the inverse of a Mathematica function. I would like to
> be able to find the inverse of polynomials.
> Thanks,
> Heath
>
The only polynomials that have inverses are degree one polynomials, that
is, non-constant linear functions. Of course if you only want a right
inverse and do not care that it is not a continuous function of x in the
complex plane, it is easy to do, e.g.:

In[69]:=
inverse[f_, x_] /; PolynomialQ[f, x] && Not[FreeQ[f, x]] :=
Module[{y}, Solve[f == y, x][[1, 1, 2]] /. y -> x]

Now

In[70]:=
inverse[3x + 3, x]
Out[70]=
-3 + x
------
3

In[71]:=
inverse[3x^2 + 3x + 5, x]
Out[71]=
-3 - Sqrt[3] Sqrt[-17 + 4 x]
----------------------------
6

In[73]:=
3x^2 + 3x + 5 /. x -> inverse[3x^2 + 3x + 5, x] // Simplify
Out[73]=
x

or if you prefer

In[74]:=
Composition[3#^2 + 3# + 5 &, Function @@ {inverse[3#^2 + 3# + 5, #]}][
t] // Simplify
Out[74]=
t

--
Andrzej Kozlowski
Toyama International University, JAPAN

For Mathematica related links and resources try:
<http://www.sstreams.com/Mathematica/>

```

• Prev by Date: Re: saving notebook files
• Next by Date: Re: Cases, Throw, and Catch
• Previous by thread: Re: Finding the inverse of a function?
• Next by thread: Random Walks