Calculating Derivatives Calculating Derivatives

Introduction

A derivative of a function is calculated by finding its rate of change at each point.

Below, we are finding the derivative of the function at the white dot.

The two yellow dots represent the points on the line we are using to calculate the slope. Recall the slope function is

m=\frac{f(x)_2 - f(x)_1}{x_2 - x_1}
. The left dot is
(x_1, f(x)_1)
and the right dot is
(x_2, f(x)_2)
.
The teal side is
x_2 - x_1
.
The magenta side is
f(x)_2 - f(x)_1
.
The yellow side has a slope of
m
.
The white line is identical to the yellow side, but moved up to be on top of the dot.
As the two dots approach the white dot, the slope of the line between them approaches the true slope of the function at that point.

Does that sound familiar? It should. It is a limit.

The derivative of a line is calculated by finding the limit of the slope function as the two dots approach the point we are finding the slope for.

Creating the Derivative Function

We will convert the statement above into a limit we can solve by defining the two dots using a step-value,

h
.

A step value is the distance of each dot from the point. The left dot is
(x-h, f(x-h))
and the right dot is
(x+h, f(x+h))
.

In the graph above, the distance of the cursor (horizontally) from the point controlled the step-value.

Let's rewrite the slope function using this new notation.
m=\frac{f(x+h) - f(x-h)}{(x+h) - (x-h)}

m=\frac{f(x+h) - f(x-h)}{2h}


In order to find the true slope, we just need to find the limit of this function as
h
approaches
0
.
(Note that
h
can be negative. A negative
h
causes the two dots to switch places.)

m=\lim_{h \to 0}\frac{f(x+h) - f(x-h)}{2h}

Calculating Derivatives

We can now find derivatives for different functions

f
and values
x
.

For example, for
f(x)=x^2, x=1
, the derivative function is
\begin{align*} m&=\lim_{h \to 0}\frac{f(x+h) - f(x-h)}{2h} \\ &=\lim_{h \to 0}\frac{\c1{(x+h)^2} - \c1{(x-h)^2}}{2h} \\ &=\lim_{h \to 0}\frac{\c1{x^2 + 2xh + h^2} - \c1{(x^2 - 2xh + h^2)}}{2h} \\ &=\lim_{h \to 0}\frac{x^2 + 2xh + h^2 \c1{- x^2 + 2xh - h^2}}{2h} \\ &=\lim_{h \to 0}\frac{4xh}{2h} \\ &=\lim_{h \to 0}2x\frac{h}{h} \\ &=\lim_{h \to 0}2x \\ \text{Since } x=1, m&=\lim_{h \to 0}2 \\ m&=2 \end{align*}
Note that the function we derived,
m=\lim_{h \to 0}2x
, is the derivative of
f(x)=x^2
for any point on the line. We can see that below.

f'(x)
is the derivative of
f(x)
.

f(x)=x^2

f'(x)=2x
Here are some more proofs of other functions we have seen in previous lessons.

f(x)=\sin(x)

f'(x)=\cos(x)
\begin{align*} m&=\lim_{h \to 0}\frac{f(x+h) - f(x-h)}{2h} \\\\ &=\lim_{h \to 0}\frac{\c1{\sin(x+h)} - \c1{\sin(x-h)}}{2h} \\\\ \text{We will now use a}& \text{ trig identity to combine the two terms:} \\\\ \sin(a+b) &= \sin(a)\cos(b) + \cos(a)\sin(b) \\\\ m&=\lim_{h \to 0}\frac{(\c1{\sin(x)\cos(h) + \cos(x)\sin(h))} - \c1{(\sin(x)\cos(-h) + \cos(x)\sin(-h))}}{2h} \\\\ \text{Note } \cos(-x)&=\cos(x) \text{ and } \sin(-x) = -\sin(x)\\\\ m&=\lim_{h \to 0}\frac{(\sin(x)\cos(h) + \cos(x)\sin(h)) - (\sin(x)\c1{\cos(h) -} \cos(x)\c1{\sin(h)})}{2h} \\\\ &=\lim_{h \to 0}\frac{\sin(x)\cos(h) + \cos(x)\sin(h) \c1{-} \sin(x)\cos(h) \c1{+} \cos(x)\sin(h)}{2h} \\\\ &=\lim_{h \to 0}\frac{2\cos(x)\sin(h)}{2h} \\\\ &=\lim_{h \to 0}\frac{\cos(x)\sin(h)}{h} \\\\ &=\c1{\cos(x)} \lim_{h \to 0}\frac{\sin(h)}{h} \\\\ \text{The} &\text{ graph below, }\frac{\sin(h)}{h} \text{, shows } \lim_{h \to 0}\frac{\sin(h)}{h}=1 \\\\ \text{Thus, }m&=\cos(x) \end{align*}
Here is the graph of
f(h)=\frac{\sin(h)}{h}
. In a future lesson, we will prove
\lim_{h \to 0}\frac{\sin(h)}{h}=1
.
f(x)=e^x

f'(x)=e^x
\begin{align*} m&=\lim_{h \to 0}\frac{f(x+h) - f(x-h)}{2h} \\\\ &=\lim_{h \to 0}\frac{e^{x+h} - e^{x-h}}{2h} \\\\ &=\lim_{h \to 0}\frac{e^{x}e^{h} - e^{x}e^{-h}}{2h} \\\\ &=\lim_{h \to 0}\frac{e^{x}(e^{h} - e^{-h})}{2h} \\\\ &=e^{x}\lim_{h \to 0}\frac{(e^{h} - e^{-h})}{2h} \\\\ \text{Below, I will } &\text{include a graph of }\frac{(e^{h} - e^{-h})}{2h} \text{ to show } \lim_{h \to 0}\frac{(e^{h} - e^{-h})}{2h}=1 \\\\ \text{Thus, }m&=e^x \end{align*}
Here is the graph,
f(h)=\frac{(e^{h} - e^{-h})}{2h}
. We rely on these graphs of
f(h)
because our current ability to prove limits is weak. However, in the future we will be able to prove these limits.