<s>[INST] Find constants of function I have this equality : 
$$f(x)=\frac{9}{(x-1)(x+2)^2}$$
I am required to find the constants A, B and C so that,
$$f(x) = \frac{A}{(x-1)} + \frac{B}{(x+2)} + \frac{C}{(x+2)^{2}} $$
How do we go about solving such a question? 
I am not sure on how to solve such questions. Approach and Hints to solve these kinds of questions are welcomed. :)
Thank you!
Edit:
Wow, saw all the answers! Didn't know that there were a lot of different ways to solve this question. Math is such a fascinating thing!
 [/INST] From
\begin{equation}
\frac{9}{(x-1)(x+2)^2} = \frac{A}{(x-1)} + \frac{B}{(x+2)} + \frac{C}{(x+2)^2}
\end{equation}
it follows, after multiplying each side with $(x-1)(x+2)^2$:
\begin{equation}
9=A(x+2)^2+B(x+2)(x-1)+C(x-1)
\end{equation}
which, after regrouping, gives
\begin{equation}
9=(A+B)x^2 + (4A+B+C)x + (4A-2B-C)
\end{equation}
There are two polynomials, one on each side of this equation, and two polynomials $P_a(x)=\sum a_nx^n$ and $P_b(x)=\sum b_nx^n$ are equal if and only if $a_n=b_n \forall n$. 
Therefore, three equations follow from the previous one:
\begin{eqnarray}
A+B &=& 0 \\
4A+B+C &=& 0 \\
4A-2B-C &=& 9
\end{eqnarray}
Solving this system of equations gives the solution: $A=1$, $B=-1$ and $C=-3$.
</s>