# nested series expansion

I have to invert the following matrix in which the functions U[t,x,y,r] and K[t,x,y,r] and all their derivatives are "small";

matr={{(1 - 2*U[t, x, y, r]/c^2 - 2*D[K[t, x, y, r], t]/c), -D[
K[t, x, y, r], x], -D[K[t, x, y, r], y], -D[K[t, x, y, r],
r]}, {-D[K[t, x, y, r], x], -(1 + 2*U[t, x, y, r]/c^2), 0,
0}, {-D[K[t, x, y, r], y], 0, -(1 + U[t, x, y, r]/c^2),
0}, {-D[K[t, x, y, r], r], 0, 0, -(1 + 2*U[t, x, y, r]/c^2)}}


furthermore I need the final expression only up to the order c^-2. I am using the code:

Simplify[Series[
Series[Series[
Series[Series[
Series[Inverse[matr], {c, Infinity, 2}], {D[K[t, x, y, r], r],
0, 1}], {D[K[t, x, y, r], y], 0, 1}], {D[K[t, x, y, r], x], 0,
1}], {U[t, x, y, r], 0, 1}], {D[K[t, x, y, r], t], 0, 1}]]


The problem is that inevitably, there are terms of the type:

D[K[t,x,y,r],t]*D[K[t,x,y,r],x]


and so on.

Is it possible to tell Math. that those terms are small too, without adding them to the series?

Even better: how can I simplify my nested series expansion?

EDIT

To answer @Daniel Lichtblau

The "small" terms must be at first order.

There are no problem in terms of the type c.small=TooSmallToKeep.

-
To what order will you retain "small" terms? And are there interactions with c that determine smallness e.g. small*c==tooSmallToKeep? –  Daniel Lichtblau Apr 23 at 16:56
The small terms must be at first order, and no there are no problem like the ones you cited. I edit the post to explain it better –  mattiav27 Apr 23 at 17:21
One way then is to write your matrix as mat=A+S where A is all regular terms or zeros and S is entirely small terms or zeros. A must be invertible and so mat=(I+SA^(-1))A where I is the identity matrix. The inverse, approximated to first order, can be now written as mat^(-1) is then A^(-1) (I - SA^(-1) + terms that get dropped). No need to use Series for this until you are ready to expand in c. –  Daniel Lichtblau Apr 23 at 17:56

The factors $c^2$ should be no problem, so I'll focus on the question how we can tell Mathematica that all the functions are small. It boils down to introducing a bookkeeping parameter $\epsilon$ that is eventually set to $1$ after it has served its purpose of keeping track of powers of the small quantities:

replacementRule = {U :> (ϵ u[##] &),
K :> (ϵ k[##] &)};

matr = ReleaseHold[
Hold[
{{(1 - 2*U[t, x, y, r]/c^2 - 2*D[K[t, x, y, r], t]/c), -D[
K[t, x, y, r], x], -D[K[t, x, y, r], y], -D[K[t, x, y, r],
r]}, {-D[K[t, x, y, r], x], -(1 + 2*U[t, x, y, r]/c^2), 0,
0}, {-D[K[t, x, y, r], y], 0, -(1 + U[t, x, y, r]/c^2),
0}, {-D[K[t, x, y, r], r], 0, 0, -(1 + 2*U[t, x, y, r]/c^2)}}
] /. replacementRule
];

Normal[Series[Inverse[matr], {ϵ, 0, 1}]] /. ϵ ->
1 // MatrixForm


the replacementRule takes your function names and replaces them with new functions (of the same number of arguments (##) using lower case names. But these new functions are multiplied by the parameter ε.

To do the replacement, I take your initial definition and wrap it in Hold so the derivatives aren't done until the renaming has occurred, at which time ReleaseHold allows the evaluation. This is something you could of course also do by hand, but maybe not if your real application is larger.

Then the Series expansion requires only a single expansion, in terms of ε. You have to use Normal to convert the SeriesData object to a "normal" expression before finally setting ε to 1.

This is closely related to the question Multivariable Taylor expansion does not work as expected, except that here we have to work with functions.

-