Re: Series
- To: mathgroup at smc.vnet.net
- Subject: [mg42675] Re: Series
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Sun, 20 Jul 2003 06:20:54 -0400 (EDT)
- References: <bfasni$gqh$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Just automate the process that you demonstrated seriesCap[expr_, n_] := Module[{a, sym= Cases[expr, _Symbol?(!NumericQ[#]&), Infinity]}, Normal[Series[expr /. Thread[sym -> a*sym], {a, 0, n}]] /. a -> 1]; seriesCap[Sin[x-y^2], 3] -(x^3/6) + x - y^2 Bob Hanlon In article <bfasni$gqh$1 at smc.vnet.net>, Konstantin L Kouptsov <kouptsov at wsu.edu> wrote: << When expanding a function of several arguments in series, I want to retain only terms having the total power not more than some number. For example: Series[Sin[x - y^2], {x, 0, 3}, {y, 0, 3}]// Normal// Expand gives x - x^3/6 - y^2 + x^2 y^2/2 with the unwanted last term of power 4. How to do this in elegant/efficient way? One way is to do Series[Sin[a x - (a y)^2], {a, 0, 3}] /.{a->1} but as the function gets more complicated, this way becomes ugly.