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!
 A: Add the three fractions on the right hand side of your equation 
$$\frac{A}{(x-1)}+\frac{B}{(x+2)}+\frac{C}{(x+2)^2}=\frac{A(x+2)^2+B(x-1)(x+2)+C(x-1)}{(x-1)(x+2)^2}$$
I'll leave it to you to simplify the numerator and solve for $A$,$B$ and $C$, such that.
$$A(x+2)^2+B(x-1)(x+2)+C(x-1)=9$$
A: Hint Set $\dfrac{9}{(x-1)(x+2)^2} = \dfrac{A}{(x-1)} + \dfrac{B}{(x+2)} + \dfrac{C}{(x+2)^{2}}$ and multiply both sides by $(x-1)(x+2)^2$. Then simplify and solve for $A,B,C$.
A: Algebric solution: use Euclide algorithm to solve the Bezout equation
$$
1 = (X-1)U(X) + (X+2)^2 V(X).
$$
Analytic solution:


*

*multiply by $x$ and take limit to $\infty$ gives
$$
A+B=0
$$

*multiply by $x^2$ and take limit to $\infty$ (after plugging $A+B=0$) gives
$$
0 = 2A-B+C
$$

*multiply by $(x-1)$ and take limit to $1$ gives
$$
A = \frac 9{3^2}=1.
$$


You then get $B=-1, C=-3$.
A: $$\dfrac{9}{(x-1)(x+2)^2}=\dfrac{A}{x-1}+\dfrac{B}{x+2}+\dfrac{C}{(x+2)^2}$$
Multiplying by the GCD(which means multiplying all the terms by $(x-1)(x+2)^2$)
$$9=A(x+2)^2+B(x-1)(x+2)+C(x-1)$$
Let $x=-2$;
$$9=A(-2+2)^2+B(-2-1)(-2+2)+C(-2-1)$$
$$9=A(0)+B(-3)(0)+C(-3)$$
$$9=-3C$$
$$C=-3$$
Now that we have C,we let x=1;
$$9=A(1+2)^2+B(1-1)(1+2)+C(1-1)$$
$$9=A(3)^2+B(0)(3)+C(0)$$
$$9=9A$$
$$\implies A=1$$
then we let x=3 and substitute back A and C
$$9=(3+2)^2+B(2)(5)-3(2)$$
$$9=25+10B-5$$
$$9=20+10B$$
$$-11=10B$$
$$B=\dfrac{-11}{10}$$
So,now you have the values of A,B and C. This is how you go about doing it. Try it yourself. There might be a small arithmetic error in this solution. Solve it yourself to find it.
A: I'd like to bring again one of the below-mentioned proofs, but in a slightly modified form. In fact, I'll use the same words as you can read it in H. Wilfs Generatingfunctionology (section 1.2). The text is for your amusement and the benefit is that you could use these techniques, if you need an answer quickly.
We have the form
$$\frac{9}{(x-1)(x+2)^2}=\frac{A}{(x-1)}+\frac{B}{(x+2)}+\frac{C}{(x+2)^2}\qquad\qquad(\ast)$$
and the only problem is how to find the constants $A$, $B$, $C$.
Here's the quick way. First multiply both sides of $(\ast)$ by $(x+2)^2$ and then let $x=-2$. The instant result is that $C=-3$ (don't take my word for it, try it for yourself!). Next multiply $(\ast)$ through by $x-1$ and let $x=1$. The instant result is that $A=1$. The hard one to find is $B$, so let's do that one by cheating. Since we know that $(\ast)$ is an identity, i.e., is true for all values of $x$, let's choose an easy value of $x$, say $x=0$, and substitute that value of $x$ into $(\ast)$. Since we know $A$ and $C$, we find at once that $B=-1$.
A: A simple way is
$$A=f(x)(x-1)\bigg|_{x=1}=1$$
$$C=f(x)(x+2)^2\bigg|_{x=-2}=-3$$
$$0=\lim_{x\to\infty}xf(x)=A+B\Rightarrow B=-A=-1$$
A: 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$.
