The derivative as a function
In the derivative at a point, we found $f'(a)$ for one number $a$ at a time. Now we let the number change. We replace $a$ by the variable $x$. The result is a new function, $f'$, called the derivative of $f$.
Definition
The derivative of a function $f$ is the function $f'$ defined by
$f'(x)=\displaystyle\lim_{h\to 0}\dfrac{f(x+h)-f(x)}{h}$.
The domain of $f'$ is the set of all $x$ where this limit exists. For each $x$, $f'(x)$ is the slope of the tangent line to the graph of $f$ at that point.
Finding the derivative is called differentiating the function. The steps are the same as before, but we keep $x$ as a variable.
Example 1: Find $f'(x)$ for $f(x)=x^2$.
Solution:
Use the definition of the derivative:
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{(x+h)^2-x^2}{h}\end{align*}$
Expand $(x+h)^2=x^2+2xh+h^2$. The $x^2$ terms cancel:
$\begin{align*}&=\lim_{h\to 0}\dfrac{2xh+h^2}{h}\end{align*}$
Cancel the common factor $h$:
$\begin{align*}&=\lim_{h\to 0}(2x+h)\end{align*}$
Let $h$ approach $0$:
$\begin{align*}&f'(x)=2x\end{align*}$
So the derivative of $x^2$ is $2x$. For example, $f'(1)=2$. This is the slope we found on the tangent line page.
Example 2: Find $f'(x)$ for
$f(x)=x^3-x$.
Solution:
Use the definition of the derivative:
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{f(x+h)-f(x)}{h}\end{align*}$
Work out the numerator. The $x$ terms cancel:
$\begin{align*}&f(x+h)-f(x)\\&=(x+h)^3-(x+h)-(x^3-x)\\&=(x+h)^3-x^3-h\end{align*}$
So
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{(x+h)^3-x^3-h}{h}\end{align*}$
Expand
$(x+h)^3=x^3+3x^2h+3xh^2+h^3$.
The $x^3$ terms cancel:
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{3x^2h+3xh^2+h^3-h}{h}\end{align*}$
Every term in the numerator has a factor $h$. Cancel it:
$\begin{align*}&=\lim_{h\to 0}(3x^2+3xh+h^2-1)\end{align*}$
Let $h$ approach $0$:
$\begin{align*}&f'(x)=3x^2-1\end{align*}$
Example 3: Find $f'(x)$ for $f(x)=\sqrt{x}$. What is the domain of $f'$?
Solution:
Use the definition of the derivative:
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{\sqrt{x+h}-\sqrt{x}}{h}\end{align*}$
Direct substitution gives $0/0$. So multiply the numerator and the denominator by the conjugate, $\sqrt{x+h}+\sqrt{x}$. In the numerator, use
$(a-b)(a+b)=a^2-b^2$.
This gives
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{(\sqrt{x+h})^2-(\sqrt{x})^2}{h(\sqrt{x+h}+\sqrt{x})}\end{align*}$
Simplify the numerator:
$\begin{align*}&=\lim_{h\to 0}\dfrac{(x+h)-x}{h(\sqrt{x+h}+\sqrt{x})}\\&=\lim_{h\to 0}\dfrac{h}{h(\sqrt{x+h}+\sqrt{x})}\end{align*}$
Cancel the common factor $h$:
$\begin{align*}&=\lim_{h\to 0}\dfrac{1}{\sqrt{x+h}+\sqrt{x}}\end{align*}$
Let $h$ approach $0$:
$\begin{align*}&f'(x)=\dfrac{1}{2\sqrt{x}}\end{align*}$
The function $f$ is defined for $x\ge 0$. But $f'(x)$ is defined only for $x>0$, because the denominator $2\sqrt{x}$ is $0$ when $x=0$. So the domain of $f'$ is $(0,\infty)$.
Check:
$f'(4)=\dfrac{1}{2\cdot 2}=\dfrac{1}{4}$
$f'(9)=\dfrac{1}{2\cdot 3}=\dfrac{1}{6}$
These match the earlier examples.
Example 4: Find $f'(x)$ for $f(x)=\dfrac{1}{x}$.
Solution:
Use the definition of the derivative:
$\begin{align*}&f'(x)\\&=\lim_{h\to 0}\dfrac{\dfrac{1}{x+h}-\dfrac{1}{x}}{h}\end{align*}$
Combine the two fractions in the numerator, using the common denominator $x(x+h)$:
$\begin{align*}&=\lim_{h\to 0}\dfrac{\dfrac{x-(x+h)}{x(x+h)}}{h}\end{align*}$
Simplify the numerator. Dividing by $h$ puts $h$ in the denominator:
$\begin{align*}&=\lim_{h\to 0}\dfrac{-h}{hx(x+h)}\end{align*}$
Cancel the common factor $h$:
$\begin{align*}&=\lim_{h\to 0}\dfrac{-1}{x(x+h)}\end{align*}$
Let $h$ approach $0$:
$\begin{align*}&f'(x)=-\dfrac{1}{x^2}\end{align*}$
This is defined for every $x\neq 0$.
Notation
If $y=f(x)$, the derivative can be written in several ways:
$f'(x)=y'=\dfrac{dy}{dx}=\dfrac{d}{dx}f(x)$
Prime notation: $f'(x)$ is read "$f$ prime of $x$," and $y'$ is read "$y$ prime."
Leibniz notation: The derivative is written
$\dfrac{dy}{dx}$
and read "dee $y$ dee $x$." It comes from the ratio $\Delta y/\Delta x$. The derivative is the limit of this ratio:
$\dfrac{dy}{dx}=\displaystyle\lim_{\Delta x\to 0}\dfrac{\Delta y}{\Delta x}$
The symbol $d/dx$ means "the derivative with respect to $x$ of." For example,
$\dfrac{d}{dx}(x^2)=2x$.
The value at a point: To write the value of the derivative at $x=a$ in Leibniz notation, we write
$\left.\dfrac{dy}{dx}\right|_{x=a}$.
For example, if $y=x^2$, then
$\left.\dfrac{dy}{dx}\right|_{x=3}=2(3)=6$.
The graphs of f and f′
The value of $f'(x)$ is the slope of the graph of $f$ at $x$. So the graph of $f$ tells us about $f'$:
- Where the graph of $f$ is rising (going up from left to right), the slope is positive. So $f'(x)>0$.
- Where the graph of $f$ is falling, the slope is negative. So $f'(x)<0$.
- Where the tangent line is horizontal, the slope is $0$. So $f'(x)=0$.
Example 5: The graph of $f(x)=x^3-3x$ is shown. Describe the graph of $f'$.
Solution:
- For $x<-1$, the graph of $f$ is rising. So $f'(x)>0$.
- At $x=-1$ and at $x=1$, the tangent line is horizontal. So $f'(-1)=0$ and $f'(1)=0$.
- For $-1<x<1$, the graph of $f$ is falling. So $f'(x)<0$.
- For $x>1$, the graph of $f$ is rising again. So $f'(x)>0$.
The exact derivative is $f'(x)=3x^2-3$. (You can check this with the limit, as in Example 2.) Its graph matches the description:
Where a function is not differentiable
A function is not differentiable at $x=a$ when the limit $f'(a)$ does not exist. On a graph, this happens in three common ways:
- A corner (figure a): The slopes from the left and from the right are different. So there is no single tangent line. We showed this for $y=|x|$ in the derivative at a point (Example 7).
- A discontinuity (figure b): If the graph has a break at $a$, there is no tangent line there.
- A vertical tangent (figure c): The tangent line is vertical. A vertical line has no slope, so $f'(a)$ does not exist.
Example 6: Show that $f(x)=\sqrt[3]{x}$ is not differentiable at $x=0$.
Solution:
Here $f(0)=0$. Write $\sqrt[3]{h}=h^{1/3}$. Then the difference quotient is
$\begin{align*}&\dfrac{f(0+h)-f(0)}{h}\\&=\dfrac{h^{1/3}}{h}\\&=\dfrac{1}{h^{2/3}}\end{align*}$
As $h\to 0$, the denominator $h^{2/3}$ is positive and approaches $0$. So
$\displaystyle\lim_{h\to 0}\dfrac{1}{h^{2/3}}=\infty$.
The limit is not a finite number, so $f'(0)$ does not exist. The slope becomes larger and larger: the graph has a vertical tangent at $x=0$ (figure c).
Differentiable functions are continuous
Theorem: If $f$ is differentiable at $a$, then $f$ is continuous at $a$.
Why it is true: For $h\neq 0$, we can write
$f(a+h)-f(a)=\dfrac{f(a+h)-f(a)}{h}\cdot h$.
As $h\to 0$, the fraction approaches $f'(a)$, and $h$ approaches $0$. So, by the product law,
$\displaystyle\lim_{h\to 0}[f(a+h)-f(a)]=f'(a)\cdot 0=0$.
This means $\displaystyle\lim_{h\to 0}f(a+h)=f(a)$, which says that $f$ is continuous at $a$.
The opposite is not true. A continuous function does not have to be differentiable. For example, $f(x)=|x|$ is continuous at $0$, but it is not differentiable there (it has a corner).
In short:
- Differentiable at $a$ $\Rightarrow$ continuous at $a$.
- Continuous at $a$ does not guarantee differentiable at $a$.
The symbol $\Rightarrow$ means "implies."