Let $f(x) = (x-a)(x-b)$
$ \Rightarrow f(x) = x^2-(a+b)x+ab$
$ \therefore f'(x) =\large\frac{d}{dx}$$ (x^2-(a+b)x+ab)$
$ = \large\frac{d}{dx}$$(x^2)-(a+b)\large\frac{d}{dx}$$(x)+\large\frac{d}{dx}$$(ab)$
On using theorem $\large\frac{d}{dx} $$(x^n)=nx^{n-1}$, we obtain
$f'(x) = 2x-(a+b)+0=2x-a-b$