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?


2 Answers 2


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 = {

Det[M] //TeXForm


  • $\begingroup$ thank you for solution. $\endgroup$
    – cabri61
    Sep 25, 2019 at 15:06
  • 3
    $\begingroup$ 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. $\endgroup$ 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


It seems like you can get reciprocal powers like so:

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


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.

  • $\begingroup$ thank you so much. $\endgroup$
    – cabri61
    Sep 25, 2019 at 9:43
  • $\begingroup$ @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. $\endgroup$ Sep 25, 2019 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.