I am currently trying to find the partial fraction decomposition of
$$\frac{x+1}{x^2(x^3-1)}$$ But I am having some troubles: So far I have only simple fraction decompositions, where I could just factor the denominator and then compare coefficients and solve a system of linear equations. This method does not seem to work for this problem, however. I started out by saying that $$\frac{x+1}{x^2(x^3-1)} = \frac{x+1}{x^2(x^2+x+1)(x-1)}$$ Then I tried using the method I described above, so I did: $$\frac{x+1}{x^2(x^3-1)} =\frac{A}{x^2}+\frac{B}{x^2+x+1}+ \frac{C}{x-1} $$ I end up with a system of linear equations which does not have any solutions. As far as I have seen in various online calculators, I have to do something like this: $$\frac{x+1}{x^2(x^3-1)} =\frac{A}{x^2}+\frac Bx+\frac{Cx+D}{x^2+x+1}+ \frac{E}{x-1}$$ This genuinely confuses me. First of all, where does the $\frac Bx$ come from and why do I know that I need to write $\frac{Cx+D}{x^2+x+1}$ instead of just $\frac{C}{x^2+x+1}$? I know it has something to do with the degree of the polynomial in the denominator, but I would really appreciate any kind of help here.
The rule of thumbs is that on the numerator you always have to put a generic polynomial of degree one less the denominator. So if you have $x^2+x+1$, since it has degree two you have to put $Cx+D$. If you had $x^4+1$ you would need $Ax^3+Bx^2+Cx+D$. For repeated roots, say $(x-1)^3$ you would need $\frac {A}{x-1}$+$\frac {B}{(x-1)^2}$+ $\frac {C}{(x-1)^3}$