Re: Ask Mathematica to sub for a long expression

*To*: mathgroup at smc.vnet.net*Subject*: [mg71892] Re: Ask Mathematica to sub for a long expression*From*: "dimitris" <dimmechan at yahoo.com>*Date*: Sat, 2 Dec 2006 05:11:43 -0500 (EST)*References*: <ekp4o4$2fq$1@smc.vnet.net>

It is! For example try the following Plus @@ Table[Random[Integer, {0, 10}]*x^Random[Integer, {0, 4}]*Sqrt[a^2 + b^2 - 2*a*b*Cos[theta]], {8}] + x % /. Sqrt[a^2 + b^2 - 2*a*b*Cos[theta]] -> c Solve[% == 0, x] % /. c -> Sqrt[a^2 + b^2 - 2*a*b*Cos[theta]] The following command will take to the proper place within Mathematica book for learning more! FrontEndExecute[{HelpBrowserLookup["MainBook", "2.5"]}] Regards Dimitris aaronfude at gmail.com wrote: > Hi, > > Is it possible to ask Mathematica to replace a long expression, such as > Sqrt[a^2+b^2-2*a*b*Cos[theta]] with "c", whenever it encounters that > long expression? > > Thanks! > > Aaron Fude