Weighted argument principle (source code)

= Weighted argument principle
{title2=$\frac1{2\pi i}\oint_\gamma h(z)\frac{f'(z)}{f(z)}\,dz=\sum_jm_jh(a_j)-\sum_kn_kh(b_k)$}

The boundary can recover more than a count. Under the hypotheses of the <argument principle>, let $h$ be a <holomorphic function> on a <neighborhood> of the contour and its interior. If the enclosed <zeros of a function> are $a_j$ with <zero multiplicities> $m_j$ and the enclosed <poles> are $b_k$ of orders $n_k$, then
$$
\frac1{2\pi i}\oint_\gamma h(z)\frac{f'(z)}{f(z)}\,dz=\sum_jm_jh(a_j)-\sum_kn_kh(b_k).
$$
Multiplying the local <logarithmic derivative> by $h$ changes its <residue> from $m_j$ to $m_jh(a_j)$, or from $-n_k$ to $-n_kh(b_k)$. The <residue theorem> then gives the identity. Choosing $h=1$ recovers the <argument principle>; choosing $h(z)=z$ gives the sum of the enclosed zero locations minus the sum of the enclosed pole locations, both counted with <zero multiplicities> or pole orders.<NIST Digital Library of Mathematical Functions/1 Algebraic and Analytic Methods>[§1.10(iv), equation 1.10.10]{ref}

For the <rational function> in <argument principle for a rational function>, the $h(z)=z$ integral is $2(1/4)-(-1/2)=1$. Adding the known pole location $-1/2$ back gives a zero-location sum of $1/2$. Dividing by the zero count two gives \b[the arithmetic mean of the enclosed zeros, with multiplicity, as $1/4$]. Choosing $h(z)=z^k$ similarly gives the difference between the <power-sum symmetric polynomials> evaluated on the enclosed zero and pole locations, repeating each location according to its multiplicity or order. These identities let boundary information constrain both the number and aggregate locations of enclosed <zeros of a function>.