Re: "Solve[x==Erf[x], x]"
- To: mathgroup at smc.vnet.net
- Subject: [mg16612] Re: "Solve[x==Erf[x], x]"
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Fri, 19 Mar 1999 12:53:45 -0500
- Organization: University of Western Australia
- References: <7cd7ff$o7s@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Matthias Tomann wrote: > Can you tell me how to get around this problem an solve equations like > x = 1 - Erf [x] Several other respondents have indicated using FindRoot and Series methods. I'll just add that solving the more general problem with 1 replaced by a parameter, a, In[1]:= sol[a_] := Module[{x},x /. FindRoot[x - a + Erf[x], {x, a}]] allows you to plot the dependence of the solution on a: In[2]:= Plot[{a - 1, a + 1, sol[a]}, {a, -7, 7}, AspectRatio -> Automatic, PlotStyle -> {Hue[0], Hue[1/3], Hue[2/3]}]; As you will see, the behaviour of the solution is quite simple. This is because Erf[x] approximates a step function rather well: In[3]:= Plot[Erf[x], {x, -5, 5}]; Expanding f[x] = x - a + Erf[x] in series about x = a, In[4]:= x - a + Erf[x] + O[x, a]^3 Out[4]= 2 2 2 a (-a + x) Erf[a] + (1 + ------------) (-a + x) - ------------- + 2 2 a a E Sqrt[Pi] E Sqrt[Pi] 3 O[-a + x] and then computing the inverse series, In[5]:= InverseSeries[%] Out[5]= x - Erf[a] a + ---------------- + 2 1 + ------------ 2 a E Sqrt[Pi] 2 2 a (x - Erf[a]) 3 -------------------------------------- + O[x - Erf[a]] 2 2 2 a (1 + ------------) (2 + E Sqrt[Pi]) 2 a E Sqrt[Pi] In[6]:= Normal[%] /. x -> 0 Out[6]= 2 Erf[a] 2 a Erf[a] a - ---------------- + -------------------------------------- 2 2 1 + ------------ 2 2 a 2 (1 + ------------) (2 + E Sqrt[Pi]) a 2 E Sqrt[Pi] a E Sqrt[Pi] gives a very good approximation for a wide range of values, e.g., In[7]:= % /. a -> 3. Out[7]= 2.00058 which should be compared with In[8]:= sol[3] Out[8]= 2.00458 Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://www.physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________