next up previous
Next: Exercises Up: The linear approximation to Previous: Purpose

Background

Suppose that f(x) is a differentiable function and that a is some fixed number in the domain of f. We define the linear approximation to f(x) at x=a, tex2html_wrap_inline268 by the equation

displaymath230

In this equation, the parameter a is called the base point, and x is the independent variable. It might help you understand the definition better if you keep in mind that a stands for a fixed number.

For example if tex2html_wrap_inline276 , then tex2html_wrap_inline278 would be the straight line that is tangent to the graph of tex2html_wrap_inline276 at x=1. We can use the definition to find this tangent line by evaluating f(1) = 1 and f'(1) = 2 and then plugging these numbers into the definition to obtain

displaymath231

The straight line tex2html_wrap_inline268 has the two properties that tex2html_wrap_inline290 and tex2html_wrap_inline292 . That is, tex2html_wrap_inline268 intersects the graph of f(x) at x=a and tex2html_wrap_inline268 has the same slope as f(x) at x=a. To see this, first set x=a in the definition, giving

displaymath232

Then differentiate the definition with respect to x to get the slope of the line, which is

displaymath233

Unfortunately, Maple does not provide the linear approximation directly, so a procedure called tangentline has been written as part of the CalcP package. Its syntax is similar to that of the secantline command introduced in the previous lab. The Maple commands below show how to load the CalcP package into your Maple session and provide several examples of how to use the tangentline function.

  > with(CalcP);

eqnarray53

  > f := x -> x^5+4*x^2+1;

displaymath234

  > tangentline(f,x=-1);

displaymath235

  > plot({f(x),tangentline(f,x=-1)},x=-2..2);

  > plot({f(x),tangentline(f,x=-1),tangentline(f,x=1)},x=-2..2);

The tangentline procedure produces an expression, which can be manipulated using standard Maple commands. In the next example, we show how to use the Maple unapply command to turn the result of tangentline into a function.

  > f_T := unapply(tangentline(f,x=-1),x);

displaymath236

  > f_T(x);

displaymath235

As shown in the next example, the animate command from the plots package can be used to see how the tangent line changes as the base point is changed.

  > with(plots):

  > animate({x^2,tangentline(x^2,x=t)},x=-2..2,t=-1..1);

The next two examples show how to apply tangentline to arbitrary functions g(x) and h(x). Note that Maple uses the notation D(g) to stand for the derivative of g, and the notation D(g)(a) to stand for the derivative of g evaluated at x=a.

  > tangentline(g(x),x=a);

displaymath238

  > tangentline(g(x)+h(x),x=a);

displaymath239

  > tangentline(g(x),x=a) + tangentline(h(x),x=a);

displaymath240

The last Maple command in the previous example shows that if p(x) is the sum of two functions, p(x)=h(x)+g(x), then tex2html_wrap_inline324 , which means that tex2html_wrap_inline326 is tangent to h(x)+g(x) at x=a. To check that this is true, you need to show that the values tex2html_wrap_inline326 and h(x)+g(x) are equal at x=a and that the derivatives of tex2html_wrap_inline326 and h(x)+g(x) are equal at x=a. Maple commands that do this are shown below.

  > t1 := tangentline(g(x),x=a) + tangentline(h(x),x=a);

displaymath241

  > subs(x=a,t1);

displaymath242

  > subs(x=a,diff(t1,x));

displaymath243


next up previous
Next: Exercises Up: The linear approximation to Previous: Purpose

Sean O Anderson
Tue Sep 24 13:24:30 EDT 1996