first lets invert the divisor and chane to a multuplication:-
x + 5 2x^2 - 7x - 4
----------------- * --------------------
2x^2 + 3x + 1 3x^2 + 18x + 15
Now we can factor the 3 trinomials:-
x + 5 (2x + 1)(x - 4)
-------------- * ------------------
(2x + 1)(x + 1) 3(x + 5)(x + 1)
Now we simplify because (2x + 1) and (x + 5) are common to top and bottom:-
1 * x - 4
= ------------- ------------
x + 1 3( x + 1)
= x - 4
--------------
3(x + 1^2