TITLE: Algebraic operation corresponding to "taking residues at roots of unity"
QUESTION [7 upvotes]: I'm not sure if this is more appropriate for MO or MSE, this is a question that came up in actual research, but it's of a somewhat elementary nature. 
Let $R$ be the ring of rational functions with poles at roots of unity, is there a sufficiently nice way to algebraically describe the operation on $R$ of "taking the sum of residues at roots of unity of $f(x)dx/x$? This operation takes $\frac{x^a}{x^m-1}$ to $1$ if $a$ is a multiple of $m$ and 0 otherwise, and this determines it on the entirety of $R$. By "sufficiently nice", I mean I'd like to be able to describe it purely algebraically, and hopefully without making reference to complex numbers.
What I envisioned was something like "taking the algebraic residue at $x^m-1$", where $m$ is the lcm of the orders of the roots of unity in the denominator of $f$. However this operation is not well defined, as to express an arbitrary polynomial as a series in $x^m-1$ I need to to take $m$th roots. For example, consider the case of $x/x^m-1$, after renaming $x^m-1$ to $\alpha$, the result becomes $Res_{\alpha}\frac{(\alpha+1)^{1/m}}{\alpha}\frac{d\alpha}{\alpha+1}$. 
I still get the correct answer if I take the appropriate residues at each branch and sum them (resulting in 0), but this still requires complex analysis. I could alternatively just declare such functions have 0 residue, but I don't have any justification for doing that. 
EDIT: Because of the particulars of my situation, I'm specifically looking for an interpretation somehow in terms of the functions $x^\alpha-1$.

REPLY [6 votes]: The sum of the (finite) residues of a rational function $F(x)$ is equal to 
 $$ -\mathrm{Res}(F(x),x=\infty) = \mathrm{Res}\left( \frac{1}{x^2}F(1/x), x=0\right). $$
This is just the coefficient of $x$ in the Laurent expansion with finitely many negative exponents of $F(1/x)$ at $x=0$.