I have a function of $f(x,y)$, where $x,y$ are very small numbers. I want to series expand it to the $3$rd power. However I don't want the terms such that $x^2y^2$, $xy^3$ etc. because I would reckon this as $4$th power. How do I tell mathematica to do this.
As a concrete example, consider the following input:
ClearAll["Global`*"]
δE =
x^2 (Sqrt[1 + x^2] -
x) (2 - (Sqrt[1 + x^2] - x)/(Sqrt[1 + y^2] - y)) +
2/3 ((Sqrt[1 + y^2]^3 - y^3) - (Sqrt[1 + x^2]^3 - x^3)) -
y^2 (Sqrt[1 + y^2] - y);
Series[δE, {x, 0, 3}, {y, 0, 3}] // Simplify
In the output, I need only the terms $y^3/3-yx^2+2x^3/3$ kept.
// Normal // Simplify
$\endgroup$Expand[Fold[(#1.{x, y} + #2) &, Take[CoefficientArrays[Normal[series], {x, y}], {4, 1, -1}]]]
. $\endgroup$x -> x t
andy-> y t
and useSeries
with regard tot
upto third order. After takingNormal
, you can then replacet -> 1
again. $\endgroup$