Linear Approximations

In this worksheet we'll work with the linear approximation formula 2.33 of our text which says that if f is differentiable near [Maple Math] then f(x) is approximately

[Maple OLE 2.0 Object]

Tables and graphs will be used to help show where the approximation is a good one.
This worksheet will use the Maple function option under Enter Expression of MenuMaple. Before starting be sure that you have the calculus menu of MenuMaple open and click in the first command region.

EXAMPLE ONE

Select Enter Expression and click on the function option . The dialogue box will now have three input areas, one for the name of the function, one for the name of the independent variable, and one for the expression. Enter f as the name of the function, x as the independent variable and sqrt(x) as the expression.

> f:=x->sqrt(x);

[Maple Math]

The output that you will see on the screen is a Maple's mapping notation for functions which will alllow us to use f(x) notation in Maple.

Use the differentiate button to find the derivative of f with respect to x. Call the result df.

> df:=D(f);

[Maple Math]

We will try to approximate the square root of x for x near [Maple Math] . Recall that to get a linear
approximation to a function f for x near
[Maple Math] we use

[Maple OLE 2.0 Object]

To get a linear approximation for x near 4 use Enter Function to enter a function called Lapprox with x as the independent variable and f(4) + df(4)*(x-4) as the expression.

> Lapprox:=x->f(4)+df(4)*(x-4);

[Maple Math]

Make a table of values showing x, the actual square root, and the approximate square root found by the linear approximation. Use x between 3.8 and 4.2 in steps of 0.02. To do this use table of values with f(x) and Lapprox(x) as expressions (separated by a comma).

> with(math191):
> valutable([f(x),Lapprox(x)],x=3.8..4.2,'step'=0.02);

 x            funct1(x)        funct2(x)  
----------------------------------------------
3.8          1.949358869      1.950000000     
3.820000000  1.954482029      1.955000000     
3.840000000  1.959591794      1.960000000     
3.860000000  1.964688270      1.965000000     
3.880000000  1.969771560      1.970000000     
3.900000000  1.974841766      1.975000000     
3.920000000  1.979898987      1.980000000     
3.940000000  1.984943324      1.985000000     
3.960000000  1.989974874      1.990000000     
3.980000000  1.994993734      1.995000000     
4.000000000  2.000000000      2.000000000     
4.020000000  2.004993766      2.005000000     
4.040000000  2.009975124      2.010000000     
4.060000000  2.014944168      2.015000000     
4.080000000  2.019900988      2.020000000     
4.100000000  2.024845673      2.025000000     
4.120000000  2.029778313      2.030000000     
4.140000000  2.034698995      2.035000000     
4.160000000  2.039607805      2.040000000     
4.180000000  2.044504830      2.045000000     
4.200000000  2.049390153      2.050000000     

In the table what do you notice f(x) and Lapprox(x) when x gets close to [Maple Math] ?

Make a graph of the original f(x) and the linear approximation, Lapprox(x), over the interval from 0 to 6.

> plot([f(x),Lapprox(x)],x=0..6,title=`actual in blue aprroximation in red`,color=[blue,red]);

[Maple Plot]

What happens as x gets closer to xo=4?

EXAMPLE TWO Approximate the sine of 31 degrees.
Enter g as the name of the function, x as the independent variable, and sin(x) as the expression.

> g:=x->sin(x);

[Maple Math]

Now find its derivative with respect to x and give the result the name dg.

> dg:=D(g);

[Maple Math]

Maple expects angles in radians. Since 31 degrees is near Pi/6, we will find a linear approximation near Pi/6. Enter Lsin as the name of the function, x as the independent variable and

g(Pi/6) + dg(Pi/6)*(x - Pi/6) as the expression.

> Lsin:=x->g(Pi/6)+dg(Pi/6)*(x-Pi/6);

[Maple Math]

Since one degree is Pi/180 radians, 31 degrees is Pi/6 + Pi/180. At the prompt below type in ans:=Lsin(Pi/6+Pi/180);
and press enter.

> ans:=Lsin(Pi/6+Pi/180);

[Maple Math]

The following converts this last result to decimal form.

> ans:=evalf(ans);

[Maple Math]

Now find the actual value of the sine of 31 degrees,

> Actual:=sin(Pi/6+Pi/180);

[Maple Math]

and convert it to a decimal.

> Actual:=evalf(Actual);

[Maple Math]

Now find the absolute value of the difference between Actual and ans.

> error:=abs(Actual - ans);

[Maple Math]

Now make a graph of g(x) and Lsin(x) for x between 0 and Pi/2. Select scaling on so that the x-axis and y-axis will use the same scale.

> plot([g(x),Lsin(x)],x=0..Pi/2,title=`actual in blue approximate in red`,scaling=constrained,color=[blue,red]);

[Maple Plot]

Dan Symancyk Oct 1995, Oct 1996, June 1997, March 1998, Oct 1998, Feb 1999