Differentiation

For what choice of a and b, is the function $f\left(x\right) = \begin{cases} x^2, & x \leq c \\ ax+b, & x >c \end{cases}$ $\;\;$ differentiable at $x=c$?


Since the function $f\left(x\right)$ is differentiable at $x=c$ $\implies$ $f\left(x\right)$ is continuous at $x=c$

$\therefore$ $\;$ $\lim\limits_{x \to c^-} f\left(x\right) = \lim\limits_{x \to c^+} f\left(x\right) = f\left(c\right)$

i.e. $\lim\limits_{x \to c^-} x^2 = \lim\limits_{x \to c^+} ax+b = c^2$

$\implies$ $c^2 = ac+b \;\; \cdots$ (1)

Also, $f\left(x\right)$ is differentiable at $x=c$ $\implies$ $Lf'\left(c\right) = Rf'\left(c\right)$

$\therefore$ $\;$ $\lim\limits_{h \to 0} \dfrac{f\left(c-h\right)-f\left(c\right)}{-h} = \lim\limits_{h \to 0} \dfrac{f\left(c+h\right)-f\left(c\right)}{h}$

i.e. $\lim\limits_{h \to 0} \dfrac{\left(c-h\right)^2-c^2}{-h} = \lim\limits_{h \to 0} \dfrac{a\left(c+h\right)+b - c^2}{h}$

i.e. $\lim\limits_{h \to 0} \dfrac{c^2 -2ch + h^2 - c^2}{-h} = \lim\limits_{h \to 0} \dfrac{ac + ah + b - c^2}{h}$

i.e. $\lim\limits_{h \to 0} \left(2c-h\right) = \lim\limits_{h \to 0} \dfrac{c^2+ah-c^2}{h} \;\; \left[\text{From equation (1)}\right]$

i.e. $\lim\limits_{h \to 0} \left(2c-h\right) = \lim\limits_{h \to 0} a$

i.e. $2c=a$

Substituting the value of a in equation (1) gives

$c^2 = 2c^2 +b$ $\implies$ $b = -c^2$