1
$\begingroup$

What is the quickest way to extract the constant term from a Laurent polynomial in two variables? For example $x+1 +x^{-2}y+x/y$ has constant term $+1$.

$\endgroup$
1
  • 1
    $\begingroup$ Actual code is vastly preferable to something that cannot be copy-and-pasted. $\endgroup$ Commented Mar 13, 2019 at 14:50

1 Answer 1

5
$\begingroup$
SeriesCoefficient[x + 1 + x^(-1) y + x/y, {x, 0, 0}, {y, 0, 0}]

1

$\endgroup$
2
  • $\begingroup$ Right, is this the quickest way? assume I will repeat this operation many many times $\endgroup$
    – jj_p
    Commented Mar 13, 2019 at 13:40
  • 1
    $\begingroup$ @jj_p: at worst, it should be not too inefficient. You don't mention how complicated your Laurent series can get. $\endgroup$ Commented Mar 13, 2019 at 13:47

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.