Question from Complex analysis by Bak & Newman, page 141.
"Let $C$ be a regular curve enclosing the distinct points $w_1,...,w_n$ and let $$p(w)=(w-w_1)\cdots(w-w_n)$$ Suppose that $f(w)$ is analytic in a region that includes $C$. Show that $$P(z)={1\over 2\pi i}\int_C{f(w)\over p(w)}\cdot {p(w)-p(z)\over w-z}dw$$ is a polynomial of degree $n-1$, with $P(w_i)=f(w_i), i=1,2,...,n$."
My attempt:
For all $z\in\mathbb{C}$, let $F(w)={f(w)\over p(w)}\cdot{p(w)-p(z)\over w-z}$.
$${1\over 2\pi i}\int_CF(w)dw=\sum_{i=1}^n \text{Res}(F(w),w_i)+\text{Res}(F(w),z)$$ where the last addend equals $0$.
Let us define for all $i$, $$Q_i(s)=(s-w_1)\cdots(s-w_{i-1})(s-w_{i+1})\cdots(s-w_n)$$
For all $1\leq i\leq n$, $$\text{Res}(F(w),w_i)={f(w_i)\over Q_i(w_i)}\cdot {p(w_i)-p(z)\over w_i-z} \\=\underbrace{{f(w_i)\over Q_i(w_i)}\cdot {p(w_i)\over w_i-z}}_{U_i}+\underbrace{{f(w_i)\over Q_i(w_i)}\cdot {p(z)\over z-w_i}}_{V_i} $$ $V_i$ is a plynomial of degree $n-1$ since $$ V_i={f(w_i)\over Q(w_i)}\cdot Q_i(z) $$ but I don't see how $\sum_{i=1}^n (U_i+V_i)$ is a polynomial of degree $n-1$. Thanks in adence.
$$G_w(z) = {f(w)\over p(w)}\cdot {p(w)-p(z)\over w-z}$$
$(z-w)G_w(z)= {f(w)\over p(w)}(p(w)-p(z))$ is a polynomial of degree $n$ and it has a zero at $z=w$ thus $G_w(z)$ is a polynomial of degree $n-1$.
Writing the integral
$$P(z)={1\over 2\pi i}\int_C{f(w)\over p(w)}\cdot {p(w)-p(z)\over w-z}dw, \qquad z \in Interior(C)$$ as the limit of its Riemann sums we obtain $P(z)$ is the (locally uniformly convergent) limit of a sequence of degree $\le n-1$ polynomials thus $P(z)$ is a polynomial of degree $\le n-1$.