Given q(x) [quotient], d(x) [divisor] and r(x) [remainder], the polynomial is gotten by multiplying the quotient and the divisor and adding the remainder.
i.e In this case, the polynomial = (x2 - x - 5)(3x - 1) + 7.
= (3x3 - x2 - 3x2 + x - 15x + 5) + 7
= (3x3 - 4x2 - 14x + 5) + 7
= 3x3 - 4x2 - 14x + 12