Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Free variables in an expression

  • To: mathgroup at
  • Subject: [mg54796] Re: Free variables in an expression
  • From: David Bailey <dave at>
  • Date: Wed, 2 Mar 2005 01:26:42 -0500 (EST)
  • References: <d0142d$oon$>
  • Sender: owner-wri-mathgroup at

Sascha Kratky wrote:
> Is there a Mathematica built-in function that gives a list of free
> (unbound) variables in an arbitrary expression?
> Thanks,
> Sascha

Union[Cases[a+b+x y a,_Symbol,\[Infinity]]]


Note that although the expression a+b+x y a contains some other symbols, 
such as Plus (look at the FullForm representation), they don't get 
included because they are present in heads. You might need to exclude 
such 'variables' as Pi, though.

Of course, you can build the above into a function definition so you 
don't need to type it all every time you need it.

David Bailey

  • Prev by Date: Re: Free variables in an expression
  • Next by Date: Re: computing residues
  • Previous by thread: Re: Free variables in an expression
  • Next by thread: fit and data analisys