The remainder has to be a polynomial of at most degree 1.
This means that it is in the form R(x)=ax+b, where a and b can be equal to 0.
Let's denote and note that
What we'll do is studying the zeroes of the polynomials...
where Q is the quotient.
If we let x=1, we have
If we differentiate, we have
Again, if we let x=1, the red part will be equal to 0.
Thus b=... and the remainder R is...