In preparation for Lagrange's Interpolation Theorem, I'm curious to know why a rational function can be put in the following form.
Suppose $Q$ is a polynomial with distinct roots $a_1,\dots,a_n$, and let $P$ be a polynomial with $\deg(P)<n$. Then why does $$ \frac{P(x)}{Q(x)}=\sum_{i=1}^n\frac{P(a_i)}{Q'(a_i)(x-a_i)}? $$ I tried expanding the right hand sum over a common denominator, but it got horribly messy quickly. I also tried induction, assuming $Q$ has just one distinct root, and thus $Q=C(x-a_1)^k $. But then $\deg(P)<1$, so $P$ is constant, say $P=A$. But then $$ \frac{P(a_1)}{Q'(a_1)(x-a_1)}=\frac{A}{kC(a_1-a_1)^{k-1}(x-a_i)} $$ which seems problematic if $k>1$. What's the slicker way to conclude this equality? Thanks,