Derivatives are one of the most important concepts in calculus. They describe the rate of change of a function with respect to a variable. However, not every function has a derivative. In this article, we will explain how to determine whether or not a given function has a derivative, as well as how to determine whether or not a function is continuous. We will also provide a few examples to better illustrate the concepts.
Continuity
For a function to be differentiable, it has to be always continuous. We say that a function is continuous over $[a,b]$ if $\displaystyle\lim_{x\to c} f(x) = f(c)$ for all values of $c$ on $[a,b]$. If a function is always continuous, that means that $\displaystyle\lim_{x\to c} f(x) = f(c)$ for all values of $c$ on $(-\infty,\infty)$. The statement says that if we can approximate each point on the function using other points on the function, then the function is continuous. For more information on how to calculate limits, check out this article.
The primary way of determining a function’s continuity is by examining it visually. If the function does not contain any jump or point discontinuities, and also does not contain a vertical asymptote, then the function is continuous. Below you can see an example a function that is not continuous. It has a removable discontinuity at $a$, infinite discontinuity at $b$ and jump discontinuity at $c$.
To summarize, if we can draw a function without ever lifting our pencil, the function is continuous. The function below does not have any discontinuities because we can draw it with one continuous stroke.
We will explore this concept further using a piecewise function as our example. The graph of $f(x)$ is shown below.
$$ f(x) = \begin{cases} \frac{x}{2} & \text{if } x < 2 \\ 3 & \text{if } 2 \leq x < 3 \\ 6 – x & \text{if } x \geq 3 \end{cases} $$
While it is visually clear that this function is not continuous, there will be times when a graph is not provided, and we have to make sure the function is continuous. To do this, we look at the $x$ values where the case of the piecewise switches, in this case being $x = 2$ and $x = 3$, and confirm that the limit from each side is equal.
For $x = 3$, the limit from the left-hand side is equal to $3$, as that section is a flat line, and will be equal to $3$ throughout. From the right side, our limit is going to be:
$$\displaystyle\lim_{x\to 3^+} 6-x$$.
Evaluating this limit, we find that the limit from the right-hand side is also equal to $3$. This means that the limit exists at $x=3$, and that it equals $f(3)$, since $f(3)$ is defined using the third case of the piecewise.
For $x=2$, the limit from the left hand side is:
$$\displaystyle\lim_{x\to3^+} \frac{x}{2}$$.
Evaluating this limit, we find that the approximation of $f(2)$ from the left-hand side is $1$. Because the $2 \leq x < 3$ case is a flat line at $y = 3$, the limit from the right-hand side is $3$. Since the limits from each side are different, the limit does not exist at $x = 2$, meaning that the function is not continuous at $x = 2$. This means that the function is not always continuous, and does not have a derivative.
Here is a list of some common functions and whether or not they are continuous:
Always Continuous:
- Polynomials
- Root functions
- $\sin x$ and $\cos x$
- inverse trigonometric functions
- Exponential functions
- Logarithmic functions
- Some piecewise functions
Not Continuous:
- $\tan x$ (discontinuous when $x = k\pi \pm \dfrac{\pi}{4}$, where $k$ is an integer)
- Rational functions (discontinuous when the denominator is 0, e.g. $\dfrac{1}{x}$ is continuous everywhere except $x = 0$)
- $\lfloor x \rfloor$ and $\lceil x \rceil$ (discontinuous when $x$ is an integer)
- Some piecewise functions
However, it gets a bit more complicated than just checking whether or not a function is continuous, as…
Not Every Continuous Function is Differentiable
While every differentiable function is continuous, not every continuous function is differentiable. It turns out that, for a function to be differentiable everywhere, its derivative must also be differentiable everywhere. For example, consider $f(x) = |x|$, which is continuous but not differentiable at $x = 0$. To prove this, let’s rewrite the function as a piecewise function:
$$ f(x) = \begin{cases} -x & \text{if } x < 0 \\ x & \text{if } x \geq 0 \end{cases} \qquad \text{so} \quad f'(x) = \begin{cases} -1 & \text{if } x < 0 \\ 1 & \text{if } x \geq 0 \end{cases} $$
Because $f’(x)$ is not continuous at $x = 0$, we essentially have two conflicting values for $f’(x)$, and therefore
In general, a function is not differentiable at sharp corners. Below is a graph of $f(x) = |\sin x|$, which is continuous and not differentiable at infinitely many points. (Can you determine what those points are?)
Conclusion
In this article we discussed what it means for a function to be continuous and saw examples of functions that are continuous, but not differentiable. Even though most functions you will encounter are both continuous and differentiable, it is important to remember that many continuous functions are not differentiable. In fact, there exist functions that are continuous everywhere, but differentiable nowhere! Two examples of such functions are the Weierstrass function and the Blancmange curve.