\({5x-2\over x+3} = 5 - {17 \over x+3}~\\ \qquad 5(x+3)=5x+15\\ LHS\\={5x-2\over x+3}\\={5(x+3)-15-2\over x+3}\\={5(x+3)-17\over x+3}\\= {5(x+3)\over x+3}-{17\over x+3}\\= 5-{17\over x+3}\ \)
This is not really what you were expected to do though.
You were expected to do algebraic division or synthetic division
This is an example of what you were supposed to do :)