Ch4derivativesA06.mws

Ch4derivativesA06.mws
Thu Oct  6 08:01:01 MDT 2005

Housekeeping Commands

>    restart;

>    with(plots, display, implicitplot):

>    with(plottools, disk):

Section 4.1 - Maple and limit and Limit

Here are some limits which don't present as difference quotients:

>    CompInt := n -> (1+1/n)^n;

CompInt := proc (n) options operator, arrow; (1+1/n)^n end proc

>    FarOut := Limit( CompInt(k), k=infinity);   "Inert form"

FarOut := Limit((1+1/k)^k,k = infinity)

>    value(FarOut);    "value" helps evaluate "algebraically"    

exp(1)

>    evalf(%, 14);

2.7182818284590

################################################################

>    divot := x -> (x^3-125)/(x-5);

divot := proc (x) options operator, arrow; (x^3-125)/(x-5) end proc

>    divot(5);

Error, (in divot) numeric exception: division by zero

>    limit( divot(x), x=5);   Flying a bit blinded.

75

################################################################

>    InDet := n -> (1-3/n)^n;

InDet := proc (n) options operator, arrow; (1-3/n)^n end proc

>    Limit( InDet(i), i = infinity);

Limit((1-3/i)^i,i = infinity)

>    value(%);

exp(-3)

#################################################################

Here's a difference-quotient limit such as appears on page 55-56:

>    NQ := (f,t,k) -> (  f(t+k) - f(t)  )/k;

NQ := proc (f, t, k) options operator, arrow; (f(t+k)-f(t))/k end proc

>    NQ(sin,Pi/2,Pi);  NQ(exp,-1/100,2/100);  evalf(%);

-2/Pi

50*exp(1/100)-50*exp(-1/100)

1.00001667

>    gg := x -> (x+3)/(x-5);

gg := proc (x) options operator, arrow; (x+3)/(x-5) end proc

>    Limit( NQ(gg,x,h), h=0);

Limit(((x+h+3)/(x+h-5)-(x+3)/(x-5))/h,h = 0)

>    DerivExpr := value(%);

DerivExpr := -8/(x-5)^2

>    ggPRIME := unapply(DerivExpr, x);

ggPRIME := proc (x) options operator, arrow; -8/(x-5)^2 end proc

>    POTx := 2:

>   

>    POT := [POTx, gg(POTx)];

POT := [2, -5/3]

>    M_tan := ggPRIME( POT[1] );

M_tan := -8/9

>    TanLinEqn := y = POT[2] + M_tan*( x - POT[1] );

TanLinEqn := y = 1/9-8/9*x

#################################################################

Now build the sequence of plot structures to show tangency:

>    P := disk( POT, 1/25, colour=BLACK):

>    delta := 3/2;  epsilon := 1;

delta := 3/2

epsilon := 1

>    XRG := POT[1]-delta..POT[1]+delta;

XRG := 1/2 .. 7/2

>    YRG := POT[2]-epsilon..POT[2]+epsilon;

YRG := -8/3 .. -2/3

>    P := P, plot(gg, XRG, YRG):

>    P := P, implicitplot(TanLinEqn, x=XRG, y=YRG, colour=black):

>    display([P], scaling=CONSTRAINED);

[Maple Plot]

Section 4.2 on Derivatives of Maple Functions

>    gg(x);

(x+3)/(x-5)

>    ggp := D(gg);  ggpp := D(ggp);

ggp := proc (x) options operator, arrow; 1/(x-5)-(x+3)/(x-5)^2 end proc

ggpp := proc (x) options operator, arrow; -2/(x-5)^2+2*(x+3)/(x-5)^3 end proc

>    simplify( ggp(t) );

-8/(t-5)^2

>    TangentLineSlope := ggp(POTx);

TangentLineSlope := -8/9

##################################################################

>    D(p*q);

D(p)*q+p*D(q)

>    D(p/q);  simplify(%);

D(p)/q-p*D(q)/q^2

-(-D(p)*q+p*D(q))/q^2

>    D(p^2);

2*D(p)*p

>    D(p@q);

`@`(D(p),q)*D(q)

>    (D@@2)(p*g);  (D@@3)(p*g);

`@@`(D,2)(p)*g+2*D(p)*D(g)+p*`@@`(D,2)(g)

`@@`(D,3)(p)*g+3*`@@`(D,2)(p)*D(g)+3*D(p)*`@@`(D,2)(g)+p*`@@`(D,3)(g)

#####################################################################

>    LISTfun := [ln,sin,cos,x -> gg(2*x),exp, t -> exp(2*t)*cos(3*t)];

LISTfun := [ln, sin, cos, proc (x) options operator, arrow; gg(2*x) end proc, exp, proc (t) options operator, arrow; exp(2*t)*cos(3*t) end proc]

>    LISTders := map(D, LISTfun);

LISTders := [proc (z) options operator, arrow; 1/z end proc, cos, -sin, proc (x) options operator, arrow; 2/(2*x-5)-2*(2*x+3)/(2*x-5)^2 end proc, exp, proc (t) options operator, arrow; 2*exp(2*t)*cos(3...
LISTders := [proc (z) options operator, arrow; 1/z end proc, cos, -sin, proc (x) options operator, arrow; 2/(2*x-5)-2*(2*x+3)/(2*x-5)^2 end proc, exp, proc (t) options operator, arrow; 2*exp(2*t)*cos(3...

>    LISTders[nops(LISTders)](0);

2

>   

4.3 on derivatives of Maple expressions

>    fexpr := x*sin( exp(3*x) );

fexpr := x*sin(exp(3*x))

>    diff(fexpr,x);

sin(exp(3*x))+3*x*cos(exp(3*x))*exp(3*x)

4.4 - Maple Implicit Differentiation is Different Nowadays

As with LeastSquares, Maple has done some work to ease implicit differentiation, so section 4.4 of our text is a bit out of date.  Here we demo the new "implicitdiff" command:

>    CUBIC := x^3 + y^3 = 6*x*y - 3;   Slightly different from page 61.

CUBIC := x^3+y^3 = 6*x*y-3

>    yPRIME := implicitdiff(CUBIC,y,x);

yPRIME := -(x^2-2*y)/(y^2-2*x)

>    yp := unapply(yPRIME,x,y);

yp := proc (x, y) options operator, arrow; -(x^2-2*y)/(y^2-2*x) end proc

>    TanSlope := yp(1,2);

TanSlope := 3/2

>    TanLineEqn := y-2 = TanSlope*(x-1);

TanLineEqn := y-2 = 3/2*x-3/2

>    implicitplot([CUBIC,TanLineEqn],x=-3..3,y=-3..3,colour=[BLACK,RED]);

[Maple Plot]

Assignment #6

Here are the problems for Assignment #6, due Thursday, 10/13/05.

Page 66:

1(c) --  Be sure to use theta  as they say.

3  -- make a blob for the point of tangency as well.

5

6

12

16 -- use "implicitdiff" rather than the text's methods

 

>    ##############################################################