Gives a rational function in \(x\), such as
Using sqrfree as follows
restart; get_poles_and_order:=proc(r_in,x::symbol)::list; local r:=r_in,N::posint; local the_poles::list; local item; r:=normal(r); if not type(r,'ratpoly'(anything,x)) then error("Not be a polynomial or a rational function in ",x) fi; the_poles := sqrfree(denom(r),x); the_poles := the_poles[2,..]; #we do not need the overall factor for N,item in the_poles do the_poles[N]:=[solve(item[1]=0,x),item[2]]; od; return the_poles; end proc:
The above proc get_poles_and_order returns back a list of lists. Each sublist has its first
entry the pole and the second entry the order.
Here are some examples
The above says there is a pole at \(x=4\) of order 1 and pole at \(x=5\) of order 3.