### Subsection2.3.2Slope

Suppose that $y=f(x)$ is the equation of a curve in the $xy$–plane. That is, $f(x)$ is the $y$–coordinate of the point on the curve whose $x$–coordinate is $x\text{.}$ Then, as we have already seen,

\begin{gather*} \big[\text{the slope of the secant through $\big(a,f(a)\big)$ and $\big(a+h,f(a+h)\big)$}\big] =\frac{f(a+h)-f(a)}{h} \end{gather*}

This is shown in Figure 2.3.2 below.

In order to create the tangent line (as we have done a few times now) we squeeze $h \to 0\text{.}$ As we do this, the secant through $\big(a,f(a)\big)$ and $\big(a+h,f(a+h)\big)$ approaches  3 We are of course assuming that the curve is smooth enough to have a tangent line at $a\text{.}$ the tangent line to $y=f(x)$ at $x=a\text{.}$ Since the secant becomes the tangent line in this limit, the slope of the secant becomes the slope of the tangent and

\begin{align*} \big[\text{the slope of the tangent line to $\;y=f(x)$ at $x=a$}\big] &=\lim_{h\rightarrow 0}\frac{f(a+h)-f(a)}{h}\\ &=f'(a). \end{align*}

Let us go a little further and work out a general formula for the equation of the tangent line to $y=f(x)$ at $x=a\text{.}$ We know that the tangent line

• has slope $f'(a)$ and
• passes through the point $\big(a, f(a)\big)\text{.}$

There are a couple of different ways to construct the equation of the tangent line from this information. One is to observe, as in Figure 2.3.3, that if $(x,y)$ is any other point on the tangent line then the line segment from $\big(a,f(a)\big)$ to $(x,y)$ is part of the tangent line and so also has slope $f'(a)\text{.}$ That is,

\begin{gather*} \frac{y- f(a)}{x-a} =\big[\text{the slope of the tangent line}\big] =f'(a) \end{gather*}

Cross multiplying gives us the equation of the tangent line:

A second way to derive the same equation of the same tangent line is to recall that the general equation for a line, with finite slope, is $y=mx+b\text{,}$ where $m$ is the slope and $b$ is the $y$-intercept. We already know the slope — so $m=f'(a)\text{.}$ To work out $b$ we use the other piece of information — $(a,f(a))$ is on the line. So $(x,y)=(a,f(a))$ must solve $y=f'(a)\,x+b\text{.}$ That is,

\begin{align*} f(a) &= f'(a) \cdot a + b & \text{and so } && b&=f(a)- af'(a) \end{align*}

Hence our equation is, once again,

\begin{align*} y &= f'(a) \cdot x + \left(f(a)-af'(a) \right) && \text{or, after rearranging a little,}\\ y &= f(a) + f'(a) \, (x-a) \end{align*}

This is a very useful formula, so perhaps we should make it a theorem.

The caveat at the end of the above theorem is necessary — there are certainly cases in which the derivative does not exist and so we do need to be careful.

Find the tangent line to the curve $y=\sqrt{x}$ at $x=4\text{.}$

Rather than redoing everything from scratch, we can, and for efficiency, should, use Theorem 2.3.4. To write this up properly, we must ensure that we tell the reader what we are doing. So something like the following:

• By Theorem 2.3.4, the tangent line to the curve $y=f(x)$ at $x=a$ is given by
\begin{align*} y &= f(a) + f'(a) (x-a) \end{align*}
provided $f'(a)$ exists.
• In Example 2.2.9, we found that, for any $a \gt 0\text{,}$ the derivative of $\sqrt{x}$ at $x=a$ is
\begin{align*} f'(a) &= \frac{1}{2\sqrt{a}} \end{align*}
• In the current example, $a=4$ and we have
• So the equation of the tangent line to $y=\sqrt{x}$ at $x=4$ is