Examples for Section 6.3* of Stewart’s Calculus (7th Ed. Hybrid)

Typesetting hints

To get to math mode within a text cell, type ctrl-9
To get back to text mode within a text cell, type ctrl-0
Select a math expression and type ctrl-shift-t to convert to “traditional form” (like you see on the whiteboard).
Example: math mode using ctrl-9 and ctrl-0: E^(-k 5)  
Same but converting to traditional form afterward: (e^(5 (-k)))

Example A. Model for spread of a rumor

Consider the function    p(t)=(1/(1+a (e^(-k t))))
which has positive constants a and k, and independent variable t.  We want to think of this as a model for the spread of a rumor from time t=0 to infinity. Use manipulate to investigate. We leave a and k unspecified in the plot command, and wrap Manipulate around the plot command to control the intial values and ranges of a and k.

p[t_,a_,k_]:=1/(1+a E^(-k t));
Manipulate[Plot[p[t,a,k],{t,0,10},PlotRange->{0,1},AxesLabel->{"time t","percent spread"}],{{a,1},0,10},{{k,1},0,10}]

A standard manipulate example using the sine function

y=sin(((2 π x)/T)) is the sine function with period T. A standard manipulate example is to plot the sine function and let the T parameter vary in the manipulate control.

Manipulate[Plot[Sin[x*2 Pi/T],{x,-5Pi,5Pi},PlotRange->{-1,1}],{{T,2Pi},0,4Pi}]

Questions for the rumor model:

(a) Find (lim_(t->∞)) (1/(1+a (e^(-k t))))

Limit[p[t,a,k],t->Infinity,Assumptions->{a>0&&k>0}]

(b) Find the rate of spread of the rumor.

"rate of spread of rumor = dp/dt="
D[p[t,a,k],t]
"Limit of rate of change as t->Infinity is:"
Limit[%%,t->Infinity,Assumptions->{a>0&&k>0}]

(c) Interpret a and k

"The initial population fraction that knows the rumor equals:"   
p[0,a,k]
"In order to find a to get initial population percentage (Subscript[p, 0]), set a equal to"
Solve[p0==%%,a]

Example B. Solving a differential equation

For what values of r does y=(e^(r x)) satisfy the equation
	y''+6y'+8y=0?

Define y, take first and second derivatives y' and y''.

y[x_]:=E^(r x);
"y=" y[x]
"y'=" y'[x]
"y''=" y''[x]

Put y and its derivatives into the target equation. Divid through by the common factor (e^(r x)).

y''[x]+6y'[x]+8y[x]==0
(y''[x]+6y'[x]+8y[x])/y[x]==0//Simplify

Solve the differential equation with the prescribed form of y for r all at once:

Solve[y''[x]+6y'[x]+8y[x]==0,r]

Check the answer with r=-2, so that f(x)=(e^(-2 x)).

f[x_]:=E^(-2 x)
f''[x]+6f'[x]+8f[x]