## 4.2 Linear Approximations and Differentials

### Learning Objectives

• Describe the linear approximation to a function at a point.
• Write the linearization of a given function.
• Draw a graph that illustrates the use of differentials to approximate the change in a quantity.
• Calculate the relative error and percentage error in using a differential approximation.

We have just seen how derivatives allow us to compare related quantities that are changing over time. In this section, we examine another application of derivatives: the ability to approximate functions locally by linear functions. Linear functions are the easiest functions with which to work, so they provide a useful tool for approximating function values. In addition, the ideas presented in this section are generalized in the second volume of this text, when we studied how to approximate functions by higher-degree polynomials in the Introduction to Power Series and Functions.

# Linear Approximation of a Function at a Point

Consider a function $f$ that is differentiable at a point $x=a$. Recall that the tangent line to the graph of $f$ at $a$ is given by the equation

$y=f(a)+f^{\prime}(a)(x-a)$.

For example, consider the function $f(x)=\frac{1}{x}$ at $a=2$. Since $f$ is differentiable at $x=2$ and $f^{\prime}(x)=-\frac{1}{x^2}$, we see that $f^{\prime}(2)=-\frac{1}{4}$. Therefore, the tangent line to the graph of $f$ at $a=2$ is given by the equation

$y=\frac{1}{2}-\frac{1}{4}(x-2)$.

(Figure)(a) shows a graph of $f(x)=\frac{1}{x}$ along with the tangent line to $f$ at $x=2$. Note that for $x$ near 2, the graph of the tangent line is close to the graph of $f$. As a result, we can use the equation of the tangent line to approximate $f(x)$ for $x$ near 2. For example, if $x=2.1$, the $y$ value of the corresponding point on the tangent line is

$y=\frac{1}{2}-\frac{1}{4}(2.1-2)=0.475$.

The actual value of $f(2.1)$ is given by

$f(2.1)=\frac{1}{2.1}\approx 0.47619$.

Therefore, the tangent line gives us a fairly good approximation of $f(2.1)$ ((Figure)(b)). However, note that for values of $x$ far from 2, the equation of the tangent line does not give us a good approximation. For example, if $x=10$, the $y$-value of the corresponding point on the tangent line is

$y=\frac{1}{2}-\frac{1}{4}(10-2)=\frac{1}{2}-2=-1.5$,

whereas the value of the function at $x=10$ is $f(10)=0.1$.

Figure 1. (a) The tangent line to $f(x)=1/x$ at $x=2$ provides a good approximation to $f$ for $x$ near 2. (b) At $x=2.1$, the value of $y$ on the tangent line to $f(x)=1/x$ is 0.475. The actual value of $f(2.1)$ is $1/2.1$, which is approximately 0.47619.

In general, for a differentiable function $f$, the equation of the tangent line to $f$ at $x=a$ can be used to approximate $f(x)$ for $x$ near $a$. Therefore, we can write

$f(x)\approx f(a)+f^{\prime}(a)(x-a)$ for $x$ near $a$.

We call the linear function

$L(x)=f(a)+f^{\prime}(a)(x-a)$

the linear approximation, or tangent line approximation, of $f$ at $x=a$. This function $L$ is also known as the linearization of $f$ at $x=a$.

To show how useful the linear approximation can be, we look at how to find the linear approximation for $f(x)=\sqrt{x}$ at $x=9$.

### Linear Approximation of $\sqrt{x}$

Find the linear approximation of $f(x)=\sqrt{x}$ at $x=9$ and use the approximation to estimate $\sqrt{9.1}$.

#### Analysis

Using a calculator, the value of $\sqrt{9.1}$ to four decimal places is 3.0166. The value given by the linear approximation, 3.0167, is very close to the value obtained with a calculator, so it appears that using this linear approximation is a good way to estimate $\sqrt{x}$, at least for $x$ near 9. At the same time, it may seem odd to use a linear approximation when we can just push a few buttons on a calculator to evaluate $\sqrt{9.1}$. However, how does the calculator evaluate $\sqrt{9.1}$? The calculator uses an approximation! In fact, calculators and computers use approximations all the time to evaluate mathematical expressions; they just use higher-degree approximations.

Find the local linear approximation to $f(x)=\sqrt[3]{x}$ at $x=8$. Use it to approximate $\sqrt[3]{8.1}$ to five decimal places.

#### Hint

$L(x)=f(a)+f^{\prime}(a)(x-a)$

### Linear Approximation of $\sin x$

Find the linear approximation of $f(x)= \sin x$ at $x=\frac{\pi}{3}$ and use it to approximate $\sin (62^{\circ})$.

Find the linear approximation for $f(x)= \cos x$ at $x=\frac{\pi }{2}$.

Hint

$L(x)=f(a)+f^{\prime}(a)(x-a)$

Linear approximations may be used in estimating roots and powers. In the next example, we find the linear approximation for $f(x)=(1+x)^n$ at $x=0$, which can be used to estimate roots and powers for real numbers near 1. The same idea can be extended to a function of the form $f(x)=(m+x)^n$ to estimate roots and powers near a different number $m$.

### Approximating Roots and Powers

Find the linear approximation of $f(x)=(1+x)^n$ at $x=0$. Use this approximation to estimate $(1.01)^3$.

Find the linear approximation of $f(x)=(1+x)^4$ at $x=0$ without using the result from the preceding example.

#### Hint

$f^{\prime}(x)=4(1+x)^3$

# Differentials

We have seen that linear approximations can be used to estimate function values. They can also be used to estimate the amount a function value changes as a result of a small change in the input. To discuss this more formally, we define a related concept: differentials. Differentials provide us with a way of estimating the amount a function changes as a result of a small change in input values.

When we first looked at derivatives, we used the Leibniz notation $dy/dx$ to represent the derivative of $y$ with respect to $x$. Although we used the expressions $dy$ and $dx$ in this notation, they did not have meaning on their own. Here we see a meaning to the expressions $dy$ and $dx$. Suppose $y=f(x)$ is a differentiable function. Let $dx$ be an independent variable that can be assigned any nonzero real number, and define the dependent variable $dy$ by

$dy=f^{\prime}(x) \, dx$.

It is important to notice that $dy$ is a function of both $x$ and $dx$. The expressions $dy$ and $dx$ are called differentials. We can divide both sides of (Figure) by $dx$, which yields

$\frac{dy}{dx}=f^{\prime}(x)$.

This is the familiar expression we have used to denote a derivative. (Figure) is known as the differential form of (Figure).

### Computing differentials

For each of the following functions, find $dy$ and evaluate when $x=3$ and $dx=0.1$.

1. $y=x^2+2x$
2. $y= \cos x$

For $y=e^{x^2}$, find $dy$.

#### Hint

$dy=f^{\prime}(x)dx$

We now connect differentials to linear approximations. Differentials can be used to estimate the change in the value of a function resulting from a small change in input values. Consider a function $f$ that is differentiable at point $a$. Suppose the input $x$ changes by a small amount. We are interested in how much the output $y$ changes. If $x$ changes from $a$ to $a+dx$, then the change in $x$ is $dx$ (also denoted $\Delta x$), and the change in $y$ is given by

$\Delta y=f(a+dx)-f(a)$.

Instead of calculating the exact change in $y$, however, it is often easier to approximate the change in $y$ by using a linear approximation. For $x$ near $a$, $f(x)$ can be approximated by the linear approximation

$L(x)=f(a)+f^{\prime}(a)(x-a)$.

Therefore, if $dx$ is small,

$f(a+dx)\approx L(a+dx)=f(a)+f^{\prime}(a)(a+dx-a)$.

That is,

$f(a+dx)-f(a)\approx L(a+dx)-f(a)=f^{\prime}(a) \, dx.$

In other words, the actual change in the function $f$ if $x$ increases from $a$ to $a+dx$ is approximately the difference between $L(a+dx)$ and $f(a)$, where $L(x)$ is the linear approximation of $f$ at $a$. By definition of $L(x)$, this difference is equal to $f^{\prime}(a)dx$. In summary,

$\Delta y=f(a+dx)-f(a)\approx L(a+dx)-f(a)=f^{\prime}(a) \, dx=dy$.

Therefore, we can use the differential $dy=f^{\prime}(a) \, dx$ to approximate the change in $y$ if $x$ increases from $x=a$ to $x=a+dx$. We can see this in the following graph.

Figure 5. The differential $dy=f^{\prime}(a) \, dx$ is used to approximate the actual change in $y$ if $x$ increases from $a$ to $a+dx$.

We now take a look at how to use differentials to approximate the change in the value of the function that results from a small change in the value of the input. Note the calculation with differentials is much simpler than calculating actual values of functions and the result is very close to what we would obtain with the more exact calculation.

### Approximating Change with Differentials

Let $y=x^2+2x$. Compute $\Delta y$ and $dy$ at $x=3$ if $dx=0.1$.

For $y=x^2+2x$, find $\Delta y$ and $dy$ at $x=3$ if $dx=0.2$.

#### Hint

$dy=f^{\prime}(3) \, dx$, $\Delta y=f(3.2)-f(3)$

# Calculating the Amount of Error

Any type of measurement is prone to a certain amount of error. In many applications, certain quantities are calculated based on measurements. For example, the area of a circle is calculated by measuring the radius of the circle. An error in the measurement of the radius leads to an error in the computed value of the area. Here we examine this type of error and study how differentials can be used to estimate the error.

Consider a function $f$ with an input that is a measured quantity. Suppose the exact value of the measured quantity is $a$, but the measured value is $a+dx$. We say the measurement error is $dx$ (or $\Delta x$). As a result, an error occurs in the calculated quantity $f(x)$. This type of error is known as a propagated error and is given by

$\Delta y=f(a+dx)-f(a)$.

Since all measurements are prone to some degree of error, we do not know the exact value of a measured quantity, so we cannot calculate the propagated error exactly. However, given an estimate of the accuracy of a measurement, we can use differentials to approximate the propagated error $\Delta y$. Specifically, if $f$ is a differentiable function at $a$, the propagated error is

$\Delta y\approx dy=f^{\prime}(a) \, dx$.

Unfortunately, we do not know the exact value $a$. However, we can use the measured value $a+dx$, and estimate

$\Delta y\approx dy\approx f^{\prime}(a+dx) \, dx$.

In the next example, we look at how differentials can be used to estimate the error in calculating the volume of a box if we assume the measurement of the side length is made with a certain amount of accuracy.

### Volume of a Cube

Suppose the side length of a cube is measured to be 5 cm with an accuracy of 0.1 cm.

1. Use differentials to estimate the error in the computed volume of the cube.
2. Compute the volume of the cube if the side length is (i) 4.9 cm and (ii) 5.1 cm to compare the estimated error with the actual potential error.

Estimate the error in the computed volume of a cube if the side length is measured to be 6 cm with an accuracy of 0.2 cm.

#### Hint

$dV=3x^2 \, dx$

The measurement error $dx \, (=\Delta x)$ and the propagated error $\Delta y$ are absolute errors. We are typically interested in the size of an error relative to the size of the quantity being measured or calculated. Given an absolute error $\Delta q$ for a particular quantity, we define the relative error as $\frac{\Delta q}{q}$, where $q$ is the actual value of the quantity. The percentage error is the relative error expressed as a percentage. For example, if we measure the height of a ladder to be 63 in. when the actual height is 62 in., the absolute error is 1 in. but the relative error is $\frac{1}{62}=0.016$, or $1.6 \%$. By comparison, if we measure the width of a piece of cardboard to be 8.25 in. when the actual width is 8 in., our absolute error is $\frac{1}{4}$ in., whereas the relative error is $\frac{0.25}{8}=\frac{1}{32}$, or $3.1\%$. Therefore, the percentage error in the measurement of the cardboard is larger, even though 0.25 in. is less than 1 in.

### Relative and Percentage Error

An astronaut using a camera measures the radius of Earth as 4000 mi with an error of $\pm 80$ mi. Let’s use differentials to estimate the relative and percentage error of using this radius measurement to calculate the volume of Earth, assuming the planet is a perfect sphere.

Determine the percentage error if the radius of Earth is measured to be 3950 mi with an error of $\pm 100$ mi.

#### Hint

Use the fact that $dV=4\pi r^2 \, dr$ to find $dV/V$.

### Key Concepts

• A differentiable function $y=f(x)$ can be approximated at $a$ by the linear function
$L(x)=f(a)+f^{\prime}(a)(x-a)$.
• For a function $y=f(x)$, if $x$ changes from $a$ to $a+dx$, then
$dy=f^{\prime}(x) \, dx$

is an approximation for the change in $y$. The actual change in $y$ is

$\Delta y=f(a+dx)-f(a)$.
• A measurement error $dx$ can lead to an error in a calculated quantity $f(x)$. The error in the calculated quantity is known as the propagated error. The propagated error can be estimated by
$dy\approx f^{\prime}(x) \, dx$.
• To estimate the relative error of a particular quantity $q$, we estimate $\frac{\Delta q}{q}$.

# Key Equations

• Linear approximation
$L(x)=f(a)+f^{\prime}(a)(x-a)$
• A differential
$dy=f^{\prime}(x) \, dx$.

1. What is the linear approximation for any generic linear function $y=mx+b$?

2. Determine the necessary conditions such that the linear approximation function is constant. Use a graph to prove your result.

3. Explain why the linear approximation becomes less accurate as you increase the distance between $x$ and $a$. Use a graph to prove your argument.

4. When is the linear approximation exact?

For the following exercises, find the linear approximation $L(x)$ to $y=f(x)$ near $x=a$ for the function.

5. [T]$f(x)=x+x^4, \, a=0$

6. [T]$f(x)=\frac{1}{x}, \, a=2$

7. [T]$f(x)= \tan x, \, a=\frac{\pi }{4}$

8. [T]$f(x)= \sin x, \, a=\frac{\pi }{2}$

9. [T]$f(x)=x \sin x, \, a=2\pi$

10. [T]$f(x)= \sin^2 x, \, a=0$

For the following exercises, compute the values given within 0.01 by deciding on the appropriate $f(x)$ and $a$, and evaluating $L(x)=f(a)+f^{\prime}(a)(x-a)$. Check your answer using a calculator.

11. [T] $(2.001)^6$

12. [T] $\sin (0.02)$

13. [T] $\cos (0.03)$

14. [T] $(15.99)^{1/4}$

15. [T] $\frac{1}{0.98}$

16. [T] $\sin (3.14)$

For the following exercises, determine the appropriate $f(x)$ and $a$, and evaluate $L(x)=f(a)+f^{\prime}(a)(x-a).$ Calculate the numerical error in the linear approximations that follow.

17. $(1.01)^3$

18. $\cos (0.01)$

19. $(\sin (0.01))^2$

20. $(1.01)^{-3}$

21. $(1+\frac{1}{10})^{10}$

22. $\sqrt{8.99}$

For the following exercises, find the differential of the function.

23. $y=3x^4+x^2-2x+1$

24. $y=x \cos x$

25. $y=\sqrt{1+x}$

26. $y=\frac{x^2+2}{x-1}$

For the following exercises, find the differential and evaluate for the given $x$ and $dx$.

27. $y=3x^2-x+6$, $x=2$, $dx=0.1$

28. $y=\frac{1}{x+1}$, $x=1$, $dx=0.25$

29. $y= \tan x$, $x=0$, $dx=\frac{\pi }{10}$

30. $y=\frac{3x^2+2}{\sqrt{x+1}}$, $x=0$, $dx=0.1$

31. $y=\frac{\sin (2x)}{x}$, $x=\pi$, $dx=0.25$

32. $y=x^3+2x+\frac{1}{x}$, $x=1$, $dx=0.05$

For the following exercises, find the change in volume $dV$ or in surface area $dA$.

33. $dV$ if the sides of a cube change from 10 to 10.1.

34. $dA$ if the sides of a cube change from $x$ to $x+dx$.

35. $dA$ if the radius of a sphere changes from $r$ by $dr$.

36. $dV$ if the radius of a sphere changes from $r$ by $dr$.

37. $dV$ if a circular cylinder with $r=2$ changes height from 3 cm to $3.05$ cm.

38. $dV$ if a circular cylinder of height 3 changes from $r=2$ to $r=1.9$ cm.

For the following exercises, use differentials to estimate the maximum and relative error when computing the surface area or volume.

39. A spherical golf ball is measured to have a radius of $5$ mm, with a possible measurement error of $0.1$ mm. What is the possible change in volume?

40. A pool has a rectangular base of 10 ft by 20 ft and a depth of 6 ft. What is the change in volume if you only fill it up to 5.5 ft?

41. An ice cream cone has height 4 in. and radius 1 in. If the cone is 0.1 in. thick, what is the difference between the volume of the cone, including the shell, and the volume of the ice cream you can fit inside the shell?

For the following exercises, confirm the approximations by using the linear approximation at $x=0$.

42. $\sqrt{1-x}\approx 1-\frac{1}{2}x$

43. $\frac{1}{\sqrt{1-x^2}}\approx 1$

44. $\sqrt{c^2+x^2}\approx c$

## Glossary

differential
the differential $dx$ is an independent variable that can be assigned any nonzero real number; the differential $dy$ is defined to be $dy=f^{\prime}(x) \, dx$
differential form
given a differentiable function $y=f^{\prime}(x)$, the equation $dy=f^{\prime}(x) \, dx$ is the differential form of the derivative of $y$ with respect to $x$
linear approximation
the linear function $L(x)=f(a)+f^{\prime}(a)(x-a)$ is the linear approximation of $f$ at $x=a$
percentage error
the relative error expressed as a percentage
propagated error
the error that results in a calculated quantity $f(x)$ resulting from a measurement error $dx$
relative error
given an absolute error $\Delta q$ for a particular quantity, $\frac{\Delta q}{q}$ is the relative error.
tangent line approximation (linearization)
since the linear approximation of $f$ at $x=a$ is defined using the equation of the tangent line, the linear approximation of $f$ at $x=a$ is also known as the tangent line approximation to $f$ at $x=a$