# Linear Approximation

## An Intuitive Overview

Let’s say we want to know the value of a function at an inconvenient point that’s not easy to calculate. We’re stuck unless we can find the value of the function—and its derivative—at a nearby point.

We can then use a line, a tangent line, to represent the function near the known point. This is called a “linear approximation.” As you can see in the next illustration, the tangent line is a pretty close match with the curve near the known point.

We can find the slope of the tangent line by finding the derivative of the function at the known point. The slope at a point is a single number, and by definition the derivative at any given point IS the slope at that point. Once we know the slope, we can calculate the line’s value at our unknown point.

Our approximation is a reasoned guess. It usually won’t be exact, but it’s often close enough to be useful. To summarize, linear approximation allows us estimate a function in a region around a known point. It follows a 3-step process:

1. Find the value of the function at a known point
2. Find the equation for the tangent line at that known point
3. Calculate the value of the tangent line at the nearby unknown point and use that value as the rough value of the function.
4. ### Try it yourself:Drag the point of approximation (yellow dot) and see how the linear approximation of $$f(x) = \cos(x)$$ changes.

Next let’s look at the math behind linear approximations so we can try it out ourselves.

## Mathematical Derivation

Let's first introduce some terminology:

TermDescription
$$f(x)$$The function we want to approximate
$$a$$The $$x$$-coordinate of the known point
$$f(a)$$The value of the function at the known point $$a$$
$$f'(a)$$The derivative of $$f(x)$$ at $$a$$
$$L(x)$$The linear approximation of $$x$$ based on the known point $$a$$

Here we have labeled each term on this graph:

Our task is to find an equation for the line, $$L(x)$$. We know the slope—that’s $$f'(a)$$. And we know a point on the line—the tangent point $$(a, f(a))$$. We can now put these into the the standard point-slope formula:

$(y - y_0) = m (x - x_0)$

Let’s replace each term with our terminology:

$L(x) - f(a) = f'(a) (x - a)$

And then re-arrange to solve for $$L(x)$$:

$L(x) = f(a) + f'(a) (x - a)$

This is the key formula for linear approximations. It’s worth spending a few moments to review each term, which we’ve labeled in next box: So far, so good? Let’s see how this works in a few different applications.

## Application 1: Estimating a tricky function

Suppose our time machine malfunctions and drops us into the year 1750. To fix the broken component and get home we need to find the value of $$\sqrt{5}$$ within $$1\%$$ accuracy… without a calculator! Hmm. Linear approximations to the rescue?

First, let’s note our function $$f(x) = \sqrt{x}$$. Next, we need a nearby known point. Well, we know that $$\sqrt{4}$$ is $$2$$. So let’s choose $$a = 4$$ and then $$f(a) = 2$$. The final remaining piece is to calculate $$f'(a)$$. Give it a shot, Test yourself here

### Test yourself:

What is the slope of the tangent to the curve $$f(x) = \sqrt{x}$$ at $$x = 4$$?

• a) $$2$$
• b) $$4$$
• c) $$\frac{1}{2}$$
• d) $$\frac{1}{4}$$

That’s correct!

I’m sorry, that is incorrect, please try again.

The slope of the tangent curve is the derivative of $$f$$ evaluated at that point. Using the power rule, the derivative of $$f(x) = \sqrt{x}$$ is given by:

$f'(x) = \frac{1}{2}x^{-\frac{1}{2}} = \frac{1}{2\sqrt{x}}$

We then evaluate the derivative at $$x = 4$$:

$f'(4) = \frac{1}{2 \sqrt{4}} = \frac{1}{4}$

Now, we can plug everything into the expression we derived for $$L(x)$$:

\begin{aligned} L(x) &= f(a) + f'(a) (x - a) \cr &= f(4) + f'(4) (x - 4) \cr &= 2 + \frac{1}{4} ( x - 4) \end{aligned}

Finally we calculate the value of the tangent line at $$x = 5$$:

$L(5) = 2 + \frac{1}{4}(5 - 4) = 2.25$

So our approximation of $$\sqrt{5}$$ is $$2.25$$! Here’s our result graphically:

### Test yourself:

In the following example, at which point larger than $$x = 4$$ will the error of our approximation reach $$\approx2 \%$$ of the exact value?

• a) $$x = 5$$
• b) $$x = 6$$
• c) $$x = 7$$
• d) $$x = 8$$

That’s correct!

I’m sorry, that is incorrect, please try again.

The error value increases the further we get from $$x = 4$$. The error at $$x = 5$$ is $$\approx 0.6 \%$$ and by $$x = 6$$ the error has increased to $$\approx 2 \%$$.

Just how accurate are we? The exact value of $$\sqrt{5}$$ is $$2.2360\mathellipsis$$. Our estimation using linear approximation is within $$0.6 \%$$ of the exact answer. Not bad for such a quick calculation, and thankfully within the tolerance to fix our time machine and get home!

Let’s take another look at the expression we found for $$L(x)$$:

$L(x) = 2 + \frac{1}{4} (x - 4)$

You might have noticed that this expression can be used to approximate any $$x$$, not just 5. We could also use it to estimate $$\sqrt{4.5}$$, $$\sqrt{3}$$ or the $$\sqrt{27}$$. However—as you might expect—the further we move away from our known point, the less accurate our linear approximation will typically be.

In this particular case, how far away will our approximation still be accurate? See for yourself in the following interactive illustration by moving your mouse to view the error for different values of $$x$$.

Next let’s see an example where linear approximations can help us simplify a difficult equation.

## Application 2: Simplifying a difficult equation

Let’s look at an example you may have encountered in physics when studying a simple pendulum.

The net force ( $$F_{net}$$ ) on a simple pendulum is given by $$mg \sin(\theta)$$, where $$m$$ is the mass of the pendulum, $$g$$ is the acceleration due to gravity, and $$\theta$$ is the angle between the pendulum and the y-axis.

The resulting equations of motion are quite complicated due to the $$\sin(\theta)$$ term. Perhaps we could replace it with a simpler approximation…? In fact, we can!

Let’s take a look at the graph of $$\sin(\theta)$$:

Do you see any opportunities for a good linear approximation? $$\sin(\theta)$$ sure looks like a line near $$\theta = 0$$. Let’s try a linear approximation of $$f(\theta) = \sin(\theta)$$ using $$\theta = 0$$ as our known point. Using our earlier notation, $$a = 0$$ and $$f(a) = \sin(0) = 0$$. We know $$f'(\theta) = \frac{d}{d\theta}\sin(\theta) = \cos(\theta)$$.

Putting all this into the formula we derived for the tangent line $$L(\theta)$$ we have:

\begin{aligned} L(\theta) &= f(a) + f'(a) (\theta - a) \cr &= f(0) + f'(0) (\theta - 0) \cr &= \sin(0) + \cos(0)( \theta - 0)\cr &= \theta \end{aligned}

In other words, when $$\theta$$ is small $$\sin(\theta) \approx \theta$$. Try for yourself in this Test Yourself Section.

### Test yourself:

In the following example, at which point larger than $$\theta = 0$$ will the error of our approximation reach $$\approx10 \%$$ of the exact value?

• a) $$\theta = 0.4$$
• b) $$\theta = 0.8$$
• c) $$\theta = 1.2$$
• d) $$\theta = 1.6$$

That’s correct!

I’m sorry, that is incorrect, please try again.

The error value increases the further we get from $$\theta = 0$$. The error at $$\theta = 0.4$$ is $$\approx 2.6 \%$$ and by $$\theta = 0.8$$ the error has increased to $$\approx 10.3 \%$$.

Applying $$\sin(\theta) \approx \theta$$ to the equation of a simple pendulum we see:

$F_{net} = mg \sin(\theta) \approx mg\theta$

Much simpler! This approximation is used in most introductory physics courses, and you’ll see the approximation $$sin(\theta) \approx \theta$$ come up over and over again. It’s quite handy.

## Summary

• Linear approximations are tools for estimating the numerical value of a function $$f$$ near a point $$a$$ with the equation of the tangent line:
• $L(x) = f(a)+ f'(a)(x-a)$
• Linear approximations have two shortcomings:
1. The linear approximation only provides a good estimate around the point of tangency. The further you get away from the tangent point, generally the less accurate the linear approximation will be.
2. The linear approximation does not take into account the function's curvature. The more curved the function, the less accurate the linear approximation will be.

## Exercises

1. Find the equation of the line tangent to each function at $$x=0$$:
1. $$\ln(1+x)$$
Show video solution
2. Use a linear approximation to estimate the numerical values of:
1. $$\sqrt{63}$$
Show solution
Show solution to part a)
Approximate the value of $$\sqrt{63}$$
To approximate the value of $$\sqrt{63}$$, we can use the function $$f(x) = \sqrt{x}$$ and use known point $$a=64$$ since we know $$\sqrt{64} = 8$$
If we look at our linear approximation, we can find each part:

$L(x) = f(a) + f'(a) (x - a)$

$L(x) =$ $f(a)$ $+ f'(a) (x - a)$

Our known point is $$a = 64$$ so $$f(64) = \sqrt{64} = 8$$

$L(x) = f(a)$ $+ f'(a)$ $(x - a)$

We want to calculate the value of $$f'(x)$$ at $$a=64$$.

The derivative of $$f(x) = \sqrt{x} \rightarrow f'(x) = \frac{1}{2 \sqrt{x}}$$

Now we can calculate $$f'(64) = \frac{1}{2 \sqrt{64}} = \frac{1}{2 * 8}\ = \frac{1}{16} = 0.0625$$

$L(x) = f(a) + f'(a)$ $(x - a)$

Here we have $$x = 63$$ and $$a = 64 \rightarrow (x - a) = (63 - 64) = -1$$

Putting this all together:

$L(x) = f(a) + f'(a) (x - a)$

For $$x = 63$$ and $$a = 64$$

$L(63) = f(64) + f'(64) (63 - 64)$

$= 8 + \frac{1}{16}(-1) = 8 -\frac{1}{16} =$ $7\frac{15}{16} = 7.9375$

Let's compare the results of a linear approximation around the point $$a=64$$

$\sqrt{63} = 7.9372539...$

$L(63) = 7.9375$

So our linear approximation is correct to three digits of accuracy!

3. John invests $$$1,000$$ in a bank account with an interest rate $$r=0.4$$ per year, continuously compounded. His money grows according to the equation $$y(t) = P_0\cdot e^{rt}$$, where $$P_0$$ is the initial investment, $$r$$ is the interest rate, and $$t$$ is the time measured in years. 1. How much money will John have after $$1$$ year? Provide an exact answer. 2. Use a linear approximation to estimate the numerical value of John's bank account balance after $$1$$ year. 3. Would you use the same linear approximation to estimate how much money John will have after $$20$$ years? Justify. Show solution Show solution to part a) How much money will John have after $$1$$ year? John’s initial investment, $$P_0$$ is equal to$$$1, 000,$$ and his rate $$r = 0.4.$$ After one year, that is, at $$t = 1$$, John will have $$y(1) = 1,000\cdot e^{(0.04)(1)} =$$

$$1,000\cdot e^{0.04}$$ (this is approximately $$$1, 040.81.$$ ) Show solution to part b) Approximate the numerical value of John's bank account balance after $$1$$ year. In order to find the linear approximation, we need to start with a known point; we know that at $$t = 0$$, John has$$$1, 000$$ invested. That is, the point $$(0, 1000)$$ is on our graph. Now, we need to find the slope at that point. For that, we take the derivative of $$y(t)$$ and evaluate it at $$t = 0$$:

$y_0(t) = 1,000\cdot e^{(0.04)t}\cdot (0.04)$

$y_0(0) = 1,000\cdot (0.04) = 40$

Therefore, the equation for the linear approximation is given by

$L(t) = 1,000 + 40 (t - 0)$

We can estimate the value of the function at $$t = 1$$ by evaluating $$L(1)$$, which gives us

$$L(1) = 1, 040$$

This is pretty close to our result found above, that $$y(1) =$$ \$$$1, 040.81$$!

Show solution to part c)
Would you use the same linear approximation to estimate how much money John will have after $$20$$ years?

We could use the same linear approximation, but we would probably be way off! It might be better to find a new, closer “known point” so that we can make a better estimate. Just to check, if we used the same equation we found in part b) and evaluated at $$t = 20$$ we would get

$L(20) = 1, 000 + 40(20) = 1, 800$

The actual value of the function is $$y(20) = 1,000\cdot e^{(0.04)(20)} \approx 2,225.54$$, so our approximation was way too low! We should definitely use another linear approximation for this! To consider: think about the shape of the exponential curve, and draw the tangent line at $$t = 0$$. Does it make sense that we under-estimated the actual value of the function?