The title basically says it all: is there a way in Mathematica to automatically compute the residues at all poles of a function $f(z)$ and present them as well as their sum in a list or table?
A simple example would be something like $$f(z) = \frac{g(z)}{h(z)},$$ where $g(z)$ and $h(z)$ would both be polynomials. E.g. for $h(z) = (z - a)(z^2 - b^2)$, I would like Mathematica to calculate the residues at $z = a$ and $z = \pm b$ and then present them individually and what they add up to, i.e. in this case
- $\operatorname{Res}[f(z),a] = \frac{g(a)}{a^2-b^2}$,
- $\operatorname{Res}[f(z),\pm b] = \mp\frac{g(\pm b)}{2 b (a\mp b)}$,
- $\sum\limits_{z_i \in \{a,\pm b\}} \operatorname{Res}[f(z),z_i] = \frac{2 b g(a)+(a-b) g(-b)-(a+b) g(b)}{2 b (a-b) (a+b)}$.
InputForm
notation preferably (to expand on the request by @bill s) $\endgroup$Residue
for example? This appears to be a one-liner, if one allows for a modestly long line. $\endgroup$Solve
. Example:In[85]:= g = z^2 + 3*z - 7; h = (z - a)*(z^2 - b^2); Table[ Residue[g/h, {z, rt}], {rt, z /. Solve[Denominator[g/h] == 0, z]}] Out[86]= {(-7 + 3 a + a^2)/(a^2 - b^2), (-7 - 3 b + b^2)/( 2 b (a + b)), (7 - 3 b - b^2)/(2 (a - b) b)}
$\endgroup$