MathGroup Archive 2010

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

Search the Archive

Re: Sin*Cos + Log

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113241] Re: Sin*Cos + Log
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 20 Oct 2010 04:07:55 -0400 (EDT)

f[x_?NumericQ] := Sin[x]*Cos[x] + Log[x]

f /@ {x, 2, 2.}

{f[x], Log[2] + Cos[2] Sin[2], 0.314746}

x /: NumericQ[x] = True;

f /@ {x, y}

{Log[x] + Cos[x] Sin[x], f[y]}


Bob Hanlon

---- 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



  • Prev by Date: Re: Release dates for Mathematica versions
  • Next by Date: Re: Release dates for Mathematica versions
  • Previous by thread: Re: Sin*Cos + Log
  • Next by thread: Re: Sin*Cos + Log