Application Center - Maplesoft

Calculus I: Lesson 12: Linear Approximation

You can switch back to the summary page by clicking here.

L12-linearApprox.mws

Calculus I

Lesson 12: Linear Approximation

Assume that f(x) is differentiable.

Recall that : y = f (x + x) - f (x)

x = dx =( x + x ) - x

dy = f ' (x) dx

For sufficiently small x,

f ( x + x) - f (x) is approximately equal to f ' (x) dx

and hence for sufficiently small x

dy approximates y

Example 1
Let
, x = 2, and x = 0.4.

Calculate, y, dy, plot f(x) and the tangent line when x = 2.

> restart:

> f:= x -> x^5;

> D(f);

> f( 2 + 0.4) - f(2);

> f(2.4);

> df:= x -> 5*x^4;

> df(2);

> 80 * .4;

Hence, y = and dy = f '(2) (0.4) = 32;

note that x = 0.4 is large.

> tl:= x -> 32 + 80*(x - 2);

> tl(2.4);

> with(plots):

```Warning, the name changecoords has been redefined
```

> A:= plot({f(x),tl(x)}, x= 1.5..2.7, color=[blue,brown]):

> B:= plot([t,32,t = 2..2.4], color = magenta):

> C:= plot([2.4,t,t= 32 ..79.62624], color = magenta):

> F:= plot([t, 64, t= 2.4..2.6], color = black):

> G:= plot([2.6,t,t=64..79.62624], color = black):

> H:= plot([t,79.62624, t= 2.4..2.6], color = black):

> K:= textplot([2.65,74,'dy'],color = red):

> L:= textplot([2.5,50,'deltay'] , color = red):

> M:= textplot([2.2,20,'deltax'],color = red):

> display({A,B,C,F,G,H,K,L,M}, axes = boxed);

The tangent line is the linear approximation to a function. We see here, that

for larger x , the linear approxiamtion is NOT a good one.

Example 2

Let .

a) Find the linear approximation to f(x) when x = 1.

b) Plot f(x) and the approximation on the same axes.

c) Use the linear approximation to estimate, sqrt(3.98).

Compare this estimate to the actual value.

d) Calculate y and dy, for x = 1 and x = 2.98.

Plot f(x), the linear approximation and show dy and y .

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

> D(f);

> df:= x -> (0.5) * ( 1 / (sqrt(x + 3)));

> f(1);

> df(1);

Thus the linear approximation (i.e., the tangent line) passes through the point (1,2)

and has slope .25 .

> L:= x -> 2 + 0.25 * ( x - 1);

a) Thus, linear approximation is: L(x) = 1.75 + 0.25 x .

> plot({f(x),L(x)}, x = -5..5, color=[brown,blue]);

The linear approximation to f (x) is NOT good for x not close to 1.

> plot({f(x),L(x)}, x = 0.5..1.5, color=[brown,blue]);

For x values close to 1, the linear approximation is better.

> L(3.98);

> f(3.98);

c) The linear approximation function gives 2.7450 as an estimate for sqrt(3.98),

the actual value is approximately,

d) We now do part (d).

> f(3.98) - f(1);

Thus, y = (for x = 1 and x = 2.98).

> df(1) * 2.98;

Thus, dy = (for x = 1 and x= 2.98).

> L(3.98);

> f(1);

> L(1);

> f(3.98);

> with(plots):

```Warning, the name changecoords has been redefined
```

> A:= plot({f(x),L(x)}, x = 0..6, color=[blue,brown]):

> B:= plot([t,2, t = 1..3.98], color = magenta):

> C:= plot([3.98,t,t = 2..2.7450], color = magenta):

> F:= plot([t,2.641968963, t = 3.98..4.2],color = black):

> G:= plot([4.2,t,t = 2.641968963..2.7450], color = black):

> H:= plot([t,2.7450, t = 3.98..4.2],color = black):

> K:= textplot([4.5,2.7,'dy'], align=RIGHT, color = red):

> L:= textplot([4.2,2.3,'deltay'], align=RIGHT, color = red):

> M:= textplot([2.3,1.9,'deltax'], color = red):

> display( {A,B,C,F,G,H,K,L,M}, axes = boxed);