Continuous Functions are not Always Differentiable. But can we safely say that if a function f(x) is differentiable within range $(a,b)$ then it is continuous in the interval $[a,b]$ . If so , what is the logic behind it ?
Calculus – Is a Differentiable Function Always Continuous?
calculus
Related Solutions
Let $g(0)=1$ and $g(x)=0$ for all $x\ne 0$. It is straightforward from the definition of the Riemann integral to prove that $g$ is integrable over any interval, however, $g$ is clearly not continuous.
The conditions of continuity and integrability are very different in flavour. Continuity is something that is extremely sensitive to local and small changes. It's enough to change the value of a continuous function at just one point and it is no longer continuous. Integrability on the other hand is a very robust property. If you make finitely many changes to a function that was integrable, then the new function is still integrable and has the same integral. That is why it is very easy to construct integrable functions that are not continuous.
Let us start with
$$h(x) = \begin{cases} \hphantom{-}4(x+2) &, -2\leqslant x < -\frac{3}{2}\\ -4(x+1) &, -\frac{3}{2} \leqslant x < -1\\ -4(x-1) &, \hphantom{-}\; 1 \leqslant x < \frac{3}{2}\\ \hphantom{-} 4(x-2) &, \hphantom{-}\frac{3}{2}\leqslant x < 2\\ \qquad 0 &, \hphantom{-} \text{ otherwise.} \end{cases}$$
For $c > 0$, let
$$h_c(x) = c\cdot h(c\cdot x).$$
Then $h_c$ is continuous, and $\int_{-\infty}^0 h_c(x)\,dx = 1$ as well as $\int_{-\infty}^\infty h_c(x)\,dx = 0$. Now let
$$g(x) = \sum_{n=1}^\infty h_{5^n}\left(x-n-\frac{1}{2}\right).$$
Every $g_n(x) = h_{5^n}\left(x-n-\frac12\right)$ vanishes identically outside the interval $[n,n+1]$, so $g$ is continuous, and
$$f(x) = \int_0^x g(t)\,dt$$
is well-defined and continuously differentiable.
Furthermore, $f(x) \equiv 0$ on every interval $\left[n, n+\frac{1}{2} - \frac{2}{5^n}\right]$, and $f(x) \equiv 1$ on every interval $\left[n+\frac{1}{2}-\frac{1}{5^n}, n+\frac{1}{2}+\frac{1}{5^n}\right]$. Thus on
$$X = \bigcup_{n=1}^\infty \left(\left[n, n+\frac{1}{2} - \frac{2}{5^n}\right] \cup \left[n+\frac{1}{2}-\frac{1}{5^n}, n+\frac{1}{2}+\frac{1}{5^n}\right]\right)$$
we have $f' \equiv 0$, so the derivative is bounded, but
$$f\left(n+\frac{1}{2}-\frac{1}{5^n}\right) - f\left(n+\frac{1}{2}-\frac{2}{5^n}\right) = 1$$
for all $n$, while the distance between the two points is $5^{-n}$ which becomes arbitrarily small, so $f$ is not uniformly continuous on $X$.
If the sentence
Note that $X$ cannot be an interval, a disjoint union of intervals, nor can it be a discrete set.
was meant to forbid a construction as above where $X$ is a disjoint union of intervals, we can obey the letter of the law (but not the spirit) by adding an arbitrary subset of $(-\infty,0)$ that is not a union of disjoint intervals.
Best Answer
I will assume that $a<b$.
Consider the function $g: [a,b]\to {\mathbb R}$ which equals $0$ at $a$, and equals $1$ on the interval $(a,b]$. This function is differentiable on $(a,b)$ but is not continuous on $[a,b]$. Thus, "we can safely say..." is plain wrong.
However, one can define derivatives of an arbitrary function $f: [a,b]\to {\mathbb R}$ at the points $a$ and $b$ as $1$-sided limits: $$ f'(a):= \lim_{x\to a+} \frac{f(x)-f(a)}{x-a}, $$ $$ f'(b):= \lim_{x\to b-} \frac{f(x)-f(b)}{x-b}. $$ If these limits exist (as real numbers), then this function is called differentiable at the points $a, b$. For the points of $(a,b)$ the derivative is defined as usual, of course. The function $f$ is said to be differentiable on $[a,b]$ if its derivative exists at every point of $[a,b]$.
Now, the theorem is that a function differentiable on $[a,b]$ is also continuous on $[a,b]$. As for the proof, you can avoid $\epsilon$-$\delta$ definitions and just use limit theorems. For instance, to check continuity at $a$, use: $$ \lim_{x\to a+} (f(x)-f(a))= \lim_{x\to a+} (x-a) \lim_{x\to a+} \frac{f(x)-f(a)}{x-a} = 0\cdot f'(a)=0. $$ Hence, $$ \lim_{x\to a+} f(x)=f(a), $$ hence, $f$ is continuous at $a$. For other points the proof is the same.