$P(z)$ defines a polynomial Suppose that $f$ is analytic in a simply connected domain $D$ containing distinct points $z_1, z_2 ,\ldots,z_n $ and that $\gamma$ is simple closed curve  enclosing $z_1, z_2 ,\ldots,z_n $.
Set $w(z)= \prod_{k=1}^n (z-z_k)$ . Prove that 
$$P(z) =\int_{\gamma}  \frac {f(\zeta)}{w(\zeta)} \frac{w(\zeta)-w(z)}{\zeta-z}d\zeta$$ defines a polynomial of degree $n-1$ satisfying $P(z_k) =f(z_k), k =1,2,3,\ldots,n.$ 
I don't know what thought I am suppose to present here. What I just know is to do the partial fraction of the $w(z)$. Then I just stuck not knowing the fact I am using here. This is actually a recent comprehensive exam question which I could not solve. My professor gave me some hint but that also did not help. The idea of partial fraction came out of his mouth. But I don't remember what he told me to do to complete the problem. I really wish to see the detail solution of the problem. Thanks in advance.
Addendum
Partial Fraction of $\frac{1}{w(\zeta)}= \frac {1}{\prod _{k=1}^n (\zeta-z_k)}$ is given by
 $$\frac {A_1}{\zeta-z_1}+\frac {A_2}{\zeta-z_2}+\cdots+\frac {A_n}{\zeta-z_n}$$
Where each $A_i = \frac{1} {\prod_{j=1}^n z_i-z_j} , j \neq i$
Sorry I missed that not equal to part, I don't know how to accomodate that in the product, any edit appreciated.
 A: First note that $$ \frac{w(\zeta) - w(z)}{\zeta - z} $$ is in fact a polynomial in $(\zeta, w)$ and therefore does not have any poles as a function of $\zeta$ .  The only poles come from $w(\zeta)$ in the denominator and they are located at $z_1, \dotsc, z_n$.  If $z \not \in \{z_1, \dotsc, z_n \}$ an easy calculation shows that the residue at $z_k$ equals $$ \frac{f(z_k)}{w'(z_k)} \frac{w(z)}{z-z_k}.$$ This gives the relation
$$
P(z) = 2 \pi i \sum_{k=1}^n \frac{f(z_k)}{w'(z_k)} \frac{w(z)}{z-z_k}
$$
which is a polynomial of degree at most $n-1$ and therefore this equality extends to all $z$.  Use $$ \lim_{z \to z_k} \frac{w(z)}{z-z_k} = w'(z_k) $$ to quickly verify that $P(z_k) = 2 \pi i \, f(z_k)$.
A: Let $$P_j(z) := \prod_{k=1}^j (z-z_j)$$ (Then $w(z)=P_n(z)$ by definition.) As you already mentioned it's a good idea to do partial fraction. We have
$$\begin{align}w(\xi)-w(z) &= ((\xi-z)+(z-z_n)) \cdot P_{n-1}(\xi) - (z-z_n) \cdot P_{n-1}(z) \\ &= (\xi-z) \cdot P_{n-1}(\xi) + (z-z_n) \cdot (P_{n-1}(\xi)-P_{n-1}(z)) \tag{1}\end{align}$$
hence
$$\frac{w(\xi)-w(z)}{\xi-z} = P_{n-1}(\xi) + \frac{z-z_n}{\xi-z} \cdot (P_{n-1}(\xi)-P_{n-1}(z)) \tag{2}$$
Now we do the same step as in (1) again and obtain
$$\begin{align}P_{n-1}(\xi)-P_{n-1}(z) &= (\xi-z) \cdot P_{n-2}(\xi) + (z-z_{n-1}) \cdot (P_{n-2}(\xi)-P_{n-2}(z)) \\
\stackrel{(2)}{\Rightarrow} \frac{w(\xi)-w(z)}{\xi-z} &= P_{n-1}(\xi) + \underbrace{(z-z_n)}_{=:Q_1(z)} \cdot P_{n-2}(\xi) + \frac{(z-z_n) \cdot (z-z_{n-1})}{\xi-z} \cdot (P_{n-2}(\xi)-P_{n-2}(z)) \end{align}$$
By induction we obtain
$$\frac{w(\xi)-w(z)}{\xi-z}= \sum_{j=1}^m Q_{j-1}(z) \cdot P_{n-j}(\xi) + \frac{Q_m(z)}{\xi-z} \cdot (P_{n-m}(\xi)-P_{n-m}(z))$$
where $Q_j(z) := \prod_{k=n-j}^n (z-z_j)$, $Q_0(z):=1$. This works fine for $m \leq n-2$. In the last step (where the remaining polynomial has degree 1), i.e. $m=n-1$, we obtain
$$\begin{align} \frac{w(\xi)-w(z)}{\xi-z}&= \sum_{j=1}^{n-1} Q_{j-1}(z) \cdot P_{n-j}(\xi) + \frac{Q_{n-1}(z)}{\xi-z} \cdot ((\xi-z_1)-(z-z_1)) \\ &= \sum_{j=1}^{n-1} Q_{j-1}(z) \cdot P_{n-j}(\xi) +Q_{n-1}(z) \tag{3} \end{align}$$
Now we are done: By using (3) in the definition of $P$ we obtain
$$\begin{align} P(z) &= \int_{\gamma} \frac{f(\xi)}{w(\xi)} \cdot \left( \sum_{j=1}^{n-1} Q_{j-1}(z) \cdot P_{n-j}(\xi) +Q_{n-1}(z) \right) \, d\xi \\ &= \sum_{j=1}^{n-1} Q_{j-1}(z) \cdot \underbrace{\int \frac{f(\xi)}{w(\xi)} \cdot P_{n-j}(\xi) \, d\xi}_{=:a_j} + Q_{n-1}(z) \cdot \underbrace{\int_{\gamma} \frac{f(\xi)}{w(\xi)} \, d\xi}_{=:b} \end{align}$$
Note that $Q_j$ are polynomials of degree $\leq n-1$ (and that the constants $a_j$, $b$ do not dependent on $z$). This shows that $P$ is polynomial of degree n-1.
Last but not least: $$P(z_k) = \int_{\gamma} \frac{f(\xi)}{w(\xi)} \cdot \frac{w(\xi)-0}{\xi-z_k} \, d\xi = \int_{\gamma}\frac{f(\xi)}{\xi-z_k} \, d\xi = 2\pi \imath \cdot f(z_k)$$ where we applied Cauchy's integral formula (and used $w(z_k)=0$). (So if you would like to have $P(z_k) = f(z_k)$ you should add the factor $\frac{1}{2\pi \imath} \cdots$ in your definiton of $P$.)
