f[x_]=(5x^2-4x+7)/((x^2+1)(x-5)^2)

Apart[%]

p1=(a x+b)/(x^2+1)

p2=c/(x-5)

p3=d/(x-5)^2

p1+p2+p3

Together[%]

n=Numerator[%]

CoefficientList[n,x]

sol=Solve[CoefficientList[n,x]=={7,-4,5,0}]

p1+p2+p3/.sol