MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: finding inverses of functions

On 2012.05.09. 9:51, John Accardi wrote:
> Hello,  I am trying to get Mathematica to find the inverse of:
> y = 3x^3 + 2e^(2x)  (which I know is invertible)
> InverseFunction only seems to give inverses of built-ins, like Sine.
> I tried:
> Solve[ y == 3x^3 + 2e^(2x), x ] but get a message that Solve does not have methods suitable.  (Solve works for simpler functions, however.)
> Any ideas?  Thanks.

While it's easy to see that this function has an inverse on the set of 
reals, the inverse function might not be expressible using elementary 

This doesn't prevent Mathematica from being able to compute the inverse 
function to arbitrary precision at any point.

Let's write it as a pure function:

   f = Function[x, 3 x^3 + 2 E^(2 x)]

Note that Exp[1] is written as E, and not as e.

The inverse of this function is represented in Mathematica with

   if = InverseFunction[f]

Since you know that the inverse exists, you can use this confidently. 
You can evaluate it for machine numbers like this:

In[63]:= if[1.]
Out[63]= -0.305526

Or for exact numbers like this:

In[64]:= if[1]
Out[64]= Root[{-1 + 2 E^(2 #1) + 3 #1^3 &, 

Note that this is an exact result that can be evaluated to arbitrary 

In[65]:= N[%, 100]

I recommend reading this blog post:

Szabolcs Horvát
Visit Mathematica.SE:

  • Prev by Date: Re: installing cdf-reader on chrome under linux?
  • Next by Date: Re: Typesetting built-in functions without evaluating
  • Previous by thread: Re: finding inverses of functions
  • Next by thread: Re: finding inverses of functions