Skip to main content

CLP-1 Differential Calculus

Section 2.2 Definition of the Derivative

We now define the “derivative” explicitly, based on the limiting slope ideas of the previous section. Then we see how to compute some simple derivatives.
Let us now generalise what we did in the last section so as to find “the slope of the curve \(y=f(x)\) at \((x_0,y_0)\)” for any smooth enough
 1 
The idea of “smooth enough” can be made quite precise. Indeed the word “smooth” has a very precise meaning in mathematics, which we won’t cover here. For now think of “smooth” as meaning roughly just “smooth”.
function \(f(x)\text{.}\)
As before, let \((x_0,y_0)\) be any point on the curve \(y=f(x)\text{.}\) So we must have \(y_0=f(x_0)\text{.}\) Now let \((x_1,y_1)\) be any other point on the same curve. So \(y_1=f(x_1)\) and \(x_1\ne x_0\text{.}\) Think of \((x_1,y_1)\) as being pretty close to \((x_0,y_0)\) so that the difference
\begin{gather*} \De x=x_1-x_0 \end{gather*}
in \(x\)–coordinates is pretty small. In terms of this \(\De x\) we have
\begin{gather*} x_1=x_0+\De x\qquad\text{and}\qquad y_1=f\big(x_0+\De x\big) \end{gather*}
We can construct a secant line through \((x_0,y_0)\) and \((x_1,y_1)\) just as we did for the parabola above. It has slope
\begin{gather*} \frac{y_1-y_0}{x_1-x_0}=\frac{f\big(x_0+\De x\big)-f(x_0)}{\De x} \end{gather*}
If \(f(x)\) is reasonably smooth
 2 
Again the term “reasonably smooth” can be made more precise.
, then as \(x_1\) approaches \(x_0\text{,}\) i.e. as \(\De x\) approaches \(0\text{,}\) we would expect the secant through \((x_0,y_0)\) and \((x_1,y_1)\) to approach the tangent line to the curve \(y=f(x)\) at \((x_0,y_0)\text{,}\) just as happened in Figure 2.1.6. And more importantly, the slope of the secant through \((x_0,y_0)\) and \((x_1,y_1)\) should approach the slope of the tangent line to the curve \(y=f(x)\) at \((x_0,y_0)\text{.}\)
Thus we would expect
 3 
Indeed, we don’t have to expect — it is!
the slope of the tangent line to the curve \(y=f(x)\) at \((x_0,y_0)\) to be
\begin{gather*} \lim_{\De x\rightarrow 0}\frac{f\big(x_0+\De x\big)-f(x_0)}{\De x} \end{gather*}
When we talk of the “slope of the curve” at a point, what we really mean is the slope of the tangent line to the curve at that point. So “the slope of the curve \(y=f(x)\) at \((x_0,y_0)\)” is also the limit
 4 
This is of course under the assumption that the limit exists — we will talk more about that below.
expressed in the above equation. The derivative of \(f(x)\) at \(x=x_0\) is also defined to be this limit. Which leads
 5 
We will rename “\(x_0\)” to “\(a\)” and “\(\De x\)” to “\(h\)”.
us to the most important definition in this text:

Definition 2.2.1. Derivative at a point.

Let \(a\in\bbbr\) and let \(f(x)\) be defined on an open interval
 6 
Recall, from Definition 0.3.5, that the open interval \((c,d)\) is just the set of all real numbers obeying \(c \lt x \lt d\text{.}\)
that contains \(a\text{.}\)
  • The derivative of \(f(x)\) at \(x=a\) is denoted \(f'(a)\) and is defined by
    \begin{gather*} f'(a)=\lim_{h\rightarrow 0}\frac{f\big(a+h\big)-f(a)}{h} \end{gather*}
    if the limit exists.
  • When the above limit exists, the function \(f(x)\) is said to be differentiable at \(x=a\text{.}\) When the limit does not exist, the function \(f(x)\) is said to be not differentiable at \(x=a\text{.}\)
  • We can equivalently define the derivative \(f'(a)\) by the limit
    \begin{gather*} f'(a)=\lim_{x\rightarrow a}\frac{f(x)-f(a)}{x-a}. \end{gather*}
    To see that these two definitions are the same, we set \(x=a+h\) and then the limit as \(h\) goes to \(0\) is equivalent to the limit as \(x\) goes to \(a\text{.}\)
Lets now compute the derivatives of some very simple functions. This is our first step towards building up a toolbox for computing derivatives of complicated functions — this process will very much parallel what we did in Chapter 1 with limits. The two simplest functions we know are \(f(x)=c\) and \(g(x)=x\text{.}\)

Example 2.2.2. Derivative of \(f(x)=c\).

Let \(a, c \in \bbbr\) be two constants. Compute the derivative of the constant function \(f(x) = c\) at \(x=a\text{.}\)
We compute the desired derivative by just substituting the function of interest into the formal definition of the derivative.
\begin{align*} f'(a) &= \lim_{h \to 0} \frac{f(a+h) - f(a)}{h} && \text{(the definition)}\\ &= \lim_{h \to 0} \frac{c - c}{h} && \text{(substituted in the function)}\\ &= \lim_{h \to 0} 0 &&\text{(simplified things)}\\ &= 0 \end{align*}
That was easy! What about the next most complicated function — arguably it’s this one:

Example 2.2.3. Derivative of \(g(x)=x\).

Let \(a\in \bbbr\) and compute the derivative of \(g(x) = x\) at \(x=a\text{.}\)
Again, we compute the derivative of \(g\) by just substituting the function of interest into the formal definition of the derivative and then evaluating the resulting limit.
\begin{align*} g'(a) &= \lim_{h \to 0} \frac{g(a+h) - g(a)}{h} && \text{(the definition)}\\ &= \lim_{h \to 0} \frac{(a+h) - a}{h} && \text{(substituted in the function)}\\ &= \lim_{h \to 0} \frac{h}{h} && \text{(simplified things)}\\ &= \lim_{h \to 0} 1 && \text{(simplified a bit more)}\\ &= 1 \end{align*}
That was a little harder than the first example, but still quite straight forward — start with the definition and apply what we know about limits.
Thanks to these two examples, we have our first theorem about derivatives:
To ratchet up the difficulty a little bit more, let us redo the example we have already done a few times \(f(x)=x^2\text{.}\) To make it a little more interesting let’s change the names of the function and the variable so that it is not exactly the same as Examples  2.1.2 and 2.1.5.

Example 2.2.5. Derivative of \(h(t)=t^2\).

Compute the derivative of
\begin{align*} h(t) &= t^2 & \text{ at } t = a \end{align*}
  • This function isn’t quite like the ones we saw earlier — it’s a function of \(t\) rather than \(x\text{.}\) Recall that a function is a rule which assigns to each input value an output value. So far, we have usually called the input value \(x\text{.}\) But this “\(x\)” is just a dummy variable representing a generic input value. There is nothing wrong with calling a generic input value \(t\) instead. Indeed, from time to time you will see functions that are not written as formulas involving \(x\text{,}\) but instead are written as formulas in \(t\) (for example representing time — see Section 1.2), or \(z\) (for example representing height), or other symbols.
  • So let us write the definition of the derivative
    \begin{align*} f'(a) &= \lim_{h \to 0} \frac{f(a+h)-f(a)}{h} \end{align*}
    and then translate it to the function names and variables at hand:
    \begin{align*} h'(a) &= \lim_{h \to 0} \frac{h(a+h)-h(a)}{h} \end{align*}
  • But there is a problem — “\(h\)” plays two roles here — it is both the function name and the small quantity that is going to zero in our limit. It is extremely dangerous to have a symbol represent two different things in a single computation. We need to change one of them. So let’s rename the small quantity that is going to zero in our limit from “\(h\)” to “\(\De t\)”:
    \begin{align*} h'(a) &= \lim_{\De t \to 0} \frac{h(a+\De t)-h(a)}{\De t} \end{align*}
  • Now we are ready to begin. Substituting in what the function \(h\) is,
    \begin{align*} h'(a) &= \lim_{\De t \to 0} \frac{(a+\De t)^2-a^2}{\De t}\\ &= \lim_{\De t \to 0} \frac{a^2+2a\,\De t+\De t^2-a^2}{\De t} && \big(\text{just squared out $(a+\De t)^2$}\big)\\ &= \lim_{\De t \to 0} \frac{2a\,\De t+\De t^2}{\De t}\\ &= \lim_{\De t \to 0} (2a +\De t)\\ &= 2a \end{align*}
  • You should go back check that this is what we got in Example 2.1.5 — just some names have been changed.

Subsection 2.2.1 An Important Point (and Some Notation)

Notice here that the answer we get depends on our choice of \(a\) — if we want to know the derivative at \(a=3\) we can just substitute \(a=3\) into our answer \(2a\) to get the slope is 6. If we want to know at \(a=1\) (like at the end of Section 1.1) we substitute \(a=1\) and get the slope is 2. The important thing here is that we can move from the derivative being computed at a specific point to the derivative being a function itself — input any value of \(a\) and it returns the slope of the tangent line to the curve at the point \(x=a\text{,}\) \(y=h(a)\text{.}\) The variable \(a\) is a dummy variable. We can rename \(a\) to anything we want, like \(x\text{,}\) for example. So we can replace every \(a\) in
\begin{align*} h'(a)&=2a &\text{ by $x$, giving} && h'(x) &=2x \end{align*}
where all we have done is replaced the symbol \(a\) by the symbol \(x\text{.}\)
We can do this more generally and tweak the derivative at a specific point \(a\) to obtain the derivative as a function of \(x\text{.}\) We replace
\begin{align*} f'(a) &= \lim_{h \to 0} \frac{f(a+h)-f(a)}{h}\\ \end{align*}

with

\begin{align*} f'(x) &= \lim_{h \to 0} \frac{f(x+h)-f(x)}{h} \end{align*}
which gives us the following definition

Definition 2.2.6. Derivative as a function.

Let \(f(x)\) be a function.
  • The derivative of \(f(x)\) with respect to \(x\) is
    \begin{gather*} f'(x)=\lim_{h\rightarrow 0}\frac{f\big(x+h\big)-f(x)}{h} \end{gather*}
    provided the limit exists.
  • If the derivative \(f'(x)\) exists for all \(x \in (a,b)\) we say that \(f\) is differentiable on \((a,b)\text{.}\)
  • Note that we will sometimes be a little sloppy with our discussions and simply write “\(f\) is differentiable” to mean “\(f\) is differentiable on an interval we are interested in” or “\(f\) is differentiable everywhere”.
Notice that we are no longer thinking of tangent lines, rather this is an operation we can do on a function. For example:

Example 2.2.7. The derivative of \(f(x)=\tfrac{1}{x}\).

Let \(f(x) = \frac{1}{x}\) and compute its derivative with respect to \(x\) — think carefully about where the derivative exists.
  • Our first step is to write down the definition of the derivative — at this stage, we know of no other strategy for computing derivatives.
    \begin{align*} f'(x)&=\lim_{h\rightarrow 0}\frac{f(x+h)-f(x)}{h} && \text{(the definition)} \end{align*}
  • And now we substitute in the function and compute the limit.
    \begin{align*} f'(x)&=\lim_{h\rightarrow 0}\frac{f(x+h)-f(x)}{h} && \text{(the definition)}\\ &=\lim_{h\rightarrow 0}\frac{1}{h}\left[\frac{1}{x+h}-\frac{1}{x}\right] && \text{(substituted in the function)}\\ &=\lim_{h\rightarrow 0}\frac{1}{h}\ \frac{x-(x+h)}{x(x+h)} && \text{(wrote over a common denominator)}\\ &=\lim_{h\rightarrow 0}\frac{1}{h}\ \frac{-h}{x(x+h)} && \text{(started cleanup)}\\ &=\lim_{h\rightarrow 0} \frac{-1}{x(x+h)}\\ &=-\frac{1}{x^2} \end{align*}
  • Notice that the original function \(f(x)=\frac{1}{x}\) was not defined at \(x=0\) and the derivative is also not defined at \(x=0\text{.}\) This does happen more generally — if \(f(x)\) is not defined at a particular point \(x=a\text{,}\) then the derivative will not exist at that point either.
So we now have two slightly different ideas of derivatives:
  • The derivative \(f'(a)\) at a specific point \(x=a\text{,}\) being the slope of the tangent line to the curve at \(x=a\text{,}\) and
  • The derivative as a function, \(f'(x)\) as defined in Definition 2.2.6.
Of course, if we have \(f'(x)\) then we can always recover the derivative at a specific point by substituting \(x=a\text{.}\)
As we noted at the beginning of the chapter, the derivative was discovered independently by Newton and Leibniz in the late \(17^{\rm th}\) century. Because their discoveries were independent, Newton and Leibniz did not have exactly the same notation. Stemming from this, and from the many different contexts in which derivatives are used, there are quite a few alternate notations for the derivative:

Definition 2.2.8.

The following notations are all used for “the derivative of \(f(x)\) with respect to \(x\)
\begin{gather*} f'(x) \qquad \diff{f}{x} \qquad \diff{}{x}f(x) \qquad \dot{f}(x) \qquad Df(x) \qquad D_x f(x), \end{gather*}
while the following notations are all used for “the derivative of \(f(x)\) at \(x=a\)
\begin{gather*} f'(a) \qquad \diff{f}{x}(a) \qquad \diff{}{x}f(x)\,\bigg|_{x=a} \qquad \dot{f}(a) \qquad Df(a) \qquad D_x f(a). \end{gather*}
Some things to note about these notations:
  • We will generally use the first three, but you should recognise them all. The notation \(f'(a)\) is due to Lagrange, while the notation \(\diff{f}{x}(a)\) is due to Leibniz. They are both very useful. Neither can be considered “better”.
  • Leibniz notation writes the derivative as a “fraction” — however it is definitely not a fraction and should not be thought of in that way. It is just shorthand, which is read as “the derivative of \(f\) with respect to \(x\)”.
  • You read \(f'(x)\) as “\(f\)–prime of \(x\)”, and \(\diff{f}{x}\) as “dee–\(f\)–dee–\(x\)”, and \(\diff{ }{x}f(x)\) as “dee-by-dee–\(x\) of \(f\)”.
  • Similarly you read \(\diff{f}{x}(a)\) as “dee–\(f\)–dee–\(x\) at \(a\)”, and \(\diff{ }{x}f(x)|_{x=a}\) as “dee-by-dee-\(x\) of \(f\) of \(x\) at \(x\) equals \(a\)”.
  • The notation \(\dot f\) is due to Newton. In physics, it is common to use \(\dot f(t)\) to denote the derivative of \(f\) with respect to time.

Subsection 2.2.2 Back to Computing Some Derivatives

At this point we could try to start working out how derivatives interact with arithmetic and make an “Arithmetic of derivatives” theorem just like the one we saw for limits (Theorem 1.4.3). We will get there shortly, but before that it is important that we become more comfortable with computing derivatives using limits and then understanding what the derivative actually means. So — more examples.

Example 2.2.9. \(\diff{}{x}\sqrt{x}\).

Compute the derivative, \(f'(a)\text{,}\) of the function \(f(x)=\sqrt{x}\) at the point \(x=a\) for any \(a \gt 0\text{.}\)
  • So again we start with the definition of derivative and go from there:
    \begin{align*} f'(a) &=\lim_{x\rightarrow a}\frac{f(x)-f(a)}{x-a} =\lim_{x\rightarrow a}\frac{\sqrt{x}-\sqrt{a}}{x-a} \end{align*}
  • As \(x\) tends to \(a\text{,}\) the numerator and denominator both tend to zero. But \(\tfrac{0}{0}\) is not defined. So to get a well defined limit we need to exhibit a cancellation between the numerator and denominator — just as we saw in Examples 1.4.12 and 1.4.17. Now there are two equivalent ways to proceed from here, both based on a similar “trick”.
  • For the first, review Example 1.4.17, which concerned taking a limit involving square-roots, and recall that we used “multiplication by the conjugate” there:
    \begin{align*} \amp\frac{\sqrt{x}-\sqrt{a}}{x-a}\\ &= \frac{\sqrt{x}-\sqrt{a}}{x-a} \times \frac{\sqrt{x}+\sqrt{a}}{\sqrt{x}+\sqrt{a}} && \Big(\text{multiplication by $1=\frac{\text{conjugate}}{\text{conjugate}}$}\Big)\\ &=\frac{(\sqrt{x}-\sqrt{a})(\sqrt{x}+\sqrt{a})} {(x-a)(\sqrt{x}+\sqrt{a})}\\ &= \frac{x-a}{(x-a)(\sqrt{x}+\sqrt{a})} && \big(\text{since $(A-B)(A+B) = A^2-B^2$)}\,\big)\\ &= \frac{1}{\sqrt{x}+\sqrt{a}} \end{align*}
  • Alternatively, we can arrive at \(\frac{\sqrt{x}-\sqrt{a}}{x-a}=\frac{1}{\sqrt{x}+\sqrt{a}}\) by using almost the same trick to factor the denominator. Just set \(A=\sqrt{x}\) and \(B=\sqrt{a}\) in \(A^2 - B^2 = (A-B)(A+B) \) to get
    \begin{align*} x - a &= (\sqrt{x}-\sqrt{a})(\sqrt{x}+\sqrt{a}) \end{align*}
    and then substitute this little fact into our expression
    \begin{align*} \frac{\sqrt{x}-\sqrt{a}}{x-a} &=\frac{\sqrt{x}-\sqrt{a}}{(\sqrt{x}-\sqrt{a})(\sqrt{x}+\sqrt{a})} & \text{(now cancel common factors)}\\ &=\frac{1}{(\sqrt{x}+\sqrt{a})} \end{align*}
  • Once we know that \(\frac{\sqrt{x}-\sqrt{a}}{x-a}=\frac{1}{\sqrt{x}+\sqrt{a}}\text{,}\) we can take the limit we need:
    \begin{align*} f'(a) &=\lim_{x\rightarrow a}\frac{\sqrt{x}-\sqrt{a}}{x-a}\\ & =\lim_{x\rightarrow a}\frac{1}{\sqrt{x}+\sqrt{a}}\\ & =\frac{1}{2\sqrt{a}} \end{align*}
  • We should think about the domain of \(f'\) here — that is, for which values of \(a\) is \(f'(a)\) defined? The original function \(f(x)\) was defined for all \(x \geq 0\text{,}\) however the derivative \(f'(a)=\frac{1}{2\sqrt{a}}\) is undefined at \(a = 0\text{.}\)
    If we draw a careful picture of \(\sqrt{x}\) around \(x=0\) we can see why this has to be the case. The figure below shows three different tangent lines to the graph of \(y=f(x)=\sqrt{x}\text{.}\) As the point of tangency moves closer and closer to the origin, the tangent line gets steeper and steeper. The slope of the tangent line at \(\big(a,\sqrt{a}\big)\) blows up as \(a\to 0\text{.}\)

Example 2.2.10. \(\diff{}{x} \left\{ |x| \right\}\).

Compute the derivative, \(f'(a)\text{,}\) of the function \(f(x)=|x|\) at the point \(x=a\text{.}\)
  • We should start this example by recalling the definition of \(|x|\) (we saw this back in Example 1.5.6):
    \begin{align*} |x| &= \begin{cases} -x & \text{ if } x \lt 0\\ 0 & \text{ if } x=0\\ x & \text{ if }x \gt 0. \end{cases} \end{align*}
    It is definitely not just “chop off the minus sign”.
  • This breaks our computation of the derivative into 3 cases depending on whether \(x\) is positive, negative or zero.
  • Assume \(x \gt 0\text{.}\) Then
    \begin{align*} \diff{f}{x} &= \lim_{h\to0} \frac{f(x+h)-f(x)}{h}\\ &= \lim_{h\to0} \frac{|x+h|-|x|}{h}\\ \\ \end{align*}

    Since \(x \gt 0\) and we are interested in the behaviour of this function as \(h \to 0\) we can assume \(h\) is much smaller than \(x\text{.}\) This means \(x+h \gt 0\) and so \(|x+h|=x+h\text{.}\)

    \begin{align*} &= \lim_{h\to0} \frac{x+h-x}{h}\\ &= \lim_{h\to0} \frac{h}{h} = 1 &\text{as expected} \end{align*}
  • Assume \(x \lt 0\text{.}\) Then
    \begin{align*} \diff{f}{x} &= \lim_{h\to0} \frac{f(x+h)-f(x)}{h}\\ &= \lim_{h\to0} \frac{|x+h|-|x|}{h}\\ \\ \end{align*}

    Since \(x \lt 0\) and we are interested in the behaviour of this function as \(h \to 0\) we can assume \(h\) is much smaller than \(x\text{.}\) This means \(x+h \lt 0\) and so \(|x+h|=-(x+h)\text{.}\)

    \begin{align*} &= \lim_{h\to0} \frac{-(x+h)-(-x)}{h}\\ &= \lim_{h\to0} \frac{-h}{h} = -1 \end{align*}
  • When \(x=0\) we have
    \begin{align*} f'(0) &= \lim_{h\to0} \frac{f(0+h)-f(0)}{h}\\ &= \lim_{h\to0} \frac{|0+h|-|0|}{h}\\ &= \lim_{h\to0} \frac{|h|}{h} \end{align*}
    To proceed we need to know if \(h \gt 0\) or \(h \lt 0\text{,}\) so we must use one-sided limits. The limit from above is:
    \begin{align*} \lim_{h \to 0^+} \frac{|h|}{h} &= \lim_{h \to 0^+} \frac{h}{h} &\text{since } h \gt 0, |h|=h\\ &= 1\\ \end{align*}

    Whereas, the limit from below is:

    \begin{align*} \lim_{h \to 0^-} \frac{|h|}{h} &= \lim_{h \to 0^-} \frac{-h}{h} &\text{since } h \lt 0, |h|= -h\\ &= -1 \end{align*}
    Since the one-sided limits differ, the limit as \(h\to 0\) does not exist. And thus the derivative does not exist as \(x=0\text{.}\)
In summary:
\begin{align*} \diff{}{x} |x| &= \begin{cases} -1 & \text{if } x \lt 0 \\ DNE & \text{if } x=0 \\ 1 & \text{if } x \gt 0 \end{cases} \end{align*}

Subsection 2.2.3 Where is the Derivative Undefined?

According to Definition 2.2.1, the derivative \(f'(a)\) exists precisely when the limit \(\lim\limits_{x\rightarrow a} \frac{f(x)-f(a)}{x-a}\) exists. That limit is also the slope of the tangent line to the curve \(y=f(x)\) at \(x=a\text{.}\) That limit does not exist when the curve \(y=f(x)\) does not have a tangent line at \(x=a\) or when the curve does have a tangent line, but the tangent line has infinite slope. We have already seen some examples of this.
  • In Example 2.2.7, we considered the function \(f(x)=\frac{1}{x}\text{.}\) This function “blows up” (i.e. becomes infinite) at \(x=0\text{.}\) It does not have a tangent line at \(x=0\) and its derivative does not exist at \(x=0\text{.}\)
  • In Example 2.2.10, we considered the function \(f(x)=|x|\text{.}\) This function does not have a tangent line at \(x=0\text{,}\) because there is a sharp corner in the graph of \(y=|x|\) at \(x=0\text{.}\) (Look at the graph in Example 2.2.10.) So the derivative of \(f(x)=|x|\) does not exist at \(x=0\text{.}\)
Here are a few more examples.

Example 2.2.11. Derivative at a discontinuity.

Visually, the function
\(H(x) = \begin{cases} 0 & \text{if }x \le 0 \\ 1 & \text{if }x \gt 0 \end{cases}\)
does not have a tangent line at \((0,0)\text{.}\) Not surprisingly, when \(a=0\) and \(h\) tends to \(0\) with \(h \gt 0\text{,}\)
\begin{gather*} \frac{H(a+h)-H(a)}{h} =\frac{H(h)-H(0)}{h} =\frac{1}{h} \end{gather*}
blows up. The same sort of computation shows that \(f'(a)\) cannot possibly exist whenever the function \(f\) is not continuous at \(a\text{.}\) We will formalize, and prove, this statement in Theorem 2.2.14, below.

Example 2.2.12. \(\diff{}{x}x^{1/3}\).

Visually, it looks like the function \(f(x) = x^{1/3}\text{,}\) sketched below, (this might be a good point to recall that cube roots of negative numbers are negative — for example, since \((-1)^3=-1\text{,}\) the cube root of \(-1\) is \(-1\)),
has the \(y\)–axis as its tangent line at \((0,0)\text{.}\) So we would expect that \(f'(0)\) does not exist. Let’s check. With \(a=0\text{,}\)
\begin{align*} f'(a)\amp= \lim_{h\rightarrow 0}\frac{f(a+h)-f(a)}{h} =\lim_{h\rightarrow 0}\frac{f(h)-f(0)}{h} =\lim_{h\rightarrow 0}\frac{h^{1/3}}{h}\\ \amp=\lim_{h\rightarrow 0}\frac{1}{h^{2/3}} =DNE \end{align*}
as expected.

Example 2.2.13. \(\diff{}{x}\sqrt{|x|}\).

We have already considered the derivative of the function \(\sqrt{x}\) in Example 2.2.9. We’ll now look at the function \(f(x) = \sqrt{|x|}\text{.}\) Recall, from Example 2.2.10, the definition of \(|x|\text{.}\)
When \(x \gt 0\text{,}\) we have \(|x|=x\) and \(f(x)\) is identical to \(\sqrt{x}\text{.}\) When \(x \lt 0\text{,}\) we have \(|x|=-x\) and \(f(x)=\sqrt{-x}\text{.}\) So to graph \(y=\sqrt{|x|}\) when \(x \lt 0\text{,}\) you just have to graph \(y=\sqrt{x}\) for \(x \gt 0\) and then send \(x\rightarrow -x\) — i.e. reflect the graph in the \(y\)–axis. Here is the graph.
The pointy thing at the origin is called a cusp. The graph of \(y=f(x)\) does not have a tangent line at \((0,0)\) and, correspondingly, \(f'(0)\) does not exist because
\begin{gather*} \lim_{h\rightarrow 0^+}\frac{f(h)-f(0)}{h} =\lim_{h\rightarrow 0^+}\frac{\sqrt{|h|}}{h} =\lim_{h\rightarrow 0^+}\frac{1}{\sqrt{h}} =DNE \end{gather*}

Proof.

The function \(f(x)\) is continuous at \(x=a\) if and only if the limit of
\begin{gather*} f(a+h) - f(a) = \frac{f(a+h)-f(a)}{h}\ h \end{gather*}
as \(h\rightarrow 0\) exists and is zero. But if \(f(x)\) is differentiable at \(x=a\text{,}\) then, as \(h\rightarrow 0\text{,}\) the first factor, \(\frac{f(a+h)-f(a)}{h}\) converges to \(f'(a)\) and the second factor, \(h\text{,}\) converges to zero. So the product provision of our arithmetic of limits Theorem 1.4.3 implies that the product \(\frac{f(a+h)-f(a)}{h}\ h\) converges to \(f'(a)\cdot 0=0\) too.
Notice that while this theorem is useful as stated, it is (arguably) more often applied in its contrapositive
 7 
If you have forgotten what the contrapositive is, then quickly reread Footnote 1.3.5 in Section 1.3.
form:
As the above examples illustrate, this statement does not tell us what happens if \(f\) is continuous at \(x=a\) — we have to think!

Exercises 2.2.4 Exercises

Exercises — Stage 1 .

1.
The function \(f(x)\) is shown. Select all options below that describe its derivative, \(\ds\diff{f}{x}\text{:}\)
  • (a) constant
  • (b) increasing
  • (c) decreasing
  • (d) always positive
  • (e) always negative
2.
The function \(f(x)\) is shown. Select all options below that describe its derivative, \(\ds\diff{f}{x}\text{:}\)
  • (a) constant
  • (b) increasing
  • (c) decreasing
  • (d) always positive
  • (e) always negative
3.
The function \(f(x)\) is shown. Select all options below that describe its derivative, \(\ds\diff{f}{x}\text{:}\)
  • (a) constant
  • (b) increasing
  • (c) decreasing
  • (d) always positive
  • (e) always negative
4. (✳).
State, in terms of a limit, what it means for \(f(x) = x^3\) to be differentiable at \(x = 0\text{.}\)
5.
For which values of \(x\) does \(f'(x)\) not exist?
6.
Suppose \(f(x)\) is a function defined at \(x=a\) with
\begin{equation*} \lim_{h \to 0^-}\frac{f(a+h)-f(a)}{h}=\lim_{h \to 0^+}\frac{f(a+h)-f(a)}{h}=1. \end{equation*}
True or false: \(f'(a)=1\text{.}\)
7.
Suppose \(f(x)\) is a function defined at \(x=a\) with
\begin{equation*} \lim_{x \to a^-}f'(x)=\lim_{x \to a^+}f'(x)=1. \end{equation*}
True or false: \(f'(a)=1\text{.}\)
8.
Suppose \(s(t)\) is a function, with \(t\) measured in seconds, and \(s\) measured in metres. What are the units of \(s'(t)\text{?}\)

Exercises — Stage 2 .

9.
Use the definition of the derivative to find the equation of the tangent line to the curve \(y(x)=x^3+5\) at the point \((1,6)\text{.}\)
10.
Use the definition of the derivative to find the derivative of \(f(x)=\frac{1}{x}\text{.}\)
11. (✳).
Let \(f(x) = x|x|\text{.}\) Using the definition of the derivative, show that \(f(x)\) is differentiable at \(x = 0\text{.}\)
12. (✳).
Use the definition of the derivative to compute the derivative of the function \(f(x)=\frac{2}{x+1}\text{.}\)
13. (✳).
Use the definition of the derivative to compute the derivative of the function \(f(x)=\frac{1}{x^2+3}\text{.}\)
14.
Use the definition of the derivative to find the slope of the tangent line to the curve \(f(x)=x\log_{10}(2x+10)\) at the point \(x=0\text{.}\)
15. (✳).
Compute the derivative of \(f(x)=\frac{1}{x^2}\) directly from the definition.
16. (✳).
Find the values of the constants \(a\) and \(b\) for which
\begin{align*} f(x) = \left\{ \begin{array}{lc} x^2 & x\le 2\\ ax + b & x \gt 2 \end{array}\right. \end{align*}
is differentiable everywhere.
Remark: In the text, you have already learned the derivatives of \(x^2\) and \(ax+b\text{.}\) In this question, you are only asked to find the values of \(a\) and \(b\)—not to justify how you got them—so you don’t have to use the definition of the derivative. However, on an exam, you might be asked to justify your answer, in which case you would show how to differentiate the two branches of \(f(x)\) using the definition of a derivative.
17. (✳).
Use the definition of the derivative to compute \(f'(x)\) if \(f(x) = \sqrt{1 + x}\text{.}\) Where does \(f'(x)\) exist?

Exercises — Stage 3 .

18.
Use the definition of the derivative to find the velocity of an object whose position is given by the function \(s(t)=t^4-t^2\text{.}\)
19. (✳).
Determine whether the derivative of following function exists at \(x=0\text{.}\)
\begin{align*} f(x) &=\begin{cases} x \cos x & \text{ if } x\ge 0\\ \sqrt{x^2+x^4} & \text{ if } x \lt 0 \end{cases} \end{align*}
You must justify your answer using the definition of a derivative.
20. (✳).
Determine whether the derivative of the following function exists at \(x=0\)
\begin{align*} f(x) &=\begin{cases} x \cos x & \text{ if } x\le 0\\ \sqrt{1+x}-1 & \text{ if } x \gt 0 \end{cases} \end{align*}
You must justify your answer using the definition of a derivative.
21. (✳).
Determine whether the derivative of the following function exists at \(x=0\)
\begin{align*} f(x) &=\begin{cases} x^3-7x^2 & \text{ if } x\le 0\\ x^3 \cos\left(\frac{1}{x}\right) & \text{ if } x \gt 0 \end{cases} \end{align*}
You must justify your answer using the definition of a derivative.
22. (✳).
Determine whether the derivative of the following function exists at \(x=1\)
\begin{align*} f(x) &=\begin{cases} 4x^2-8x+4 & \text{ if } x\le 1\\ (x-1)^2\sin\left(\dfrac{1}{x-1}\right) & \text{ if } x \gt 1 \end{cases} \end{align*}
You must justify your answer using the definition of a derivative.
23.
Sketch a function \(f(x)\) with \(f'(0)=-1\) that takes the following values:
\(\mathbf{x}\) \(-1\) \(-\frac{1^{ }}{2_{ }}\) \(-\frac{1}{4}\) \(-\frac{1}{8}\) \(0\) \(\frac{1}{8}\) \(\frac{1}{4}\) \(\frac{1}{2}\) \(1\)
\(\mathbf{f(x)}\) \(-1\) \(-\frac{1^{ }}{2_{ }}\) \(-\frac{1}{4}\) \(-\frac{1}{8}\) \(0\) \(\frac{1}{8}\) \(\frac{1}{4}\) \(\frac{1}{2}\) \(1\)
Remark: you can’t always guess the behaviour of a function from its points, even if the points seem to be making a clear pattern.
24.
Let \(p(x)=f(x)+g(x)\text{,}\) for some functions \(f\) and \(g\) whose derivatives exist. Use limit laws and the definition of a derivative to show that \(p'(x)=f'(x)+g'(x)\text{.}\)
Remark: this is called the sum rule, and we’ll learn more about it in Lemma 2.4.1.
25.
Let \(f(x)=2x\text{,}\) \(g(x)=x\text{,}\) and \(p(x)=f(x) \cdot g(x)\text{.}\)
  1. Find \(f'(x)\) and \(g'(x)\text{.}\)
  2. Find \(p'(x)\text{.}\)
  3. Is \(p'(x)=f'(x) \cdot g'(x)\text{?}\)
In Theorem 2.4.3, you’ll learn a rule for calculating the derivative of a product of two functions.
26. (✳).
There are two distinct straight lines that pass through the point \((1,-3)\) and are tangent to the curve \(y = x^2\text{.}\) Find equations for these two lines.
Remark: the point \((1,-3)\) does not lie on the curve \(y=x^2\text{.}\)
27. (✳).
For which values of \(a\) is the function
\begin{equation*} f(x) =\left\{\begin{array}{ll} 0 & x\le 0\\ x^a \sin\frac{1}{x} & x \gt 0\end{array}\right. \end{equation*}
differentiable at 0?