# Differentiability of two way defined function.

Let $p(x)$ and $q(x)$ be two differentiable function on $\mathbb{R}$. Now how to check the differentiability of the following function at $x=a$

$$f(x) = \begin{cases} p(x), & \mbox{if } x\mbox{ \geq a} \\ q(x), & \mbox{if } x\mbox{  <a} \end{cases}$$?. I usually check it as , if $\lim_{x\to a^{+}} p^{'}(x)$=$\lim_{x\to a^{-}} q^{'}(x)$ then $f$ is differentiable at $a$. Am i right in this calculation.? Please suggest me is it right method to check differentiability of the function $f$ at $x=a.$?

• Please some one suggest me... – Parvesh Kumar May 15 '15 at 5:04
• No. You must check that $\lim_{x \to a^+} \frac{p(x)-p(a)}{x-a} = \lim_{x -\to a^-} \frac{q(x)-p(a)}{x-a}.$ – matt biesecker May 15 '15 at 5:12
• You need to check differentiability of $f$ not continuity of $p',q'$. – copper.hat May 15 '15 at 5:13
• @mattbiesecker if q(x) is also defined at x=a then the method of parvesh kumar will work?? – neelkanth May 15 '15 at 6:17
• @Yogesh. If $q(a)$ is defined, then it must equal $p(a),$ otherwise $f$ will not even be a function. – matt biesecker May 15 '15 at 6:23

At a minimum you need continuity. What condition is necessary at $x=a$ for continuity?
You need $\lim_{x \downarrow a} {f(x)-f(a) \over x-a} = \lim_{x \uparrow a} {f(x)-f(a) \over x-a}$.
1) A case where the derivative exists, but the left/hand hand limits do not exist is $$f(x) = \left\{ \begin{array}{cl} x^2 \sin(1/x) \ \ & x\neq 0 \\ 0 & x=0 \end{array} \right.\ \ .$$ Then both of $\lim_{x\to 0^+} f'(x)$ and $\lim_{x\to 0^-} f'(x)$ do not exist. However, $f'(0)=0$ via the definition of differentiability.
2) A case where the left and right hand limits of $f'$ agree, but $f'(0)$ does not exist is rather trivial:
$$f'(x) = \left\{ \begin{array}{cl} 1 \ \ & x\geq 0 \\ 0 & x<0 \end{array} \right.\ \ .$$ Then $\lim_{x\to 0^+} f'(x) = \lim_{x\to 0^-} f'(x)=0,$ but $f'(0)$ does not exist.