# 009A Sample Final 1, Problem 2

Consider the following piecewise defined function:

${\displaystyle 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  ${\displaystyle f(x)}$  is continuous at  ${\displaystyle x=3.}$

(b) Using the limit definition of the derivative, and computing the limits from both sides, show that  ${\displaystyle f(x)}$  is differentiable at  ${\displaystyle x=3}$.

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

Solution:

(a)

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

${\displaystyle {\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  ${\displaystyle \lim _{x\rightarrow 3^{-}}f(x).}$  We have

${\displaystyle {\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  ${\displaystyle f(3).}$  We have

${\displaystyle f(3)=4{\sqrt {3+1}}\,=\,8.}$

Since
${\displaystyle \lim _{x\rightarrow 3^{+}}f(x)=\lim _{x\rightarrow 3^{-}}f(x)=f(3),}$
${\displaystyle f(x)}$  is continuous at  ${\displaystyle x=3.}$

(b)

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

${\displaystyle {\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

${\displaystyle {\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
${\displaystyle \lim _{h\rightarrow 0^{-}}{\frac {f(3+h)-f(3)}{h}}=\lim _{h\rightarrow 0^{+}}{\frac {f(3+h)-f(3)}{h}},}$
${\displaystyle f(x)}$  is differentiable at  ${\displaystyle x=3.}$

(a)     Since ${\displaystyle \lim _{x\rightarrow 3^{+}}f(x)=\lim _{x\rightarrow 3^{-}}f(x)=f(3),~f(x)}$  is continuous at ${\displaystyle x=3.}$
(b)     Since ${\displaystyle \lim _{h\rightarrow 0^{-}}{\frac {f(3+h)-f(3)}{h}}=\lim _{h\rightarrow 0^{+}}{\frac {f(3+h)-f(3)}{h}},}$
${\displaystyle f(x)}$  is differentiable at ${\displaystyle x=3.}$