Skip to main content

Section 4.6 Linear Approximations

We’re going to return to a pretty central idea here, one that we’ve been using and developing and really exploring. But let’s think about the very basic version of what we’ve been looking at over this whole chapter (and more):
The derivative of a function tells us the slope of the line tangent to the function at a point.
But what we’ll do is explore how this tangent line and the graph of our function interact and relate to each other. Let’s start with just playing with a graph and seeing if we can discover some things to say about the relationship between a tangent line and the function it is lying tangent to!
The effect that we are seeing when we zoom in on a function is sometimes described as our function being locally linear. What do you think this means? Why is this a good description of what we’re looking at, and how these differentiable functions are constructed?
Would this effect be noticeable for every function, even ones that are not differentiable at some points?
Convince yourself that a function will not look locally linear at a point where the function is not differentiable. You might want to remind yourself what it looks like, graphically, when a derivative doesn’t exist: When Does a Derivative Not Exist?

Subsection Linearly Approximating a Function

The visual above should provide us with a nice framework to think about how we might approximate a function linearly, but we can recap some basic ideas:
  • When we say “linear approximation,” we’re really just referring to the tangent line at some point.
  • Our functions only look “locally linear” when we zoom in around some single point. Another way of saying this is that our tangent line only matches the behavior of our function really close to the point where we built the tangent line.
  • We have a kind of vague or ambiguous idea of accuracy in approximation. While a tangent line follows the behavior of the function “around” that point where it was built, the actual rate at which it deviates from our function is different. If we move the point in the visual above, we’ll see that at some locations, our function is pretty linear and doesn’t move away from the tangent line very quickly. In other locations, the function turns quickly away from the tangent line!

Definition 4.6.1. Linear Approximation of a Function.

If \(f(x)\) is differentiable at \(x=a\text{,}\) then we say that a linear approximation of \(f(x)\) centered at \(x=a\) is:
\begin{equation*} L(x) = f'(a)(x-a)+f(a)\text{.} \end{equation*}
We know, then, that \(L(x)\approx f(x)\) for \(x\)-values “close” to the center, \(x=a\text{.}\)
Note that the center is just the point at which we are building this linear approximation: the point at which we build the tangent line.
Let’s see this in action!

Activity 4.6.1. Approximating an Exponential Function.

Let’s consider the function \(f(x)=e^x\text{.}\) We’re going to build the linear approximation, \(L(x)\text{,}\) but we also want to focus on understanding what the “center” is, and how we think about accuracy of our estimations.
(a)
We first need to find a “good” center for our linear approximation. We have two real requirements here:
  1. We need the center to be some \(x\)-value that will be “close” to the inputs we’re most interested in. We know that \(L(x)\approx f(x)\) for \(x\)-values “near” the center, so we should keep this in mind. We don’t have a specific input that we’re interested in (we are not specifically focused on estimating \(f(7.35)\) for instance), so we don’t need to worry about this for now.
  2. We are going to need to evaluate the function and its derivative at the center: we use \(f'(a)\) to find the slope and \(f(a)\) to find a \(y\)-value for a point on the line. We’d like to choose a center that will make evaluating these functions reasonable, if we can!
We are going to choose a center of 0: why?
(b)
Build a linear approximation of \(f(x)=e^x\) centered at \(x=0\text{.}\)
Hint.
Build a line with a slope of \(f'(0)\) that goes through the point \((0, f(0))\text{.}\)
(c)
Use your linear approximation to estimate the value of \(\sqrt[10]{e} = e^{\frac{1}{10}}\text{.}\)
Hint.
Since \(L(x)\approx f(x)\) for \(x\)-values near 0, we can say that \(L(1/10)\approx f(1/10)\text{.}\) So you can evaluate your linear approximation function at \(x=\frac{1}{10}\text{.}\)
(d)
Let’s visualize this approximation a bit:
Are you confident in your approximation of \(\sqrt[10]{e}\text{?}\) Would you be more or less confident in an approximation of \(\frac{1}{e}\text{?}\) Why?
(e)
Is your estimate of \(\sqrt[10]{e}\) too big or too small? How can you tell, without even calculating the actual value of \(\sqrt[10]{e}\text{?}\)
How can you tell that every estimate that you get out of any linear approximation of \(e^x\) (no matter what the center is) is going to be too small?
Hint.
It might be helpful to think about how the function moves away from the tangent line: how do the slopes of \(e^x\) change? Can you link this to ideas of concavity?
In this activity, we did not have to think much about an appropriate choice of center. We tried to justify our choice, but that’s different than having to make a choice. Let’s approach this a bit differently in our next examples.

Activity 4.6.2. Approximating some Values.

Pick one of the following values to approximate:
Throughout the rest of this activity, use your value to build a linear approximation of some relevant function and estimate the value you chose.
(a)
To build a linear approximation of some function at some center, we need two things:
  1. A function.
  2. A center.
What function will you be using for \(f(x)\text{?}\) Why that one?
Hint.
Your value should look like the output of some function after you plug in some \(x\)-value. What function?
(b)
What center are you choosing? Why that one?
Hint.
Remember that we want some input for your function that is both close to the input you’d like to estimate your function at and also a reasonable one to know the value of your function and its derivative.
(c)
Build your linear approximation at your center! You should end up with an actual linear function. It might be helpful to plot this linear function and your actual function to confirm that you have actually built a tangent line.
(d)
Use your linear approximation function to estimate your value! Report the estimate, and comment on the accuracy of your estimate. Without calculating the actual value, can you tell if this is close or not? Do you have an overestimate or underestimate?
Hint.
Think about issues relating to the distance from the center, the concavity of the function, and even the rate at which the slopes change away as we move away from the center.
So far, we have been pretty limited in what we can actually do with these linear approximations. A function is only locally linear when we look at a very small interval of \(x\)-values. Once we move away from the center far enough (and it’s often not that far), then our function curves away from the tangent line and our linear approximation is not at all accurate.

Subsection Approximating Zeros of a Function

Let’s look at one really cool application of linear approximations before we finish things up in this section.
In approximately 60 AD, Heron of Alexandria presented a method for approximating square roots (probably...historians know very little about exactly when Heron was born and died, but they think he saw an eclipse that matched one from 62 AD, so it’s a good guess). This algorithm was presented along with different formulas for volumes and surface areas of a mixture of objects.
More than 1000 years later, in the late 1660’s, Isaac Newton was one of a long list of mathematicians to recreate this formula in a more general way, where we can use it to approximate roots of polynomials. This method was later extended by several different mathematicians, and is now known as the Newton-Raphson method, or sometimes more simply Newton’s method.

Activity 4.6.3. Walking in the Footsteps of Ancient Mathematicians.

Let’s travel all the way back to the first (or maybe second) century AD and re-create Heron’s method to approximate the value of \(\sqrt{2}\text{.}\) We’ll develop this using modern calculus, and simple linear approximation.
We’re going to reframe the problem, and instead we’re going to try to use a linear approximation of \(f(x)=x^2-2\) to approximate the \(x\)-value where \(f(x)=0\text{.}\) We know enough about quadratic functions to know that there are two values: \(x=-\sqrt{2}\) and \(x=\sqrt{2}\text{.}\)
(a)
We’re going to build a linear approximation of \(f(x) = x^2-2\text{,}\) and we need a reasonable center. Honestly, any integer will work, since we can evaluate \(f\) and \(f'\) really easily, but we want to find one that is close to \(\sqrt{2}\text{.}\) Let’s center our approximation at \(x=2\text{.}\)
Find \(f'(x)\text{,}\) and then construct the linear approximation:
\begin{equation*} L(x) = f'(2)(x-2)+f(2)\text{.} \end{equation*}
Solution.
Since \(f'(x)=2x\text{,}\) we have \(f'(2)=4\) and \(f(2) = 2\text{.}\) So then we end up with the following for our linear approximation:
\begin{equation*} L(x) = 4(x-2)+2\text{.} \end{equation*}
(b)
Now we know that \(L(x)\approx f(x)\) for \(x\)-values near our center, \(x=2\text{.}\) What if we estimate the \(x\)-value where \(f(x)=0\) by solving \(L(x)=0\) instead? Since \(L(x)\approx f(x)\text{,}\) the \(x\)-value where \(L(x)=0\) should make \(f(x)\) pretty close to 0 at least.
Solve \(L(x)=0\text{.}\)
Solution.
\begin{align*} 0 \amp = 4(x-2)+2\\ -2 \amp 4(x-2)\\ -\frac{2}{4} \amp x-2\\ 2 - \frac{1}{2} \amp x\\ x \amp = \frac{3}{2} \end{align*}
(c)
Ok, this might be kind of close to the value of \(\sqrt{2}\text{,}\) right? Let’s visualize this.
Hm...so this isn’t that good of an approximation yet. We can check this by looking at the actual value of our function at \(x=\frac{3}{2}\) and seeing if it’s close to 0.
\begin{align*} f\left(\frac{3}{2}\right) \amp = \left(\frac{3}{2}\right)^2 - 2\\ \amp = \frac{9}{4} - 2\\ \amp \frac{1}{4} \end{align*}
This...isn’t that close to 0.
So let’s try this again. This time, though, let’s center our new linear approximation at \(x=\frac{3}{2}\text{.}\)
Solution.
\begin{align*} L(x) \amp f'\left(\frac{3}{2}\right)\left(x-\frac{3}{2}\right)+f\left(\frac{3}{2}\right) \\ \amp = 3\left(x-\frac{3}{2}\right) + \frac{1}{4} \end{align*}
(d)
Now set this new linear approximation equal to 0 and solve \(L(x)=0\) to estimate the solution to \(f(x)=0\text{.}\)
Solution.
\begin{align*} 0 \amp = 3\left(x-\frac{3}{2}\right) + \frac{1}{4}\\ -\frac{1}{4} \amp = 3\left(x-\frac{3}{2}\right)\\ -\frac{1}{12} \amp = x- \frac{3}{2}\\ \frac{3}{2} - \frac{1}{12} \amp \\ x \amp= \frac{17}{12} \end{align*}
(e)
We can keep repeating this process, and that’s exactly what the mathematicians we talked about discovered.
Say we’ve built a linear approximation at some \(x\)-value (we’ll call it \(x_{\text{old}}\)).
\begin{equation*} L(x) = f'(x_{\text{old}})(x-x_{\text{old}}) + f(x_{\text{old}})\text{.} \end{equation*}
Set this equal to 0 and solve.
Solution.
\begin{align*} 0 \amp= f'(x_{\text{old}})(x-x_{\text{old}}) + f(x_{\text{old}}) \\ -f(x_{\text{old}}) \amp = f'(x_{\text{old}})(x-x_{\text{old}})\\ -\frac{f(x_{\text{old}})}{f'(x_{\text{old}})} \amp x-x_{\text{old}} \\ x \amp = x_{\text{old}} - \frac{f(x_{\text{old}})}{f'(x_{\text{old}})} \end{align*}
(f)
Let’s visualize these calculations.
Something kind of strange happens in the last two steps. Why does the value of our estimation not change? What happens to our estimate?

Definition 4.6.2. Newton’s Method for Approximating Zeros of Functions.

If \(x_0\) is some initial estimation of a solution to \(f(x)=0\text{,}\) then we can iteratively generate more estimations using the following formula
\begin{equation*} x_n = x_{n-1} - \frac{f(x_{n-1})}{f'(x_{n-1})} \end{equation*}
provided that \(f'(x_{n-1})\) exists and is non-zero.
A good question to ask is about when this process stops. If we want to estimate some \(x\)-intercept of a function, like \(\sqrt{2}\) in Activity 4.6.3, then how many steps is enough? There are a couple of ways we can approach this:
  1. We can just state at the beginning how many iterations we’re going to do. This is what happened in Activity 4.6.3, since this activity was written to only make you calculate a specific number of these estimations. We could have started by saying that we’ll calculate this 3 times, or maybe 100 times.
  2. We can test to see what \(f(x_n)\) is, and then stop when it is within some pre-determined distance from 0. We also did this when we noticed that \(f\left(\frac{3}{2}\right)=\frac{1}{4}\) was not very close to 0 (after our first estimation), and so we should calculate this again. We could start by saying that we’ll continue until we see a \(y\)-value that is within 0.0001 of 0, or some other small distance.
  3. We can test to see how close our approximations are to each other, and stop when they’re close enough. We saw this happen in the visualization: the last two estimates were the same! They actually weren’t, but since the applet only displayed 4 decimal places, the numbers appeared the same after rounding. Maybe we set some criteria there, or we look at the distance between \(x_n\) and \(x_{n-1}\) (two successive estimates) and stop when they are within some distance from each other.
In reality, we often choose a combination of these. Maybe we set distance threshold for stopping, but use a maximum of 10 iterations as a backup plan. This happens often when we code this algorithm and have a computer run it. It is possible for this code to never give us two successive estimates that are close enough to stop, and so the code would run forever unless we cut it off at 100 iterations or some other value.
A wonderful thing about this small process is that, while it is ancient (dating back to Heron in the first or second century), it is still used today. This is a powerful estimation method that can be used in a variety of areas including statistics and data science.

Practice Problems Practice Problems

1.

What is the formula for the Linear Approximation of a function \(f(x)\) centered at some \(x\)-value \(x=a\text{?}\) Explain what this is.

2.

or some function \(f(x)\) that is differentiable everywhere, how could we use the concepts of linear approximation to find an approximate value \(f(0.0001)\text{?}\)

3.

Let’s say that we have a function \(f(x)\) that is differentiable at \(x=5\) and a Linear Approximation \(L(x) = f'(5)(x-5)+f(5)\text{.}\) Give examples of two different \(x\)-values where \(L(x)\) does a good job of approximating \(f(x)\) accurately, and two examples of \(x\)-values where \(L(x)\) does not do a good job of approximating \(f(x)\) accurately.

4.

For each of the following functions and centers, build a Linear Approximation function.
(a)
\(f(x) = \sqrt{x}\) centered at \(x=4\)
(b)
\(f(x) = \sin{x}\) centered at \(x=0\)
(c)
\(f(x) = \cos{x}\) centered at \(x=0\)
(d)
\(f(x) = \ln{x}\) centered at \(x=1\)
(e)
\(f(x) = \sqrt[3]{x}\) centered at \(x=8\)
(f)
\(f(x) = \dfrac{1}{x}\) centered at \(x=4\)

5.

Use the linear approximating functions you created above to estimate the following values. Comment on the accuracy of these approximations.

6.

Approximate each of the following values using a Linear Approximation. For each one:
  • Report the function \(f(x)\) and center.
  • Write out the Linear Approximation function \(L(x)\text{.}\)
  • Approximate the value.
  • Justify whether your approximation is an over-approximation or under-approximation without referring to the actual value.

7.

Explain how Newton’s method uses Linear Approximation to approximate the \(x\)-intercept of a function.

8.

Explain how we cam use Newton’s method to approximate:
(a)
the intersection point of two functions.
(b)
local maximums or minimums of a function.
(c)
inflection points of a function.

9.

Use Newton’s method to find a zero for each function using the initial value given. Stop approximating when you get successive approximations that are within \(0.001\) of each other.
(a)
\(f(x) = x^3-5\) with \(x_0 = 2\)
(b)
\(f(x) = x\cos(x)\) with \(x_0 = 2\)

10.

Use Newton’s method to find an intersection point between the two curves. Stop approximating when you get successive approximations that are within \(0.001\) of each other. Feel free to use a graphing utility like desmos.com to graph the curves and pick a reasonable stating value.
(a)
\(y=x^2\) and \(y=\sin(x)\) (Note: these curves intersect at \(x=0\text{.}\) Find the second intersection point.)
(b)
\(y = e^x\) and \(y = \sqrt{x}+2\)

11.

Find/approximate the absolute maximum and absolute minimum of \(y=x\sin(x)\) on \([0,6]\) using Newton’s method (and any other techniques or concepts we’ve used).

12.

Find/approximate the inflection point of \(y=\dfrac{x^3}{10} + e^x\) using Newton’s method (and any other techniques or concepts we’ve used).