LearningGuide

# plot3d abs err x24 xi24 stylepatch axesboxed

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

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. &gt; f := x -&gt; exp( sin(x) ); f := x → esin(x) Find the derivative of f evaluated at x0 = 1. &gt; x0 := 1; 215 216 • Chapter 7: Solving Calculus Problems x0 := 1 p0 and p1 are two points on the graph of f . &gt; p0 := [ x0, f(x0) ]; p0 := [1, esin(1) ] &gt; 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 . &gt; with(Student[Calculus1]): Use NewtonQuotient command to ﬁnd the expression for the slope. &gt; m := NewtonQuotient(f(x), x=x0, h=h); m := esin(1+h) − esin(1) h If h = 1, the slope is &gt; eval(%, h=1); esin(2) − esin(1) The evalf command gives a ﬂoating-point approximation. &gt; evalf( % ); 0.162800903 As h tends to zero, the secant slope values seem to converge. &gt; slopes := seq( NewtonQuotient( f(x), x=1.0, h=1.0/10^i ), &gt; 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 &gt; y - p0[2] = m * ( x - p0[1] ); • 217 y − esin(1) = (esin(1+h) − esin(1) ) (x − 1) h The isolate command converts the equation to slope–intercept form. &gt; isolate( %, y ); y= (esin(1+h) − esin(1) ) (x − 1) + esin(1) h You must convert the equation to a function. &gt; 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. &gt; S := seq( plot( [f(x), secant(x)], x=0..4, &gt; view=[0..4, 0..4] ), &gt; 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. &gt; with(plots): Warning, the name changecoords has been redefined &gt; 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 &gt; Limit( m, h=0 ); esin(1+h) − esin(1) h→0 h lim The value of this limit is &gt; value( % ); esin(1) co...
View Full Document

Ask a homework question - tutors are online