Table of Contents

Tangent Lines at Points
Consider a curve represented by the function $f$, and suppose that we want to find the slope of a line tangent to the point $P(a, f(a))$. To calculate this slope, suppose we take the point $Q(x, f(x))$. We can easily create a secant line from $P$ to $Q$ from which we use basic algebra to calculate that $m = \frac{f(x)  f(a)}{x  a}$.
Notice that this is the slope of the secant line between $P$ and $Q$, but we want to find the slope of the tangent line at $P$. Notice that as $Q$ gets closer and closer to the point $P$, the secant line between $P$ and $Q$ gets closer to the tangent line at $P$:
Thus, we define the slope of the tangent line at $P$ to be:
(1)There is also another common form for the slope of a tangent line that is sometimes more useful. If we let $h = x  a$, it follows that $x = a + h$. Furthermore, as $x \to a$, $x  a = h \to 0$, and thus, we can rewrite the above formula as:
(2)Definition of the Derivative
With what we just learned about tangent lines at points, we can now finally define a derivative:
Definition: If $f$ is a function, then the Derivative of $f$ at a value $a$ denoted $f'(a) = \lim_{h \to 0} \frac{f(a + h)  f(a)}{h} = \lim_{x \to a} \frac{f(x)  f(a)}{x  a}$ is the slope of the tangent line to $f$ at the point $(a, f(a))$ provided that this limit exists. If this limit exists and is finite, then $f$ is said to be Differentiable at $a$. If this limit does not exist, then we say $f$ is Not Differentiable at $a$. 
We now have a definition of what a derivative is and how they can help us calculate the slope of a tangent line at a given point. Do note that derivatives can also be functions if we replace the value $a$ with the variable $x$, that is, $f'(x) = \lim_{h \to 0} \frac{f(x + h)  f(x)}{h}$. This will be important later.
Now figure out the equation of a tangent line, recall the pointslope form a line:
(3)We can modify this formula by letting $x_1 = a$, $y_1 = f(a)$ and $m = f'(a)$ and therefore, the equation of the tangent line that passes through $(a, f(a))$ and has the slope $f'(a)$ is given by the following equation:
(4)We will now look at an example applying the definition of the derivative.
Example 1
Calculate the slope of the tangent line at the point $(2, 4)$ of the function $f(x) = x^2$.
Applying the definition of the derivative, we get that:
(5)Therefore, the slope of the tangent line at the point $(2, 4)$ is $f'(2) = 4$.
Example 2
Calculate the slope of the tangent line at the point $(a, f(a))$ of the function $f(x) = x^3$.
Once again, we will apply the definition of the derivative to get that:
(6)Therefore, the slope of the tangent line at the point $(a, f(a))$ is $f'(a) = 3a^2$
Example 3
Calculate the equation of the tangent line at the point $(2, 8)$ of the function $f(x) = x^3$.
From example 2, we note that the slope of the tangent line at point $(a, f(a))$ is $f'(a) = 3a^2$. Applying this to what we're given in example 3, we see that $(a, f(a)) = (2, 8)$ and therefore, the slope of the tangent line at point $(2, 8)$ is $f'(2) = 3(2)^2 = 12$. We note that $a = 2$ and $f(a) = 8$, so applying this to the formula for the equation of a tangent line, we get:
(7)Thus, the equation of the tangent line at point $(2, 8)$ for the function $f(x) = x^3$ is $y = 12x  16$.