# how to get coefficient list from a polynomial with negative powers

Say a polynomial x^2-x^(-2), I need to extract its coefficient. I tried the command CoefficientList[x^2-x^(-2)], but no result comes out.

I am confused why it happens. How can I get the desired result {-1,0,0,0,1}?

It should be an easy question, but I do not know the suitable command. Would you please give me some tips?

Would it be OK for you to look separately for the list of coefficients with positive and that with negative powers? If yes, try this. Let us introduce a rule transforming, say, x^-2 into y^2:

rule = Power[x, n_] /; n < 0 -> y^-n;


p = x^2 - x^(-2);


Now this:

CoefficientList[p /. rule, x] /. y -> 0
CoefficientList[p /. rule, y] /. x -> 0
(* {0, 0, 1}
{0, 0, -1}   *)


gives us the answers separately for positive and negative powers.

Have fun!

• Thank you for your answer! It is ok to separate items with positive and negative powers. But I still wonder why there is no such a direct command to gain coefficients for both items with positive and negative powers:) Nov 16 '18 at 12:14
• It is a general situation. Mma has no all functions that one can wish. In this case, we may write our own functions and use when needed. Taking my idea as a basis you might like to construct such a function. Nov 16 '18 at 13:02

Could find the min exponent, then make it an explicit polynomial.

laurentCoefficientList[lpol_, x_] := With[
{min = Exponent[lpol, x, Min]}, CoefficientList[lpol/x^min, x]]

In[56]:= laurentCoefficientList[x^2 - x^(-2), x]

(* Out[56]= {-1, 0, 0, 0, 1} *)


CoefficientList[x^2 - x^(-2), x]