Re: Taylor Series Expansions
- To: mathgroup at smc.vnet.net
- Subject: [mg32379] Re: [mg32372] Taylor Series Expansions
- From: BobHanlon at aol.com
- Date: Thu, 17 Jan 2002 02:23:32 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 1/16/02 5:45:03 AM, jhelfand at wam.umd.edu writes: >Mathematica has a built in Series function. But when >you use this for multi-variable functions, it doesn't do quite what I'd >expect. Let's say I have a function for two fariables, and I want to >expand to 2nd order. When I use Series, it expands each varible to >second order, but includes the cross terms, which I want to belong to a >4th order expansion. For example: > >In[1172]:= >Normal[Series[Exp[x y], {x, 0, 2}, {y, 0, 2}]] > >Out[1172]= >\!\(1 + x\ y + \(x\^2\ y\^2\)\/2\) > >But what I really want is just 1 + x y, where if I go to fourth order, >then I'll take the x^2 y^2 / 2. k=6; Normal[Series[Exp[x y],{x,0,k},{y,0,k}]] (x^6*y^6)/720 + (x^5*y^5)/120 + (x^4*y^4)/24 + (x^3*y^3)/6 + (x^2*y^2)/2 + x*y + 1 %/. ((a_*x^m_*y^n_) /; m+n>k):>0 (x^3*y^3)/6 + (x^2*y^2)/2 + x*y + 1 %%/. ((a_*x^m_*y^n_) /; m+n>2):>0 x*y + 1 Bob Hanlon Chantilly, VA USA