6

Mathematica seems to be missing a function for this, or I can't find it anyway.

The Series function can do expansion in succession for multiple variables, but it doesn't seem capable of doing a full multivariate expansion.

Does anyone know how to do this?

Thanks

rcollyer
  • 10,475
  • 4
  • 48
  • 75
Nick
  • 5,228
  • 9
  • 40
  • 69
  • 1
    Try `Series[f[x, y], {x, a, 1}, {y, b, 1}] // Normal // Expand // Collect[#, Derivative[_, _][f][__], Simplify] &` which gives the expected series to the first order. (Although, the mixed derivative `Derivative[1, 1][f][a,b]` is technically a second order term.) Additional orders can be generated like you expect. – rcollyer Oct 13 '11 at 04:31
  • @rcollyer - thanks for sharing the Collect[#, Derivative[_, _][f][__], Simplify] expression. Somehow I've never come across that type of usage before (but, of course, *now* I see a similar example in the docs). Teaching the blind to see---congrats. :) – telefunkenvf14 Dec 11 '11 at 15:59

1 Answers1

8

This question is not clear to me. Do you mean something like this, where you get terms up to some specified total degree?

f[x_, y_] := Sin[x*y^2] + x^4*y - 3*x*Cos[y] - x^2*y^3

Normal[Series[f[x*t, y*t], {t, 0, 5}]] /. t -> 1
(*
->  -3*x + x^4*y + (5*x*y^2)/2 - x^2*y^3 - (x*y^4)/8
*)

Daniel Lichtblau

Dr. belisarius
  • 60,527
  • 15
  • 115
  • 190
Daniel Lichtblau
  • 6,854
  • 1
  • 23
  • 30