By the method of partial fractions we take:
$$\frac{px+q}{\left(x-a\right)\left(x-b\right)}=\frac{A}{x-a}+\frac{B}{x-b}$$ $$\frac{px+q}{\left(x-a\right)^2}=\frac{A}{x-a}+\frac{B}{\left(x-a\right)^2}$$
For both kinds of fractions. I don't understand this part, what do we actually do when we split a fraction into partial fractions. Why don't we write:
$$\frac{px+q}{\left(x-a\right)^2}=\frac{A}{x-a}+\frac{B}{\left(x-a\right)}$$ (like we do in the first part).
Note
$$\begin{align}\frac{A}{x-a}+\frac{B}{x-a}=\frac{A+B}{x-a}\end{align}$$
^ Taking a glance at this, should make it clear
If it doesn't:
$$\begin{align}\frac{A+B}{x-a} \neq \frac{px+q}{(x-a)^2}\end{align}$$
You get that the denominator isn't equal, and also $A+B$ is a constant whereas $px+q$ isnt.