# How to find the lowest power of variable in expression?

If I have expression like

a1/x +a2/x^2 + a3/x^3


I want to return 1/x^3. In general case,

a1/x +a2/x^2 + a3/x^3 + a4/x^4 .....


I will have 1/x^n

Edit:

If I want to print the parameter together, what do I need to do? like an/x^n?

• have you looked at documentation for Exponent? It seems you can get what you want using the code below or a variant thereof (depending on how you want to handle coefficients). In[1901]:= x^Exponent[a/x + b/x^2 + c/x^3, x, Min] Out[1901]= 1/x^3 Commented Apr 7, 2016 at 15:08
• Perhaps Asymptotic[a1/x + a2/x^2 + a3/x^3, x->0] is what you're looking for? Commented May 7 at 15:18

exp=a1/x + a2/x^2 + a3/x^3;
v=Min@Cases[exp, Power[_, x_?NumberQ] :> x, -1];
Cases[exp, Times[x_, Power[_, v]], -1]

• I apologize for asking more question, I forgot to include in the question. If I want to print with the parameter a3/x^3, What would I do? Commented Apr 7, 2016 at 0:05
• @SaesunKim see update. Thanks Commented Apr 7, 2016 at 0:34

You can get all the informations you want in a list, Then to pick the min. It will be the first. The largest is at the end.

expr = a1/x + a2/x^2 + a3/x^3 + a4 x^5 + x^6;
r = {Coefficient[#, x, Exponent[#, x]], #, Exponent[#, x]} & /@ (List @@ expr)


To get the answer you want, now simply pull the second entry in the first cell

 r[[1, 2]]/r[[1, 1]]


• Thank you so much for your help! Commented Apr 7, 2016 at 0:54

I recently came across a need for such a program, and below is what ChatGPT came up with:

ClearAll[LowestPowerTerm, poly, sym, terms, powers]

LowestPowerTerm[poly_, sym_] := Module[{terms, powers},
terms = List @@ poly;
powers = Exponent[terms, sym];
terms[[First @ Ordering[powers]]]
];


An example use; consider the following code:

ClearAll[poly, sym, x]

poly = a1*x^1 + a2*x^(-1) - a3*x^2 + a4*x^(-2);
sym = x;

LowestPowerTerm[poly, sym]


It will return a4*x^(-2), or equivalently a4/x^2.