Find the values of a and b so that the function f(x)=\left\{\begin{array}{c}\left(x^{2}+3 x+a\right), \text { when } x \leq 1 \\ (b x+2), \text { when } x>1\end{array}\right. is differentiable at each x \in R
Find the values of a and b so that the function f(x)=\left\{\begin{array}{c}\left(x^{2}+3 x+a\right), \text { when } x \leq 1 \\ (b x+2), \text { when } x>1\end{array}\right. is differentiable at each x \in R

Solution:

Given that f(x) is differentiable at each x \in R
For x \leq 1
f(x)=x^{2}+3 x+a i.e. a polynomial
for x>1
f(x)=b x+2, which is also a polynomial
As, a polynomial function is everywhere differentiable. So, f(x) is differentiable for all x>1 and for all x<1
f(x) is continuous at x=1
\begin{array}{l} \lim _{x \rightarrow 1^{-}} f(x)=\lim _{x \rightarrow 1^{+}} f(x)=f(1) \\ \operatorname{Lim}_{x \rightarrow 1}\left(x^{2}+3 x+a\right)=\lim _{x \rightarrow 1}(b x+2)=1+3+a \\ 1^{2}+3(1)+a=b(1)+2=4+a \\ 4+a=b+2 \\ a-b+2=0 \ldots(1) \end{array}
As function is differentiable, therefore, \mathrm{LHD}=\mathrm{RHD}
\text{Left Hand Derivative} at \mathrm{x}=1 :
\begin{array}{l} \operatorname{Lim}_{\mathrm{x} \rightarrow 1^{-}} \frac{\mathrm{f}(\mathrm{x})-\mathrm{f}(1)}{\mathrm{x}-1}=\lim _{\mathrm{x} \rightarrow 1} \frac{\mathrm{x}^{2}+3 \mathrm{x}+\mathrm{a}-(4+\mathrm{a})}{\mathrm{x}-1}=\lim _{\mathrm{x} \rightarrow 1} \frac{\mathrm{x}^{2}+3 \mathrm{x}-4}{\mathrm{x}-1}=\lim _{\mathrm{x} \rightarrow 1} \frac{(\mathrm{x}+4)(\mathrm{x}-1)}{\mathrm{x}-1} \\ =\lim _{\mathrm{x} \rightarrow 1}(\mathrm{x}+4)=1+4=5 \end{array}
Right Hand Derivative at x=1:
\begin{array}{l} \operatorname{Lim}_{x \rightarrow 1^{-}} \frac{f(x)-f(1)}{x-1}=\lim _{x \rightarrow 1} \frac{(b x+2)-(4+a)}{x-1}=\lim _{x \rightarrow 1} \frac{b x-2-a}{x-1}=\lim _{x \rightarrow 1} \frac{b x-b}{x-1}=\lim _{x \rightarrow 1} \frac{b(x-1)}{x-1} \\ =\lim _{x \rightarrow 1} b=b \end{array}
As, \text{Left Hand Derivative}=\text{Right Hand Derivative}
Hence,
5=b
Putting b in (1), we obtain,
\begin{array}{l} a-b+2=0 \\ a-5+2=0 \\ a=3 \end{array}
As a result,
a=3 \text { and } b=5