TITLE: Why does partial fraction decomposition always work?
QUESTION [10 upvotes]: Say you have a function $p(x)/q(x)$ for some polynomials $p(x)$ and $q(x)$ and $p$ has a lower degree than $q$. 
Say $q$ has degree three and $p$ has degree two. If you partially decompose it, you'll get three variables $A$,$B$,$C$ and three equations with these variables. You can solve these variables and find the values of the numerators.
But not all systems of three equations have solutions, so how do we know that $A$, $B$ and $C$ always exists for all rational functions that meet the criteria for decomposition?

REPLY [2 votes]: $$\text{Why partial fraction decomposition works?}$$

Assume that $\frac{p(x)}{q(x)}=\frac{p(x)}{(x-a)^nR(x)}$, where $R(a)\neq0$. Since $R(x)$ and $(x-a)^n$ don't have a root in common, there are polynomials $s(x)$ and $r(x)$ with $\text{deg}(s)<n$ and $\text{deg}(r)<\text{deg}(R)$ such that 
$$s(x)R(x)+r(x)(x-a)^n=1$$
Recall that this is Bezout's identity which follows from applying Euclid's division algorithm to $R(x)$ and $(x-a)^n$.
Therefore (multiplying by $p(x)$)
$$s(x)p(x)R(x)+r(x)p(x)(x-a)^n=p(x)$$
We can divide $s(x)p(x)=(x-a)^nm(x)+S(x)$ with $deg(S)<n$ and write 
$$S(x)R(x)+(x-a)^n[r(x)p(x)+m(x)]=p(x).$$
Notice that $\text{deg}(S(x)R(x))<n+\text{deg}(R)$. Since $\text{deg}(p)<\text{deg}(q)=n+\text{deg}(R)$, we must have $$\color{red}{\text{deg}(r(x)p(x)+m)<\text{deg}(R)}$$
Therefore $$\frac{p(x)}{q(x)}=\frac{S(x)}{(x-a)^n}+\frac{r(x)p(x)+m(x)}{R(x)}$$
Since $\text{deg}(S)<n$ we can write $$S(x)=A_1(x-a)^{n-1}+A_2(x-a)^{n-2}+...+A_{n-1}(x-a)+A_n$$
From where we get 

$$\frac{p(x)}{q(x)}=\frac{A_1}{(x-a)}+...+\frac{A_n}{(x-a)^n}+\frac{r(x)p(x)+m(x)}{R(x)}$$

From the inequality in $\color{red}{\text{red}}$ we see that $\frac{r(x)p(x)+m(x)}{R(x)}$ is a proper fraction, so we can repeat the same procedure above with it to extract the principal parts of the partial fraction decomposition corresponding to the other factors of $R(x)$.