Re: Expanding function names to explicit formulas
- To: mathgroup at smc.vnet.net
- Subject: [mg8164] Re: [mg8104] Expanding function names to explicit formulas
- From: David Withoff <withoff>
- Date: Sat, 16 Aug 1997 11:51:07 -0400
- Sender: owner-wri-mathgroup at wolfram.com
> Hello, > > Is there any way to convert input or output that includes function > names (say, Erf[x]) to its explicit mathematical form (with the integral > symbol and such)? > > Regards. > -- > __|__ > ___\_/___ Paulo Mouat, > ___ mouat at mail.telepac.pt > |___| http://www.geocities.com/Vienna/8804/ > |___| You can do this in the same way that you can convert an output such as the integer 4 into its explicit mathematical form 2+2: In[5]:= 4 /. 4 -> HoldForm[2+2] Out[5]= 2 + 2 If you release the hold, then Mathematica will convert 2+2 into 4, and will likewise convert the integral represention of Erf[x] into Erf[x]. In[14]:= convert[p_] := p /. Erf[x_] -> HoldForm[2/Sqrt[Pi] Integrate[Exp[-t^2], {t, 0, x}]] In[15]:= result = convert[Erf[x]] 2 2 Integrate[Exp[-t ], {t, 0, x}] Out[15]= -------------------------------- Sqrt[Pi] In[16]:= ReleaseHold[result] Out[16]= Erf[x] Dave Withoff Wolfram Research