Let's assume the answer is of the form A/(x+2)+B/(x+2)+C/(x+1). This reduces to a single fraction, with numerator:
A(x^2+3x+2)+B(x^2+3x+2)+C(x^2+4x+4)=
(A+B+C)x^2+x(3A+3B+4C)+2A+2B+4C. This must match 5x^2+17x+15:
A+B+C=5; 3A+3B+4C=17; 2A+2B+4C=15.
Let D=A+B: D+C=5; 3D+4C=17; 2D+4C=15: subtracting these last two equations: D=2; so C=3, but 3D+4C=18 which is not consistent with 3D+4C=17.
The answer may be in the form: (Ax+B)/(x^2+3x+2)+C/(x+2).
(Ax+B)(x+2)+C(x^2+3x+2)=x^2(A+C)+x(2A+B+3C)+2B+2C.
A+C=5; 2A+B+3C=17; 2B+2C=15. A=5-C, so 2(5-C)+B+3C=17, B+C=7, so 2(B+C)=14 but it should be 15!
Finally assume: (Ax+B)/(x^2+4x+4)+C/(x+1).
(Ax+B)(x+1)+C(x^2+4x+4)=x^2+17x+15.
A+C=5; A+B+4C=17; B+4C=15. A=2; C=3; B=3 fits all.
Answer: (2x+3)/((x+2)^2+3/(x+1).