Partial fraction decomposition over arbitrary field. Let $K$ be a field and $f,g$ be (1 variable) polynomials over $K$, and suppose that $g=p_{1}^{e_1} p_{2}^{e_2} \cdots p_{k}^{e_k}$ where each $p_i$ is irreducible over $K$ and $e_i \geq 1$. Does there exist polynomials $b$ and $a_{ij}$ with the following properties?


*

*$\deg{a_{ij}}<\deg{p_i}$ for all $i=1,\ldots,k$

*$\displaystyle \frac{f}{g}=b+\sum_{i=1}^{k}\sum_{j=1}^{e_k}\frac{a_{ij}}{p_{i}^{j}}$


Moreover, are such polynomials unique?
What I have tried: Since $\{p_{i}^{e_i}\}$ are pairwise relatively prime, there are polynomials $A_1,\ldots,A_k$ (Bezout) such that $$A_1 p_1^{e_1}+\cdots+ A_k p_k^{e_k}=1$$ and thus we may write $\displaystyle \frac{f}{g}=\frac{fA_1 p_1^{e_1}+\cdots+ fA_k p_k^{e_k}}{g}=\frac{fA_1}{p_2^{e_2}\cdots p_k^{e_k}}+\cdots+\frac{fA_k}{p_1^{e_1}\cdots p_{k-1}^{e_{k-1}}}$. Repeating this on every summand $k$ times, we get polynomials $B_i$ such that $\displaystyle \frac{f}{g}=\sum_{i=1}^{k}\frac{B_i}{p_{i}^{e_i}}$, and after long division (if necessary) there exist polynomials $b,\tilde{B}_i$ such that $$\frac{f}{g}=b+\sum_{i=1}^{k}\frac{\tilde{B}_i}{p_{i}^{e_i}}$$ with $\deg{\tilde{B}_i}<\deg{p_i^{e_i}}$. 
Where I'm stuck: I don't see how I should proceed with the summands of the form $\frac{\tilde{B}_i}{p_i^{e_i}}$. Since $\{p_i,p_i^2,\ldots,p_i^{e_i}\}$ are not relatively prime, Bezout does not work and I don't see how to choose $a_{ij}$ from $\tilde{B}_i$ (unless $p_i^{e_i}$ is linear...). I'm also having difficulties with the uniqueness part of the assertion. 
Can someone give me an advice for this problem? Please enlighten me!

(Note: After the OP comment below, the answer has been edited a lot from original, which was incorrect.)
You have reduced the problem to the case where there is only one irreducible factor.  Let's write it as $\frac{f}{g^n}$ where $g$ is irreducible in $K$, and $\deg f < \deg g^n$.  We seek polynomials $a_1, a_2, \ldots, a_n$, with $\deg a_i < \deg g$, such that $$\frac{f}{g^n} = \sum_{i=1}^{n} \frac{a_i}{g^i}.$$  
If we clear denominators, we get this (where I have purposely split out the last term because it has no $g$'s): $$ f = \left(\sum_{i=1}^{n-1} a_i g^{n-i}\right) + a_n.$$
Now the $a_i$'s can be computed by successive division.  The polynomial $a_n$ is the remainder when $f$ is divided by $g$, then $a_{n-1}$ is the remainder of $(f-a_n)/g$, etc.
