Re: Sin*Cos + Log
- To: mathgroup at smc.vnet.net
- Subject: [mg113246] Re: Sin*Cos + Log
- From: Leonid Shifrin <lshifr at gmail.com>
- Date: Wed, 20 Oct 2010 04:08:56 -0400 (EDT)
Sam, You will have to somehow let Mathematica know which functions must be computed with some particular argument (In your example, functions Sin, Cos and Log, but not Plus). Here is one way: In[13]:= funs = {Sin, Cos, Log} Out[13]= {Sin, Cos, Log} In[14]:= f = Sin*Cos + Log Out[14]= Log + Cos Sin In[15]:= f /. (ff : Alternatives @@ funs) :> ff[x] Out[15]= Log[x] + Cos[x] Sin[x] Regards, Leonid On Tue, Oct 19, 2010 at 2:54 AM, Sam Takoy <sam.takoy at yahoo.com> wrote: > Hi, > > I'm working on a project that involves manipulating lots of functions. > It would be much easier if I could manipulate functions without > evaluating them and then evaluate them at the end. To this end, is there > a way to endow > > f = Sin*Cos + Log > > with meaning and then somehow evaluate > > f[x]? > > Many thanks in advance, > > Sam > >