So I understand why this is true: $$ \frac{x}{(x+2)(x+1)} = \frac{A}{x+2} + \frac{B}{x+1} $$
But there's a special rule in partial fraction that I just couldn't get it. When you have a term that is squared, I must add another fraction with the term squared in the denominator: $$ \frac{x}{(x+2)(x+1)^2} = \frac{A}{x+2} + \frac{B}{x+1} + \frac{C}{(x+1)^2} $$
Why? Shouldn't $(x+1)^2$ be treated like $(x+1)(x+1)$ and do this instead?: $$ \frac{x}{(x+2)(x+1)^2} = \frac{A}{x+2} + \frac{B}{x+1} + \frac{C}{x+1} $$
Why is the extra square needed?
To visualize it easier, I have tried to substitute terms with letters.
$$ \frac{x}{(x+2)(x+1)}\\ \text{Let x+2 be X, x+1 be Y:}\\ = \frac{A}{X} + \frac{B}{Y}\\ = \frac{AY+BX}{XY} $$
And I can do the same thing for this:
$$ \frac{x}{(x+2)(x+1)^2} = \frac{x}{(x+2)(x+1)(x+1)}\\ \text{Let x+2 be X, x+1 be Y, x+1 be Z:}\\ = \frac{A}{X} + \frac{B}{Y} + \frac{C}{Z}\\ = \frac{AYZ + BXZ + CXY}{XYZ}\\ \\ \frac{x}{(x+2)(x+1)(x+1)} = \frac{AYZ + BXZ + CXY}{XYZ}\\ x = AYZ + BXZ + CXY $$
I don't see any problem in this.
Because the zero $x=-1$ of the denominator has a multiplicity of $2$, the partial fractions must contain the $2$nd power of $(x+1)$. Though there is no necessity that the partial fraction must contain $1$st power of $(x+1)$.
In your explanation, $$\frac{B}{x+1} + \frac{C}{x+1} = \frac{B+C}{x+1}$$ $$\frac{A}{x+2} + \frac{B+C}{x+1} = \frac{A(x+1)+(x+2)(B+C)}{(x+2)(x+1)}$$ Check the denominator here. What is the power of $(x+1)$ here ? It is $1$. But it should have been $2$ right? Where did it vanish ? It vanished because of the mistake that you have done in neglecting the repeated root in denominator. Here the multiplicity of the zero $x=-1$ is just $1$, where it should have been $2$.
You can refer this if still in doubt.
EDIT: Since you are not fully aware on how partial fraction decomposition works. Read this.