Re: COLLECT and application of various commands to each coefficient
- To: mathgroup at smc.vnet.net
- Subject: [mg21226] Re: COLLECT and application of various commands to each coefficient
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Mon, 20 Dec 1999 02:27:47 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <83aaed$qpf@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Collect[expr,{Cos[x],Sin[x]}] /. {a_.Sin[x]:> Simplify[a]*Sin[x], b_.Cos[x]:>Simplify[b,Element[n,Integers]]Cos[x]} may help you Regards Jens Blimbaum Jerry DLPC wrote: > > I want to simplify a long expression using the Collect command. I > notice that it allows you to apply a command to each of the coefficients, > e.g. > > Collect[expr,{Cos[x],Sin[x]},Simplify] > > But Simplify here applies to both coefficients. What if I want to > do different things with each coefficient, e.g. > > Collect[expr,{Cos[x],Sin[x]},{Collect coefficient of Cos[x] in terms > of x^2,Simplify Coefficients of Sin[x]]}] > > Can this be done within the Collect command? I tried it literally > as I wrote above but that didnt work. > > Thanks. jerry blimbaum NSWC Panama City, Fl