This preview shows page 1. Sign up to view the full content.
Unformatted text preview: st-name evaluation for certain data structures, one-level evaluation for local variables in a procedure, and delayed evaluation for names in right single quotes. 214 • Chapter 6: Evaluation and Simpliﬁcation 7 Solving Calculus Problems This chapter provides examples of how Maple can help you present and solve problems from calculus. In This Chapter
• Introductory Calculus • Ordinary Diﬀerential Equations • Partial Diﬀerential Equations 7.1 Introductory Calculus This section contains examples of how to illustrate ideas and solve problems from calculus. The Student[Calculus1] package contains many commands that are especially useful in this area. The Derivative
This section illustrates the graphical meaning of the derivative: the slope of the tangent line. Then it shows you how to ﬁnd the set of inﬂection points for a function. Deﬁne the function f : x → exp(sin(x)) in the following manner.
> f := x -> exp( sin(x) ); f := x → esin(x) Find the derivative of f evaluated at x0 = 1.
> x0 := 1; 215 216 • Chapter 7: Solving Calculus Problems x0 := 1 p0 and p1 are two points on the graph of f .
> p0 := [ x0, f(x0) ]; p0 := [1, esin(1) ]
> p1 := [ x0+h, f(x0+h) ]; p1 := [1 + h, esin(1+h) ] The NewtonQuotient command from the Student[Calculus] package ﬁnds the slope of the secant line through p0 and p1 .
> with(Student[Calculus1]): Use NewtonQuotient command to ﬁnd the expression for the slope.
> m := NewtonQuotient(f(x), x=x0, h=h); m := esin(1+h) − esin(1) h If h = 1, the slope is
> eval(%, h=1); esin(2) − esin(1) The evalf command gives a ﬂoating-point approximation.
> evalf( % ); 0.162800903 As h tends to zero, the secant slope values seem to converge.
> slopes := seq( NewtonQuotient( f(x), x=1.0, h=1.0/10^i ), > i=0..5); slopes := 0.1628009030, 1.182946800, 1.246939100, 1.252742000, 1.253310000, 1.253300000 The following is the equation of the secant line. 7.1 Introductory Calculus > y - p0 = m * ( x - p0 ); • 217 y − esin(1) = (esin(1+h) − esin(1) ) (x − 1) h The isolate command converts the equation to slope–intercept form.
> isolate( %, y ); y= (esin(1+h) − esin(1) ) (x − 1) + esin(1) h You must convert the equation to a function.
> secant := unapply( rhs(%), x ); secant := x → (esin(1+h) − esin(1) ) (x − 1) + esin(1) h You can now plot the secant and the function for diﬀerent values of h. First, make a sequence of plots.
> S := seq( plot( [f(x), secant(x)], x=0..4, > view=[0..4, 0..4] ), > h=[1.0, 0.1, .01, .001, .0001, .00001] ): The display command from the plots package can display the plots in sequence, that is, as an animation.
> with(plots): Warning, the name changecoords has been redefined > display( S, insequence=true, view=[0..4, 0..4] ); 218 • Chapter 7: Solving Calculus Problems x x x x x x In the limit as h tends to zero, the slope is
> Limit( m, h=0 ); esin(1+h) − esin(1) h→0 h lim The value of this limit is
> value( % ); esin(1) co...
View Full Document