We are given is exactly divisible by then the remainder should be zero
Therefore Quotient and
Remainder
Now, Remainder
Equating coefficient of x, we get
.
Equating constant term
Hence, the value of a and b are