We are dividing
According to the "Division algorithm":
where P(x) is the dividend polynomial, D(x) is the divisor polynomial, Q(x) is the quotient polynomial and R(x) the remainder which must be of smaller degree than the divisor.
R(x)=c, a constant, because the divisor is a linear.
also notice that Q(x) must be a linear of the form 3x+a:
comparing the coefficients, we have:
-2=a+3 and 7=a+c
a=-5, then 7=-5+c, so c=-12
the quotient is 3x-5