The Zebra Danio and its escape response
UBC Calculus Online Course Notes

Continuity and Differentiability

Up to this point, we have used the derivative in some powerful ways. For instance, we saw how critical points (places where the derivative is zero) could be used to optimize various situations. However, there are limits to these techniques which we will discuss here. Basically, these arise when there are some points near which a function behaves poorly.


Thus far in the course, the functions we have considered have been continuous. To say it in plain words, this means that we can draw the graph without lifting our pens like the graph on the right.

To be a bit more precise, we say that a function $  f(x)  $ is continuous at a point a when we can make the value of $  f(x)  $ become close to f(a) by taking x close to a. We will write this as

\lim_{x \to a} f(x) = f(a). 

If this condition is not satisfied, we say that the function f is discontinuous at a. This situation could arise in several different ways.

  1. Jump Discontinuities: Consider the price $  C(t)  $ of parking at a parking meter for a length of time t. If the cost is $2 per hour, the graph of $  C(t)  $ would look something like this:

    Here we suspect that the integer values of t are discontinuities of the function $  C(t)  $ since we could not draw this graph without picking up the pen at these points.

    To use our more precise notion of continuity, let's consider the value of the function at t = 1. We know that C(1) = 4. However, we cannot force the function to be close to 4 by taking values of t close to 1. This is because no matter how close we require t to be to 1, there will still be some values for which C(t) = 2 .

    Notice that, for a function like this, our usual methods from calculus would not be applicable. That is, if we wanted to find the maximum value on some interval, we would not be able to find it by looking for critical points.

  2. Vertical Asymptotes: Consider the function $ 
f(t) = \tan(t)  $ and remember that the graph looks like:

    Here the function is not defined at the points $  \pm \frac \pi 
2, \pm \frac {3\pi} 2,\ldots  $ and near these points, the function becomes both arbitrarily large and arbitrarily small. Since the function is not defined at these points, it cannot be continuous. Again, if this function arose in a situation which we wanted to optimize, we would have to be careful when applying our usual methods from calculus.

  3. Holes: There are some situations which present us with a function which has an "unusual" point (in fact, we'll see an example of this later on). Here is an example:

f(x) = \left\{ \begin{array}{ll} 
\frac{x^2 - 1}{x-1} & \mbox{ if } x \neq 1 \\ 
3 & \mbox{ if } x = 1. 

    In this example, the function is nicely defined away from the point x = 1. In fact, if $  x \neq 1  $ , the function is

f(x) = \frac{x^2 - 1}{x-1} = \frac{(x+1)(x-1)}{x-1} = x+1 

    However, if we were to consider the point x = 1, this definition no longer makes sense since we would have to divide by zero. The function instead tells us that the value of the function is f(1) = 3. Here is the graph

    In this example, the graph has a "hole" at the point x = 1. Again, if we were to apply the methods we have from calculus to find the maxima or minima of this function, we would have to take this special point into consideration.

Mathematicians have made an extensive study of discontinuities and found that they arise in many forms. In practice, however, these are the principle types you are likely to encounter.


We have earlier seen functions which have points at which the function is not differentiable. An easy example is the absolute value function which is not differentiable at the origin.

Notice that this function has a minimum value at the origin, yet we could not find this value as the critical point of the function since the derivative is not defined there (remember that a critical point is a point where the derivative is defined and zero).

A similar example would be the function $  f(x) = 
x^{2/3} $ . Notice that $  f^\prime(x) = \frac 23 
x^{-1/3} $ which shows that the derivative does not exist at $ 
x = 0 $ . However, this function has a minimum value at $  x = 
0 $ .

An example

To illustrate how to deal with these kinds of situations, here is an example. Suppose that you are on one side of a lake listening to the radio. There is an announcement that you have won a special prize, but you must call the radio station quickly. The nearest phone is on the other side of the lake and you would like to reach the phone as quickly as possible.

The situation is drawn to the left. The lake is shaped like a circle of radius 1 kilometer and there is a bridge running across the lake. You are at the point (-1,0) while the phone is at the point $  (\frac{\sqrt{3}}{2}, \frac 12) $ . You can swim at 3 km/hour and run at 6 km/hour.

Let's find out how long it would take to reach the phone if you first swam across the lake at an angle t and then ran along the shore to the phone. Remember that distance is equal to velocity times time so that the length of time it takes to swim is equal to the distance that you swim divided by the velocity at which you swim.

To compute the distance you swim $  d_s $ , we can use the law of cosines. It says that

\[  d_s^2 = 1 + 1 - 2\cos(\pi - 2t) = 2 + 2\cos(2t) = 4\cos^2(t). 

In other words, $  d_s = 2\cos(t) $ so that the time it takes you to swim is $  T_s = \frac{d_s}{3} = \frac 23 \cos(t) $ .

Now, once you reach the opposite shore, you still have to run a distance along the shore. The phone is at a position which corresponds to a central angle of $  \frac \pi 6 $ . Since you finish your swim at a position which corresponds to a central angle of $  2t  $ , the distance you must run is

d_r = |2t - \frac \pi 6|. 

The amount of time it takes to do this is

T_r = \frac 16 (|2t - \frac \pi 6|) 

which says that the total time it takes to reach the phone along this route is

T(t) = T_s + T_r = \frac 23 \cos(t) + \frac 16 (|2t - \frac \pi 6|). 

Of course, we have to be careful since this formula assumes we are actually swimming for some of the time. This is the case only if $  t \neq 0 $ since when t = 0, we can just run across the bridge which means we are running the entire way. The amount of time this takes is $  T(0) = \frac 16 (2 + \frac \pi 6) $ . In other words, our function is

T(t) = \left\{ \begin{array}{ll} 
\frac 23 \cos(t) + \frac 16 (|2t - \frac \pi 6|) & \mbox{ if } t \neq 0 \\ 
\frac 16(2 + \frac \pi 6) & \mbox{ if } t = 0 
\end{array} \right. 

In other words, the function is not continuous at t = 0 nor is it differentiable at $  t = \frac{\pi}{12}  $ . These points will have to be tested separately.

T(t) = \left\{ \begin{array}{ll} 
\frac 23 \cos(t) - \frac 16 (2t - \frac \pi 6) & \mbox{ if } -\frac \pi 
2 < t < 0 \\ \\ 
\frac 16 (2 + \frac \pi 6) & \mbox{ if } t = 0 \\ \\ 
\frac 23 \cos(t) - \frac 16 (2t - \frac \pi 6) & \mbox{ if } 0 < t \leq \frac 
\pi {12} \\ \\ 
\frac 23 \cos(t) + \frac 16 (2t - \frac \pi 6) & \mbox{ if } \frac 
\pi {12} \leq t \leq \frac \pi 2\\ \\ 
\end{array} \right. 

Let's look for any critical points by computing the derivative now:

T^\prime(t) = 
\left\{ \begin{array}{ll} 
-\frac 23 \sin(t) - \frac 13 & \mbox{ if } -\frac \pi 2 < t < 0 \\ \\ 
-\frac 23 \sin(t) - \frac 13 & \mbox{ if } 0 < t < \frac{\pi}{12} \\ \\ 
-\frac 23 \sin(t) + \frac 13 & \mbox{ if } \frac 
\pi {12} < t \leq \frac \pi 2\\ 
\end{array} \right. 

This produces critical points at $  t = \pm \frac \pi 6 $ . To find which path is the real minimum, we need to test these critical point,, the point at which the function is not differentiable, the point at which the function is not continuous and the endpoints.

T(-\frac \pi 2) & = & 0.61 \\ \\ 
T(-\frac \pi 6) & = & 0.84 \\ \\ 
T(0) & = & 0.42 \\ \\ 
T(\frac \pi {12}) & = & 0.64 \\ \\ 
T(\frac \pi 6) & = & 0.66 \\ \\ 
T(\frac \pi 2) & = & 0.44 

This shows that the minimum occurs at t = 0 which is a point of discontinuity. The following graph shows the function $  T(t)  $ .