$f$ is differentiable at $1$ if
$\lim\limits_{h \to 0^{-}} \frac{f(1+h)-f(1)}{h}=\lim\limits_{h \to 0^{+}}\frac{f(1+h)-f(1)}{h}$
$\Rightarrow2 = 2a+b - (1)$
$f$ is differentiable at $2$ if
$\lim\limits_{h \to 0^{-}} \frac{f(2+h)-f(2)}{h}=\lim\limits_{h \to 0^{+}}\frac{f(2+h)-f(2)}{h}$
$\Rightarrow 4a+b = 1 - (2)$
Solving $(1)$ and $(2),$ we get
$a = -0.5, b = 3$
Now, $f$ has to be continous on $1$ also, so
$\lim\limits_{x \to 1^{-}} f(x)=\lim\limits_{x \to 1^{+}}(x)=f(1)$
$\Rightarrow 1 = a + b + c$
$\Rightarrow c = -1.5$
Similarly, $f$ has to be continous on $2$ also, so
$\lim\limits_{x \to 2^{-}} f(x)=\lim\limits_{x \to 2^{+}}(x)=f(2)$
$\Rightarrow 4a+2b+c = 2+d$
$\Rightarrow d = 0.5$
So, $a = -0.5, b = 3, c = -1.5, d = 0.5$