# 009A Sample Final 1, Problem 2

Consider the following piecewise defined function:

$f(x)=\left\{{\begin{array}{lr}x+5&{\text{if }}x<3\\4{\sqrt {x+1}}&{\text{if }}x\geq 3\end{array}}\right.$ (a) Show that  $f(x)$ is continuous at  $x=3.$ (b) Using the limit definition of the derivative, and computing the limits from both sides, show that  $f(x)$ is differentiable at  $x=3$ .

Foundations:
1.  $f(x)$ is continuous at  $x=a$ if
$\lim _{x\rightarrow a^{+}}f(x)=\lim _{x\rightarrow a^{-}}f(x)=f(a).$ 2. The definition of derivative for  $f(x)$ is
$f'(x)=\lim _{h\rightarrow 0}{\frac {f(x+h)-f(x)}{h}}.$ Solution:

(a)

Step 1:
We first calculate  $\lim _{x\rightarrow 3^{+}}f(x).$ We have

${\begin{array}{rcl}\displaystyle {\lim _{x\rightarrow 3^{+}}f(x)}&=&\displaystyle {\lim _{x\rightarrow 3^{+}}4{\sqrt {x+1}}}\\&&\\&=&\displaystyle {4{\sqrt {3+1}}}\\&&\\&=&\displaystyle {8.}\end{array}}$ Step 2:
Now, we calculate  $\lim _{x\rightarrow 3^{-}}f(x).$ We have

${\begin{array}{rcl}\displaystyle {\lim _{x\rightarrow 3^{-}}f(x)}&=&\displaystyle {\lim _{x\rightarrow 3^{-}}x+5}\\&&\\&=&\displaystyle {3+5}\\&&\\&=&\displaystyle {8.}\end{array}}$ Step 3:
Now, we calculate  $f(3).$ We have

$f(3)=4{\sqrt {3+1}}\,=\,8.$ Since
$\lim _{x\rightarrow 3^{+}}f(x)=\lim _{x\rightarrow 3^{-}}f(x)=f(3),$ $f(x)$ is continuous at  $x=3.$ (b)

Step 1:
We need to use the limit definition of derivative and calculate the limit from both sides. So, we have

${\begin{array}{rcl}\displaystyle {\lim _{h\rightarrow 0^{-}}{\frac {f(3+h)-f(3)}{h}}}&=&\displaystyle {\lim _{h\rightarrow 0^{-}}{\frac {(3+h)+5-8}{h}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{-}}{\frac {h}{h}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{-}}1}\\&&\\&=&\displaystyle {1.}\end{array}}$ Step 2:
Now, we have

${\begin{array}{rcl}\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {f(3+h)-f(3)}{h}}}&=&\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {4{\sqrt {3+h+1}}-8}{h}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {4({\sqrt {4+h}}-{\sqrt {4}})}{h}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {4({\sqrt {4+h}}-{\sqrt {4}})({\sqrt {4+h}}+{\sqrt {4}})}{h({\sqrt {4+h}}+{\sqrt {4}})}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {4(4+h-4)}{h({\sqrt {4+h}}+{\sqrt {4}})}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {4h}{h({\sqrt {4+h}}+{\sqrt {4}})}}}\\&&\\&=&\displaystyle {\lim _{h\rightarrow 0^{+}}{\frac {4}{({\sqrt {4+h}}+{\sqrt {4}})}}}\\&&\\&=&\displaystyle {\frac {4}{2{\sqrt {4}}}}\\&&\\&=&\displaystyle {1.}\\\end{array}}$ Step 3:
Since
$\lim _{h\rightarrow 0^{-}}{\frac {f(3+h)-f(3)}{h}}=\lim _{h\rightarrow 0^{+}}{\frac {f(3+h)-f(3)}{h}},$ $f(x)$ is differentiable at  $x=3.$ (a)     Since $\lim _{x\rightarrow 3^{+}}f(x)=\lim _{x\rightarrow 3^{-}}f(x)=f(3),~f(x)$ is continuous at $x=3.$ (b)     Since $\lim _{h\rightarrow 0^{-}}{\frac {f(3+h)-f(3)}{h}}=\lim _{h\rightarrow 0^{+}}{\frac {f(3+h)-f(3)}{h}},$ $f(x)$ is differentiable at $x=3.$ 