Re: finding inverses of functions
- To: mathgroup at smc.vnet.net
- Subject: [mg126438] Re: finding inverses of functions
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Thu, 10 May 2012 04:59:50 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jod7lu$5f8$1@smc.vnet.net>
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 functions. 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 &, -0.305526037783858835745318654576}] Note that this is an exact result that can be evaluated to arbitrary precision: In[65]:= N[%, 100] Out[65]= -0.3055260377838588357453186545759642671712616849155334618731589419894350889720642702908817009965973507 I recommend reading this blog post: http://blog.wolfram.com/2008/12/18/mathematica-7-johannes-kepler-and-transcendental-roots/ -- Szabolcs Horvát Visit Mathematica.SE: http://mathematica.stackexchange.com/