Example 3 Given $a \neq b$, the remainders when polynomial $f(x)$ is divided by $x-a$ and $x-b$ are $c$ and $d$ respectively, find the remainder when $f(x)$ is divided by $(x-a)(x-b)$.
By the Remainder Theorem, we know: $f(a)=c, f(b)=d$. Let $f(x)=(x-a)(x-b) g(x)+m x+n$, then $m a+n=c, m b+n=d$. Solving these, we get: $m=\frac{c-d}{a-b}, n=\frac{a d-b c}{a-b}$, hence the required remainder is $\frac{c-d}{a-b} x+\frac{a d-b c}{a-b}$.