Best way to power series expand in multiple variables? [duplicate]

A power series expansion of a multivariate function can be performed with the Series command, which performs each expansion consecutively. The results can be a bit clunky, however.

Often "mixed" terms will show up. For instance, a function f(x,y) expanded to the first order about zero in x then y will often have terms a*x*y with a some constant. Since we've aske for a first-order expansion, terms like a*x*y are undesirable. It is easy-enough to fix this in the two-variable case with something like this.

ReplaceAll[#,{x*y :> 0}]&


But in n variables, an explosion in the number of possible combinations becomes prohibitive to use this "by-hand" type of fix. Is there an elegant solution to this? I could write a routine to generate all combinations and corresponding list of replacement rules, but this seems... excessive.

Is there a better way to perform the expansion that avoids this? Or is there an elegant simplification method?

marked as duplicate by Jens, Sjoerd C. de Vries, Thies Heidecke, Michael E2, m_goldbergAug 21 '13 at 12:06

• The usual way to do this is to replace vars by t*vars, e.g. Thread[{x,y,z}->t*{x,y,z}], then expand in t, then maybe use Normal[expansion] /. t->1. Modify as needed if not expanding at the origin (either translate or, if at infinity, use reciprocals-- whatever it takes so that you can expand at t=0). – Daniel Lichtblau Aug 20 '13 at 21:00
• @MichaelE2, my application where this issue arises is pretty esoteric, so I doubt it would be of general interest. Because I'm often changing variables of a differential equation, I have substitution routines that substitutes functions for functions, which account for the changes in variable of derivatives with ease. If I use these routines to substitute {x,y,z} for t*{x,y,z}, even terms that are derivatives of {x,y,z} will be replaced and these t coefficients will be expanded over---which is undesirable. However, I realize that most people will simply use ReplaceAll. Which works. – Rico Picone Aug 26 '13 at 18:35