<s>[INST] Trouble with factorising a polynomial I'm supposed to show that:  
$$y=\frac{5(x-1)(x+2)}{(x-2)(x+3)} = P + \frac{Q}{(x-2)} + \frac{R}{(x+3)}$$  
and the required answers are: $$ P=5, Q=4, R=-4 $$  
I tried to solve this with partial fractions like so:  
$$5(x-1)(x+2) = A(x+3) + B(x-2)$$  
$\implies$ $A$=4, $B$=-4
$\implies$ $Q$=4, R=-4  
But where does $P$=5 come from?
Or should I have first multiplied out the numerator and denominator and then used long division to solve?
 [/INST] You don't need to do any long division. In the expression
$$y = \frac{N(x)}{D(x)} = \frac{5(x-1)(x+2)}{(x-2)(x+3)}$$
The numerator $N(x) = 5(x-1)(x+2)$ and denominator $D(x) = (x-2)(x+3)$ 
are polynomials of degree $2$. Since the roots of $D(x)$ are simple,
$y$ can be rewritten in the form:
$$y = P(x) + \frac{Q}{(x-2)} + \frac{R}{(x+3)}$$
where $P(x)$ is a polynomial of degree $\deg N(x) - \deg D(x) = 2 - 2 = 0$, i.e. a constant. To evaluate the 3 coefficients, you can evaluate both side at 3 different
values of $x$: the two roots of $D(x)$ and $\infty$:
$$\begin{align}
P &= \lim_{x\to\infty} \frac{N(x)}{D(x)} = 5\\
Q &= \lim_{x\to 2} (x-2)\frac{N(x)}{D(x)} = \lim_{x\to 2}\frac{5(x - 1)(x+2)}{x+3} = \frac{5(2 - 1)(2+2)}{2+3} = 4\\
R &= \lim_{x\to -3}(x+3)\frac{N(x)}{D(x)} = \lim_{x\to-3}\frac{5(x-1)(x+2)}{x-2} = \frac{5(-3-1)(-3+2)}{-3-2} = -4
\end{align}$$
</s>