### Home > CALC > Chapter 4 > Lesson 4.4.1 > Problem4-126

4-126.

Sketch $g(x)$ below and determine if it is differentiable at $x = 2$.

$g ( x ) = \left\{ \begin{array} { c c } { ( x - 1 ) ^ { 2 } } & { \text { for } x < 2 } \\ { 2 \operatorname { sin } ( x - 2 ) + 1 } & { \text { for } x \geq 2 } \end{array} \right.$

Differentiability implies continuity. If you are checking for differentiability, you also need to check for continuity.

To check for continuity:
Verify that: $\lim\limits_{x\rightarrow 2^{-}}g(x)=\lim\limits_{x\rightarrow 2^{+}}g(x)$
and verify that: $\lim\limits_{x\rightarrow 2}g(x)=g(2)$

$\lim\limits_{x\rightarrow 2^{-}}g(x)=\lim\limits_{x\rightarrow 2^{-}}(x-1)^{2}=1$
$\lim\limits_{x\rightarrow 2^{+}}g(x)=\lim\limits_{x\rightarrow 2^{+}}2\text{sin}(x-2)+1=1$
$g(2) = 2(\operatorname{sin}(2-2)) + 1 =1$
$\lim\limits_{x\rightarrow 2^{+}}g(x)=g(2)$
$g(x)$ is continuous at $x = 2$.

To check for differentiability:
Verify that: $\lim\limits_{x\rightarrow 2^{-}}g'(x)=\lim\limits_{x\rightarrow 2^{+}}g'(x)=g'(2)$

$\lim\limits_{x\rightarrow 2^{-}}g'(x)=\lim\limits_{x\rightarrow 2^{-}}(2x-2)=2$
$\lim\limits_{x\rightarrow 2^{+}}g'(x)=\lim\limits_{x\rightarrow 2^{+}}2\text{cos}(x-2)=2$
$g^\prime(2) = 2\operatorname{cos}(2-2) = 2$ ............................

Since both $g(x)$ and $g^\prime(x)$ are continuous at $x = 2$, $g(x)$ is differentiable at $x = 2$.