Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 4928

Differentiability

So far we have looked at derivatives outside of the notion of differentiability. The problem with this approach, though, is that some functions have one or many points or intervals where their derivatives are undefined. A function ff is differentiable at a point cc if

limh0f(c+h)f(c)h\underset{h\to0}{\rm{lim}}\dfrac{f(c+h)-f(c)}{h} exists.

Similarly, ff is differentiable on an open interval (a,b)(a, b) if

limh0f(c+h)f(c)h\underset{h\to0}{\rm{lim}}\dfrac{f(c+h)-f(c)}{h} exists for every cc in (a,b)(a, b).

Basically, ff is differentiable at cc if f(c)f'(c) is defined, by the above definition. Another point of note is that if ff is differentiable at cc, then ff is continuous at cc.

Let's go through a few examples and discuss their differentiability. First, consider the following function:

f(x)=1x2f(x)=\dfrac{1}{x^2}

plot(1/x^2, x, -5, 5).show(ymin=0, ymax=10)

To find the limit of the function's slope when the change in x is 0, we can either use the true definition of the derivative and do

def f(x): return 1/x^2 var('h') ((f(x+h)-f(x))/h).rational_simplify().subs(h=0)

or we can simply use the rules of differentiation by calling 'derivative(1/x^2, x)'. In any case, we find that

f(x)=2x3f'(x)=-\dfrac{2}{x^3}

Since f(x)f'(x) is undefined when x=0(2/02=?)x = 0 (-2/0^2 = ?), we say that f(x)f(x) is not differentiable at x=0x = 0. Since f(x)f'(x) is defined for every other xx, we can say that f(x)f'(x) is continuous on (,0)(0,)(-\infty, 0) \cup (0, \infty), where "\cup" denotes the union of two intervals.

How about a function that is everywhere continuous but is not everywhere differentiable? This occurs quite often with piecewise functions, since even though two intervals might be connected, the slope can change radically at their junction. Take a look at the function g(x)=xg(x) = |x|.

plot(abs(x), x, -5, 5)

Not only is v(t)v(t) defined solely on [2,)[2, ∞), it has a jump discontinuity at t=3t = 3. The jump discontinuity causes v(t)v'(t) to be undefined at t=3t = 3; do you see why? Using a slightly modified limit definition of the derivative, think of what

limxcf(x)f(c)xc\underset{x\to{c}}{\rm{lim}}\dfrac{f(x)-f(c)}{x-c}

would be for c=3c = 3 and some xx very close to 33. The resulting slope would be astronomically large either negatively or positively, right? In fact, the dashed line connecting v(t)v(t) for t3t \neq 3 and v(3)v(3) is what the tangent line will look like at that point. Since a function's derivative cannot be infinitely large and still be considered to "exist" at that point, vv is not differentiable at t=3t=3.

The Mean Value Theorem

The Mean Value Theorem is very important for the discussion of derivatives; even though it might seem somewhat obvious, it is actually very important to many other concepts in calculus. We'll start with an example.

Consider the vast, seemingly endless state of Montana. Now, pretend that you are driving across Montana so that you can get to Washington, and you want to do so as quickly as possible. The problem, however, is that the signs posted every few miles explicitly state that the speed limit is 70 miles per hour. "Oh well," you tell yourself. "When I'm on the open road, I will go as fast as I want. When I approach a town, though, I will slow down so that the police are none the wiser."

Since you had been staying with some relatives in the town of Springdale, you first head east at the brisk pace of 90 miles per hour until, feeling your stomach rumble (you really aren't cut out for these long drives), you stop in Livingston for some lunch. When you arrive, however, a policeman signals you to pull over! "What did I do wrong?" you sweetly ask the officer. Giving you a hard look, the policeman responds, "Though I didn't actually see you speeding at any point on your way here, I know that you must have, since one of my buddies back in Livingston tells me that you left there only 10 minutes ago, and our two towns are about 15 miles apart. I won't cite you for it this time, but you'd better drive slower in the future."

The question is: How did the policeman know you had been speeding? Well, since it took you 10 minutes to travel 15 miles, your average speed was 90 miles per hour. So either you traveled at exactly 90 miles per hour the entire time, or you traveled at more than 90 part of the way and less than ninety part of the way. In either case, you were going faster than the speed limit at some point in time.

The Mean Value Theorem has a very similar message: if a function ff is continuous on the closed interval [a,b][a, b] and is differentiable on the open interval (a,b)(a, b), then there is some cc in (a,b)(a, b) such that

f(c)=f(b)f(a)baf'(c)=\dfrac{f(b)-f(a)}{b-a}

Basically, the average slope of ff between aa and bb will equal the actual slope of ff at some point between aa and bb. To illustrate the Mean Value Theorem, consider the function f(x)=xsin(x)f(x) = x*\sin(x) for xx in [0,9π2][0, \dfrac{9\pi}{2}]. Assume that ff is differentiable on (0,9π2)(0, \dfrac{9\pi}{2}) (it is) and continuous on [0,9π2][0, \dfrac{9\pi}{2}] (it is). By the Mean Value Theorem, there is at least one cc in (0,9π2)(0, \dfrac{9\pi}{2}) such that

f(c)=f(9π2)f(0)9π20=9π2sin(9π2)0sin(0)9π20=sin(9π2)=1f'(c)=\dfrac{f(\dfrac{9\pi}{2})-f(0)}{\dfrac{9\pi}{2}-0}=\dfrac{\dfrac{9\pi}{2}*\sin(\dfrac{9\pi}{2})-0*\sin(0)}{\dfrac{9\pi}{2}-0}=\sin(\dfrac{9\pi}{2})=1

And such a cc does exist, in fact. You can use SageMath's solve function to verify this:

solve(derivative(x*sin(x), x) == 0, x)
[x == -sin(x)/cos(x)]

From the code's output, you can see that this is true whenever sin(x)/cos(x)-\sin(x)/\cos(x) is 0. Thus c=0c = 0, π\pi, 2π2\pi, 3π3\pi, and 4π4\pi, so the Mean Value Theorem is satisfied for ff on the interval [0,9π2][0, \dfrac{9\pi}{2}].

Rolle's Theorem

Rolle's Theorem states that if a function gg is differentiable on (a,b)(a, b), continuous [a,b][a, b], and g(a)=g(b)g(a) = g(b), then there is at least one number cc in (a,b)(a, b) such that g(c)=0g'(c) = 0. To see this, consider the everywhere differentiable and everywhere continuous function g(x)=(x3)(x+2)(x2+4)g(x) = (x-3)*(x+2)*(x^2+4). To prove that gg' has at least one zero for xx in (,)(-\infty, \infty), notice that g(3)=g(2)=0g(3) = g(-2) = 0. By Rolle's Theorem, there must be at least one cc in (2,3)(-2, 3) such that g(c)=0g'(c) = 0.

Practice Problems

Determine the interval(s) on which the following functions are continuous and the interval(s) on which they are differentiable.

  1. f(x)=x33+3f(x)=\sqrt[3]{x-3}+3

# Taking the cube root (or any odd root) of a negative number does not work well in Python, so one has to use multiple plot commands for functions such as x^(1/3) to compensate for the intervals on which x is negative plot((x-3)^(1/3)+3, x, 3, 6) + plot(-(-x+3)^(1/3)+3, x, 0, 3)
%md 2) $f(x)= \begin{cases} \sin x & 0\leq x\leq \dfrac{\pi}{2} \\ \cos 2x + 2 & \dfrac{\pi}{2} \leq x \leq \pi \end{cases} $ Hint: Do both pieces of $f(x)$ match at $\dfrac{\pi}{2}$? Do the derivatives of the two pieces match there?
  1. f(x)={sinx0xπ2cos2x+2π2xπf(x)= \begin{cases} \sin x & 0\leq x\leq \dfrac{\pi}{2} \\ \cos 2x + 2 & \dfrac{\pi}{2} \leq x \leq \pi \end{cases}

Hint: Do both pieces of f(x)f(x) match at π2\dfrac{\pi}{2}? Do the derivatives of the two pieces match there?

plot(sin(x), x, 0, pi/2)+plot(cos(2*x)+2, x, pi/2, pi)
  1. h(x)=lnx+2h(x) =\ln x + 2, x=1 x=1

point((1, ln(1)+2), rgbcolor='black').show()

Use the Mean Value Theorem to answer the following questions.

  1. Marvin claims that he is a speed-walker and that he always walks at 6 miles per hour. He tells you that it took him only 12 minutes to walk one mile this morning. Prove that Marvin was not actually speed-walking at some point during his walk.

  2. Jessica plays for a recreational basketball team, and has noticed an interesting trend: the number of points she scores each game has increased linearly for the first five games of the season. If she scored 10 points in the first game, must there be some game of the last five in which she scored 14 points?

  3. Suppose that f(x)<1f'(x) < 1 for xx in (0,4)(0, 4). If f(0)=1f(0) = 1, can f(4)=5f(4) = 5?

To view answers, select this cell and paste it into your own sagews, and then double click on it

[Previous: The Definition of the Derivative](The_Definition_of_the_Derivative.sagews) | [To Main](Introduction.sagews) | [Next: The Rules of Differentiation](The_Rules_of_Differentiation.sagews)