0
$\begingroup$

The Series[] command is useful for reformatting algebraic expressions and getting rid of higher-order terms:

In[1]:= Series[ a0 + a1*x + a2*x^2 + a3*x^3 + a4*x^4, {x, 0, 2}] 
Out[2]:= a0 + a1*x + a2*x^2 + O(X^3)

Now suppose we have a variable which also has indices (e.g. $x_i$ with $i=1, ..., N$), and we want to find expansion of a term up to some order of the variable which neglects the indices. For instance, given an expression \begin{equation} a_0 + a_1 x_1 + a_2 x_2 + a_{11} x_1^2 + a_{12} x_1 x_2 + a_{22} x_2^2 + a_{111} x^3 + etc. \end{equation} I'd like to have an expansion which to lowest orders $k$ gives \begin{align} k=0&: a_0 + O(x_i)\\ k=1&: a_0 + a_1 x_1 + a_2 x_2 + O(x_i^2) \\ k=2&: a_0 + a_1 x_1 + a_2 x_2 + a_{11} x_1^2 + a_{12} x_1 x_2 + a_{22} x_2^2 + O(x_i^3) \\ \end{align}

Is there any command to do this?

$\endgroup$
3
  • $\begingroup$ f[x_] := a0 + a1*x + a2*x^2 + a3*x^3 + a4*x^4; Table[Series[a0 + a1*x + a2*x^2 + a3*x^3 + a4*x^4, {x, 0, k}], {k, 0, 5}] $\endgroup$
    – cvgmt
    Commented Nov 19, 2020 at 13:38
  • $\begingroup$ Do a search on 'mathematica stackexchange multivariate series' (without quotes) and there will be several relevant hits. $\endgroup$ Commented Nov 19, 2020 at 16:38
  • 1
    $\begingroup$ Yes, it does, thanks! $\endgroup$ Commented Nov 19, 2020 at 20:10

0

Browse other questions tagged or ask your own question.