# Determinant of matrix with asymptotic expansion

i have determinant which each element have asymptotic expansion.

$$\begin{bmatrix}1+5/s+6/s^3+O[1/s^4] & 1+8/s+4/s^2+O[1/s^4]\\1+2/s+2/s^3+O[1/s^4] & 1-1/s+8/s^3+O[1/s^4]\end{bmatrix}$$

M = ({
{1 + 5/s + 6/s^3 + O[1/s]^4, 1 + 8/s + 4/s^2 + O[1/s]^4},
{1 + 2/s + 2/s^3 + O[1/s]^4, 1 - 1/s + 8/s^3 + O[1/s]^4}
}


when calculating determinant, Mathematica returned an expression that had a O[1/s^6] in it.

48/s^6-8/s^5+18/s^4+4/s^3-25/s^2-6/s+(12 (O[1/s]^1)^4)/s^3-(4 (O[1/s]^1)^4)/s^2-(6 (O[1/s]^1)^4)/s


I want the result to show up to $$O[1/s^4]$$. How can i do that?

The O representation of an expansion point of Infinity is obtained with:

O[x, Infinity]


(see this part of the documentation for O).

So, you just need to do:

M = {
{1+5/s+6/s^3+O[s,Infinity]^4,1+8/s+4/s^2+O[s,Infinity]^4},
{1+2/s+2/s^3+O[s,Infinity]^4,1-1/s+8/s^3+O[s,Infinity]^4}
};

Det[M] //TeXForm


$$-\frac{6}{s}-\frac{25}{s^2}+\frac{4}{s^3}+O\left(\left(\frac{1}{s}\right)^4\right)$$

• thank you for solution. Sep 25, 2019 at 15:06
• Good answer. But the O[1/s] notation is also used for other infinities (-Infinity, ComplexInfinity, etc.) with no visible difference. When in doubt, look at the InputForm for the result to know which infinity is being used. Oct 2, 2019 at 20:23

You may notice that SeriesData issues a message when you define this matrix. It's not recognizing 1/s as a valid variable, which is why O[1/s] doesn't work as advertised.

A quick and dirty fix is to just replace s with 1/invS and then replace it back after Det:

Det[M /. s -> 1/invS] /. invS -> 1/s


-(6/s)-25 (1/s)^2+4 (1/s)^3+O[1/s]^4

Edit:

It seems like you can get reciprocal powers like so:

SeriesData[s, Infinity, {1, 5, 0, 6}, 0, 4, 1]


1+5/s+6/s^3+O[1/s]^4

This series representation should obey series arithmetic correctly. I don't really understand why that output doesn't work when used as normal input, though.

• thank you so much. Sep 25, 2019 at 9:43
• @cabri61 No problem. I think you may have hit some sort of strange idiosyncrasy of the SeriesData system. I updated the answer with an example of how to get reciprocal powers working correctly. Sep 25, 2019 at 9:49