<s>[INST] Problem in partial fraction decomposition Consider the following rational function which we want to decompose to partial fractions $$\frac{x}{x^3-3x+2}=\frac{x}{(x-1)(x^2+x-2)}=\frac{A}{x-1}+\frac{Bx+C}{x^2+x-2}$$ Now when we multiply out we get the following expression $$x=A(x^2+x-2)+Bx(x-1)+C(x-1)$$ If we consider $x=1$ we obtain $$1=0$$ What is wrong here?
 [/INST] $$\frac{x}{x^3-3x+2}=\frac{x}{(x-1)(x^2+x-2)}=\frac{x}{(x-1)(x-1)(x+2)} = \frac{x}{(x-1)^2(x+2)}$$ $$= \frac{A}{x-1}+\frac B{(x-1)^2} + \frac{C}{x+2}$$
$$x = A(x-1)(x+2) + B(x+2) + C(x-1)^2$$
Now, when we test with $x=1$, we get $3B= 1 \iff B=\frac 13$
</s>