Find the remainder when $P(x)$ is divided by $(x-a)(x-b)$.

Q: Let $P(x)$ by a polynomial leaving remainder A when divided by $(x-a)$, and remainder B when divided by $(x-b)$, where $a$ does not equal $b$.

Find the remainder when $P(x)$ is divided by $(x-a)(x-b)$.

A: $(\frac{A-B}{a-b})(\frac{Ba-Ab}{a-b})$

My working so far:

$P(a)=A=(a-b)G(x)+B)$

$P(b)=B=(b-a)Q(x)+A)$

$\frac{A-B}{a-b}=\frac{(B-A)G(x)}{(b-a)Q(x)}$

But I can't work out how to get rid of the G(x) and Q(x) or what to do next


The remainder you are looking for is of the form $ux + v$ for some $u$ and $v$. Now $$ P(a) = ua+v$$ and $$P(b) = ub+v $$ so $u = \frac{P(a)-P(b)}{a-b}$ and $v = P(a) - a \frac{P(a)-P(b)}{a-b}$