MathGroup Archive 2008

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

Search the Archive

Symbolic Linear Function

  • To: mathgroup at
  • Subject: [mg91457] Symbolic Linear Function
  • From: yatesd at
  • Date: Fri, 22 Aug 2008 03:13:31 -0400 (EDT)

I could not find anything in this group or on the internet about
defining a generic linear function in Mathematica. I wanted a symbolic
simplification of an expression where I had an (undefined) function
that I knew was linear. I did the following:

SetAttributes[e,{Flat, Orderless}];
e[a_?NumericQ * x_]:= a * e[x];

This seemed to work fine and gave me the insight I wanted, but I was
wondering if other people have thought about this and have different
solutions or have any comments on my solution.


p.s. The expression I was interested in was Variance[Log[1+x]]. I
Variance[x_]:=e[x^2]-e[x]^2 where e is representing expectation,
although I am not using any properties of expectation other than its
I then looked at the Taylor expansion to order 5 with

  • Prev by Date: Non Default stylesheet format and syntax coloring
  • Next by Date: Help to remove equivalent (redundant) solutions from FindRoot[]
  • Previous by thread: Re: Extending running memory of Mathematica
  • Next by thread: Help to remove equivalent (redundant) solutions from FindRoot[]