I'm only just now learning about partial fractions to solve integrals. I've read that
$$\frac{f(x)}{(px^2+qx+r)(x-a)}\equiv \frac{Ax+B}{(px^2+qx+r)}+\frac{C}{(x-a)}$$
I haven't figured out how it was decided that $Ax+B$ ought to be used and why it works. Can someone explain it?
Well, the denominator is a polynomial of degree three. I'll assume that $f(x)$ is a polynomial of degree $\leq 2$. Actually, the case $f(x)=1$ already explains the philosophy.
The numerator of the first fraction will be multiplied by a linear polynomial, so that its degree must be one, if you hope to compete with the second fraction. Assume that $$ \frac{1}{(px^2+qx+r)(x-a)}=\frac{E(x)}{px^2+qx+r}+\frac{C}{x-a}, $$ then $$ 1=E(x)(x-a)+C(px^2+qx+r), $$ and you definitely need a term like $x^2$ on the right-hand side to cancel $Cpx^2$. That's why you need at least a polynomial $E(x)$ of the first order.