As the degree of the numerator is #># than the degree of the denominator, we do a long division
#color(white)(aaaa)##2x^3-x^2+x+5##color(white)(aaaa)##∣##x^2+3x+2#
#color(white)(aaaa)##2x^3+6x^2+4x##color(white)(aaaaaa)##∣##2x-7#
#color(white)(aaaaa)##0-7x^2-3x+5#
#color(white)(aaaaaaa)##-7x^2-21x-14#
#color(white)(aaaaaaaaaaaaaa)##18x+19#
Therefore,
#(2x^3-x^2+x+5)/(x^2+3x+2)=2x-7+(18x+19)/(x^2+3x+2)#
We can now do the decomposition into partial fractions
#(18x+19)/(x^2+3x+2)=(18x+19)/((x+1)(x+2))=A/(x+1)+B/(x+2)#
#=(A(x+2)+B(x+1))/((x+1)(x+2))#
So,
#18x+19=A(x+2)+B(x+1)#
Let #x=-1#, #=>#, #1=A#
Let #x=-2#, #=>, #-17=-B#
#(2x^3-x^2+x+5)/(x^2+3x+2)=2x-7+1/(x+1)+17/(x+2)#