Lab 6: Linear Approximations

0. Objective:

In this lab we will use Mathematica to investigate linear approximations of functions.  Linear functions (straight line functions) are relatively easy to evaluate, while general functions like sin(x), log(x), and other transcendental functions often can not be evaluated directly.  Thus, the need for approximating functions.

1. Examples:

First let’s look at some examples.  Suppose we wish to find an approximation to sin(1).  If we use a calculator or Mathematica it’s easy:

N[Sin[1],15]

Here we see sin(1) out to 15 decimal digits, but how does Mathematica (or a calculator) do this calculation?  Is the above an exact value for sin(1)?  The answer is no, this is not an exact value, it is an approximation.  The types of approximating functions that Mathematica uses are probably more complicated then what we want to do in calculus, but we can begin to understand the concept of an approximating function by looking at linear approximations.

Consider the following:

f[x_]=Sin[x]
Plot[f[x],{x,0,Pi/2}]

Note that 1 and (π/3)are “close” together.  Let’s find and graph the linear approximation to our function (the tangent line through x=(π/3)):

x0=Pi/3;
L[x_]=f[x0]+f'[x0]*(x-x0)

Plot[{f[x],L[x]},{x,0,Pi/2},PlotStyle->{Blue,Red}]

Note the following:
(1) The equation for a tangent line is the equation for the linear approximating function.
(2) In this case we are using Mathematica’s “prime” notation to take a derivative of the function f.
(3) Near x=(π/3) the graph of sin(x) and the graph of the tangent are “close” together.
(4) If we wish to approximate sin(1), based on the above graphs, one way of doing an approximation would be to use the linear approximating function.

Since evaluating the linear equation involves only the four basic operations (addition, subtraction, multiplication, and division), evaluation is almost trivial:

L[1]

N[L[1],15]

Note that this agrees with the “exact” value to two decimal places.

Next, let’s approximate (Sqrt[10]).  Start by finding the equation of the tangent line to the graph of (Sqrt[x]), near x = 10 (at a place where evaluating the function is easy):

g[x_]=Sqrt[x]
x1=9;
T[x_]=g[x1]+g'[x1]*(x-x1)

Plot[{g[x],T[x]},{x,0,15},PlotStyle->{Blue,Red}]

Near x = 9, the graph of the function and the graph of the tangent are “close” together.  So we could use the tangent to approximate the function near 9.  In other words:

N[T[10],15]
N[(Sqrt[10]),15]

which agree to two decimal digits.

Name:
PIN:

Tasks :

(1) Use linear approximations with (Subscript[x, 0])=(π/3) to approximate the following values.  Compare your approximations with what Mathematica says the “exact” value is and indicate which approximation came closest to the “exact” value and which one was the worst at approximating the “exact” value.
	(a)  cos(1)		(b) cos(9/10)		(c) cos(1/2)
	
approx =
	
exact =

(2) Use linear approximations to estimate the following values.  Sketch a graph of the function and tangent that you use.  Compare your approximations to the “true” values.  Indicate on the graph which was the “best” and the “worst” approximation.
	(a) (7^(1/3))		   (b) (9^(1/3))		(c) (11^(1/3))