The expression $\displaystyle g(x)$ has the same remainder constant $\displaystyle k$ when divided by $\displaystyle (x-a)$ or $\displaystyle (x-b)$. Determine, with reasons, whether it is always true that $\displaystyle g(x)$ also has remainder constant $\displaystyle k$ when divided by $\displaystyle (x-a)(x-b), k \neq 0$.

My proof:

$\displaystyle g(x)=(x-a)Q_{1}(x)+k$

$\displaystyle g(x)=(x-b)Q_{2}(x)+k$

where $\displaystyle Q_{1}(x)$ and $\displaystyle Q_{2}(x)$ are quotients.

Let $\displaystyle f(x)=g(x)-k$,

then $\displaystyle f(x)=(x-a)Q_{1}(x)$ and $\displaystyle f(x)=(x-b)Q_{2}(x)$.

So $\displaystyle (x-a)$ and $\displaystyle (x-b)$ are factors of $\displaystyle f(x)$

Thus,

$\displaystyle f(x)=(x-a)(x-b)Q_{3}(x)$

$\displaystyle \Rightarrow g(x)-k=(x-a)(x-b)Q_{3}(x)$

$\displaystyle \Rightarrow g(x)=(x-a)(x-b)Q_{3}(x)+k$

Hence, it is TRUE.

Is my proof ok? Is there a better one?

Many thanks for those who help