Differentiability of a piecewise polynomial function which is continuous everywhere.

calculuscontinuityderivativesreal-analysis

Let $P(x)$ and $Q(x)$ be any two polynomials. Consider a function $f:\mathbb{R}\rightarrow\mathbb{R}$, where $\mathbb{R}$ is the set of real numbers, given by $f(x)=\begin{cases}P(x): x\le a\\Q(x):x> a\end{cases}$ such that $P(a)=Q(a)$, then $f$ is continuous on $\mathbb{R}$. Also $f$ is differentiable on the set $\mathbb{R}$ except posssibly at $a$. Further suppose that $\displaystyle\lim_{x\rightarrow{a}}f'(x)$ does not exist. Then can we make a conclusion that $f$ is not differentiable at $a$? If yes then I want a rigorous proof, otherwise a counter example.

My effort and understanding: I know, that in general, for a function which is continuous on $\mathbb{R}$ and differentiable everywhere except possibly at a certain point, $f$ may or may not be differentiable at that point even though limit of derivative at that point does not exists.

Consider a function $f(x)=\begin{cases} x^2\sin{\frac{1}{x}}:x\ne 0\\0:x=0\end{cases}$ .
This function is differentiable on $\mathbb{R}$, however $\displaystyle\lim_{x\rightarrow{0}}f'(x)$ does not exist.

Best Answer

If $f$ was differentiable at $a$, then $f'(a)=P'(a)=Q'(a)$. That's because, assuming that the derivative exists, $$f'(a)=\lim_{h\to0^-} \frac{f(a+h)-f(a)}{h}=\lim_{h\to0^-} \frac{P(a+h)-P(a)}{h}=P'(a)=\lim_{x\to a^-}P'(x)=\lim_{x\to a^-}f'(x)$$ and, since $P(a)=Q(a)=f(a)$, $$f'(a)=\lim_{h\to0^-} \frac{f(a+h)-f(a)}{h}=\lim_{h\to0^+} \frac{Q(a+h)-Q(a)}{h}=Q'(a)=\lim_{x\to a^+}Q'(x)=\lim_{x\to a^+}f'(x)$$ and this implies that $\lim_{x\to a^-}f'(x)=\lim_{x\to a^+}f'(x)$. Therefore if $\lim_{x\rightarrow{a}}f'(x)$ does not exist, then $f$ cannot be differentiable at $a$.

Observe that this is actually true whenever $P$ is continiously differentiable on $(a-\epsilon, a]$ and $Q$ is continiously differentiable on $[a,a+\epsilon)$, even without $P$ and $Q$ being polynomials