Find the values of $a$ and $b$ so that the function $f(x) \begin{cases}x^{2}+3 x+a, & \text { if } x \leq 1 \\ b x+2, & \text { if } x>1\end{cases}$ is differentiable at each x ∈ R.
Given:
$f(x)=\left\{\begin{array}{l}x^{2}+3 x+a, \quad x \leq 1 \\ b x+2, \quad x>1\end{array}\right.$
It is given that the function is differentiable at each $x \in R$ and every differentiable function is continuous. So, $f(x)$ is continuous at $x=1$.
Therefore,
$\lim _{x \rightarrow 1^{-}} f(x)=\lim _{x \rightarrow 1^{+}} f(x)=f(1)$
$\Rightarrow \lim _{x \rightarrow 1} x^{2}+3 x+a=\lim _{x \rightarrow 1} b x+2=a+4$ [Using def. of $f(x)$ ]
$\Rightarrow a+4=b+2=a+4 \quad \ldots(\mathrm{i})$
Since, $f(x)$ is differentiable at $x=1$. So,
$\lim _{x \rightarrow 1^{-}} \frac{f(x)-f(1)}{x-1}=\lim _{x \rightarrow 1^{+}} \frac{f(x)-f(1)}{x-1}$
$\Rightarrow \lim _{x \rightarrow 1} \frac{x^{2}+3 x+a-a-4}{x-1}=\lim _{x \rightarrow 1} \frac{b x+2-4-a}{x-1}$ [Using def. of $f(x)$ ]
$\Rightarrow \lim _{x \rightarrow 1} \frac{(x+4)(x-1)}{x-1}=\lim _{x \rightarrow 1} \frac{b x-2-a}{x-1}$
$\Rightarrow \lim _{x \rightarrow 1} \frac{(x+4)(x-1)}{x-1}=\lim _{x \rightarrow 1} \frac{b x-b}{x-1}$ [Using (i)]
$\Rightarrow \lim _{x \rightarrow 1} \frac{(x+4)(x-1)}{x-1}=\lim _{x \rightarrow 1} \frac{b(x-1)}{x-1}$
$\Rightarrow 5=b$
From
$a+4=b+2$
$\Rightarrow a+4=5+2$
$\Rightarrow a=7-4$
$\Rightarrow a=3$
Hence, $a=3, b=5$.