I would appreciate it if somebody could explain why the following applies to partial fractions with repeated roots:

(x^2-2x+17)/(x+3)(x-1)^2 = A/(x+3)+B/(x-1)+C/(x-1)^2.

It would make more sense to me if it was as below:

(x^2-2x+17)/(x+3)(x-1)^2 = A/(x+3)+B/(x-1)+C/(x-1).

I know this is incorrect however I am unable to find an explanation for why it is done as it is.