Multivariate Taylor series expansion in Mathematica
Asked Answered
J

1

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

Josephus answered 12/10, 2011 at 23:4 Comment(2)
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.Regality
@Regality - 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. :)Puccini
E
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

Euboea answered 12/10, 2011 at 23:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.