DE.01 Transition from Calculus to DiffEq:
The Exponential Differential Equation
       y'[t]+r y[t]=f[t] 
 LITERACY

Needs["Graphics`Colors`"];
Graphics`Colors`GosiaGreen=RGBColor[0, 0.392187, 0];
Needs["Graphics`FilledPlot`"];
Off[General::spell];
Off[General::spell1];
Off[ParametricPlot3D::ppcom];
Off[ParametricPlot::ppcom];
Off[Solve::ifun];
Off[Plot::plnr];
Needs["Calculus`Master`"];
Off[Unique::"usym"];
SetOptions[Limit,Analytic->True];

CMView = {2.7, 1.6, 1.2};

Off[Graphics::gpt]

New Vector Drawers

(* :Title:  NewVectorDraw  *)
(* :Author: Bruce Carpenter *)
(* :Summary:  Construct 2 and 3 dimensional vectors,
     arrows, and arrowheads as graphics 
     objects.
*)
(* :Date:  Copyright 1997, Math Everywhere, Inc. 
*)
(*  :Drawbacks:  Since the vectors are drawn out of 
     context, the shapes of the arrowheads are only 
     correct with AspectRatio set to Automatic.
*)
BeginPackage["Vector3D`","Graphics`Colors`"];

Axes3D::usage = "Axes3D[a, b] creates a Graphics3D object of cartesian axes with x, y, and z running from -a/3 to a, and with axes labels b units beyond the tips of the axes.  Axes3D[a] is Axes3D[a, a/8].";

Perpend::usage = "Perpend[a] returns a unit vector which is perpendicular to the vector a.";

Arrow::usage = "Arrow[a] produces a 2 or 3 dimensional vector from the origin to a. Arrow[a, Tail -> tail] gives a vector from tail to a.";
	
Vector::usage = "Vector[a, b] gives a 2D or 3D vector from a to b.";

ArrowHead::usage = "ArrowHead[a, vec] produces an arrowhead with its tip placed at the point a, pointing in the direction of the vector vec.";

Tail::usage = "Tail -> point puts the tail of the vector at point.";

Norm::usage = "Norm[vec] returns the Euclidean length of vec.";

Normalize::usage = "Normalize[vec] returns a unit vector in the direction of vec, provided vec is nonzero.";

Aperture::usage = "Aperture is the ratio of the radius of the base to the length of the head of a vector.";

TipSize::usage = "TipSize specifies an absolute size for the inner tip length of the head of a vector.";

TipRatio::usage = "TipRatio is the ratio of the inner length of the arrowhead to the length of the shaft of a vector.";

HeadRatio::usage = "HeadRatio is the ratio of the outer length of the arrowhead to the length of the shaft of a vector.";

HeadSize::usage = "HeadSize specifies an absolute size for the head of a vector.";

ScaleFactor::usage = "ScaleFactor specifies the amount to scale a vector in length and may be either a number or a pure function.";

ZeroVectorPointSize::usage = "ZeroVectorPointSize is the size of the point used to represent a zero vector.";

Options[Vector] = Options[Arrow] = Options[ArrowHead] =
{HeadRatio -> 0.18, TipRatio -> 0.14, Aperture -> 0.3, ScaleFactor -> 1, HeadType -> Polygon, ShaftQ -> True, EdgesQ -> True, VectorColor -> RGBColor[0,0,1], ShaftWidth -> 0.005, ZeroVectorPointSize -> 0.01};
		
Begin["`Private`"];

SetOptions[ParametricPlot,AspectRatio -> Automatic];
SetOptions[Plot,AspectRatio -> Automatic];
SetOptions[Graphics,AspectRatio -> Automatic];

Axes3D[u_,v_] := 
      Graphics3D[{
            {Blue,Line[{{-u/3,0,0},{u,0,0}}]},
                    Text["x",{u + v,0,0}],
            {Blue,Line[{{0,-u/3,0},{0,u,0}}]},
                    Text["y",{0, u + v,0}],
            {Blue,Line[{{0,0,-u/3},{0,0,u}}]},
                    Text["z",{0,0,u + v}]}]; 
Axes3D[u_] := Axes3D[u,u/8];
				
Norm[a_?VectorQ] := N[Sqrt[a.a]];

Normalize[a_?VectorQ] := If[a.a == 0, a, a/Norm[a]];

Perpend[a_?VectorQ] := Normalize[{a[[2]],-a[[1]]}]/;Length[a]==2
Perpend[a_?VectorQ] := Normalize[If[a[[1]]==0,{1,0,0},{0,a[[3]],-a[[2]]}]]/;Length[a]==3

Base3D = Table[{Cos[2 k Pi/8.], Sin[2 k Pi/8.]},{k,0,8}]; 

Vector[from_?VectorQ, to_?VectorQ, opts___] := Module[
   {sq, sw, ht, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, tip},
   {sq, sw, ht, hs, hr, ts, tr, ap, sf, vc, zvps} = {ShaftQ, ShaftWidth, HeadType, HeadSize, HeadRatio, TipSize, TipRatio, Aperture, ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts} /. Options[Vector];
   If[from==to, Return[Graphics[{PointSize[zvps],vc,Point[from]}]]];
   diff = If[NumberQ[N[sf]], sf diff, sf[diff]];
   tip = from + diff;
   If[NumberQ[hs], hr = hs/Norm[diff]; tr = 0.75 hr];
   If[NumberQ[ts], tr = ts/Norm[diff]];
   Graphics[{If[sq,{vc,Thickness[sw],Line[{from,tip - tr diff}]},{}],
      With[{trans = ap hr Norm[diff] Perpend[diff]},
      {vc, Thickness[sw], ht[{tip,
                   (tip - hr diff + trans),
                   (tip - tr diff),
                   (tip - hr diff - trans),tip}]}]}]
] /; Length[from]==Length[to]==2

Vector[from_?VectorQ, to_?VectorQ, opts___] := Module[
   {sq, eq, sw, hs, hr, tr,ap, sf, vc, zvps, diff = to - from, tip},
   {sq, eq, sw, hs, hr, ap, sf, vc, zvps} = {ShaftQ, EdgesQ, ShaftWidth, HeadSize, HeadRatio, Aperture, ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts} /. Options[Vector];
   If[from==to, Return[Graphics3D[{PointSize[zvps],vc,Point[from]}]]];
   diff = If[NumberQ[N[sf]], sf diff, sf[diff]];
   tip = from + diff;
   If[NumberQ[hs], hr = hs/Norm[diff]];
   tr = hr/2;
   Graphics3D[{If[sq,{vc,Thickness[sw],Line[{from,tip-tr diff}]},{}], If[eq, {}, EdgeForm[]], {SurfaceColor[vc],
      With[{temp = Perpend[diff]},
      Polygon[Append[#,tip]]& /@ Partition[(tip - hr diff + #)&/@((ap hr Norm[diff] Base3D) . {temp,Normalize[Cross[temp,diff]]}),2,1]]}}]
] /; Length[from]==Length[to]==3


Arrow[a_, Tail->b_, opts___] := Vector[b,a+b,opts]

Arrow[a_, opts___] := Vector[Table[0,{Length[a]}],a,opts]

ArrowHead[a_, b_, opts___] := Vector[a-b,a,ShaftQ->False,opts]

End[];

EndPackage[];
Null

VectorField and Phase Lines

(*  :Title: VectorAndPhase.m  *)

(*  :Author:  Bill Davis  *)

(*  :Dates:  about March, 1996 *)

(*  :Drawbacks:  I wish someone serious would come and turn these into
                 Really carefully done packages.  *)

BeginPackage["PhaseStuff`","Vector3D`",
		"Utilities`FilterOptions`"];

PhaseLine::usage = "PhaseLine[fcn,{var,a,b},tint,pos]
	makes a vertical phase line for the function, fcn, of the variable, var,
	for the variable going from a to b, with 
	a color given by tint,  at the x-coordinate pos.";
	
PhaseLine3D::usage = "PhaseLIne3D[fcn,{var,a,b},tint,loc]
	makes a vertical phase line for the function, fcn, of the variable, var,
	for the variable going from a to b, with 
	a color given by tint, and base point at loc = {x,y}";
	
VectorField::usage = "VectorField[{function,{var1,a,b,space1},{var2,c,d,space2}]
	will make a vector field of normalized vectors, colored by
	magnitude, for the function of the variables on the
	range {r1,r2} with spacing between points given by 
	{space1, space2}.  If a single function of a single variable is given,
	the vector field {1,f} will be plotted.";
	
StikPikXZ::usage = "StikPikXZ[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
StikPikYZ::usage = "StikPikYZ[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
StikPikXY::usage = "StikPikXY[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
Begin["`Private`"];	

PhaseLine[fcn_,{var_,a_,b_},tint_,pos_:0] := 
	Module[{len,len1,k,zset,zero,zero1,signs,stick,dots,pointers},
	zset = Solve[fcn==0,var];
	zero = If[Length[zset]==0,{},var/.zset];
	zero = Sort[zero];
	zero = Select[zero,((# >= a)&&(# <= b))&];
	zero1 = Sort[Union[zero,{a,b}]];
	len = Length[zero];
	len1 = Length[zero1];
	signs = Table[Sign[fcn/.var->((zero1[[k+1]] + zero1[[k]])/2)],
		{k,1,len1-1}];
	stick = {Thickness[0.007],Line[{{pos,a},{pos,b}}]};
	dots = Point[{pos,#}]&/@zero;
	dots = Join[{PointSize[0.05],tint},dots];
	heads = Table[MakeHead[zero1[[k]],zero1[[k+1]],pos,
		signs[[k]],b-a,tint],{k,1,len1-1}];
	Return[{Graphics[Join[{tint},stick,dots]],heads}]
		]
		
MakeHead[a_,b_,c_,s_,slen_,tint_] := Module[{u,v,w},
	u = Min[2(b-a),3/4 slen];
	Return[ArrowHead[{c,a(.5-s/5)+b(.5+s/5)},
		{0,s u},VectorColor->tint]]]
		
PhaseLine3D[fcn_,{var_,a_,b_},tint_,pos_:{0,0}] := 
	Module[{len,len1,k,zset,zero,zero1,signs,stick,dots,pointers},
	zset = Solve[fcn==0,var];
	zero = If[Length[zset]==0,{},var/.zset];
	zero = Sort[zero];
	zero = Select[zero,((# >= a)&&(# <= b))&];
	zero1 = Sort[Union[zero,{a,b}]];
	len = Length[zero];
	len1 = Length[zero1];
	signs = Table[Sign[fcn/.var->((zero1[[k+1]] + zero1[[k]])/2)],
		{k,1,len1-1}];
	stick = {Thickness[0.007],Line[{{pos[[1]],pos[[2]],a},
		{pos[[1]],pos[[2]],b}}]};
	dots = Point[{pos[[1]],pos[[2]],#}]&/@zero;
	dots = Join[{PointSize[0.03],tint},dots];
	heads = Table[MakeHead3D[zero1[[k]],zero1[[k+1]],pos,
		signs[[k]],b-a,tint],{k,1,len1-1}];
	Return[{Graphics3D[Join[{tint},stick,dots]],heads}]
		]
		
MakeHead3D[a_,b_,c_,s_,slen_,tint_] := Module[{u,v,w},
	u = Min[2(b-a),1/2 slen];
	Return[ArrowHead[{c[[1]],c[[2]],a(.5-s/5)+b(.5+s/5)},
		{0,0,s u},VectorColor->tint]]]
		
		
VectorField[function_List,{var1_,a_,b_,sp1_:1},{var2_,c_,d_,sp2_:1}] := 
	Module[{i,j,U,V,UU,VV,ulow,uhigh,vlow,vhigh,maxval,minval,
		lengths,directions,locations,mlen},
	mlen = Min[sp1,sp2];
	normf[uu_,vv_] = Sqrt[function[[1]]^2+function[[2]]^2]/.
		{var1->uu,var2->vv};
	lengths = Table[N[normf[U,V]],{U,a,b,sp1},{V,c,d,sp2}];
	maxval = Max[lengths]; minval = Min[lengths];
	If[minval == maxval,maxval += 1];
	locations = Table[{uu,vv},{uu,a,b,sp1},
		{vv,c,d,sp2}];
	directions = Table[If[N[normf[U,V]]==0,{0,0},
		mlen (function/.{var1->U,var2->V})/(1.3 N[normf[U,V]])],
			{U,a,b,sp1},{V,c,d,sp2}];
	{UU,VV} = Dimensions[directions][[{1,2}]];
	Return[Table[Arrow[directions[[i,j]],
			Tail->locations[[i,j]],Aperture->1,
			HeadRatio->.4,ShaftWidth->0.008, VectorColor->
			RGBColor[(lengths[[i,j]] - minval)/(maxval-minval),0,
				(maxval -lengths[[i,j]])/(maxval-minval)]],{i,UU},{j,VV}]]
		]
		
VectorField[function_,{var1_,a_,b_,sp1_:1},{var2_,c_,d_,sp2_:1}] :=
	VectorField[{1,function},{var1,a,b,sp1},{var2,c,d,sp2}]
	
	
Needs["Utilities`FilterOptions`"]

FixOptions[a_] := Module[{picture = a, opt3},
If[Options[picture] != {}, 
	opt3 = FilterOptions[Graphics3D,#]&/@Options[picture];
	(* Fix things that might carry 2D characteristics. *)
	opt3 = opt3//. {(AxesLabel -> _) ->(AxesLabel -> None),
			(PlotRange->_) -> (PlotRange->Automatic),
			(PlotRegion -> _) -> (PlotRegion -> Automatic),
			(Ticks -> _) -> (Ticks -> Automatic)};
	picture = Apply[List,picture];
	picture[[-1]] = opt3;
	picture = Apply[Graphics3D,picture]];
	Return[picture]
	]

StikPikXZ[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{u,a,v}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]


StikPikYZ[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{a,u,v}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]


StikPikXY[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{u,v,a}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]
		
End[];

EndPackage[];
Null

ThreeAxes[u,v]

ThreeAxes[u_,v_] := 
      Graphics3D[{
            {Blue,Line[{{-u,0,0},{u,0,0}}]},
                    Text["x",{u + v,0,0}],
            {Blue,Line[{{0,-u,0},{0,u,0}}]},
                    Text["y",{0, u + v,0}],
            {Blue,Line[{{0,0,0},{0,0,u}}]},
                    Text["z",{0,0,u + v}]}]; 
ThreeAxes[u_] := ThreeAxes[u,u/8];
ThreeAxes::usage = "ThreeAxes[a,b] makes a standard cartesian axis graphics object
	with x, y, and z running from -a to a, and with axis
	labels b units beyond the tips of the axes.  ThreeAxes[a]
	is ThreeAxes[a,a/8].";

Crisscross

Clear[x];
crisscross = Plot[{Cos[x],Sin[x]},{x,Pi/8,3 Pi/8},
    PlotStyle->{{RGBColor[1,0,0],Thickness[0.02]}},
    Axes->None,AspectRatio->1/3,
    DisplayFunction->Identity];

Pendulum Stuff

modticksX[gr_Graphics,m_] :=
   Module[{f,x},
     f[{a_,"",st___}] := {a,""};
     f[{a_,b_,st___}] := {a,b m};
     Show[gr,
        AxesOrigin->Reverse[FullOptions[gr,AxesOrigin]],
        Ticks->{Map[f,FullOptions[gr,Ticks][[1]]],
                Automatic}]
]

modticksY[gr_Graphics,m_] :=
   Module[{f,x},
     f[{a_,"",st___}] := {a,""};
     f[{a_,b_,st___}] := {a,b m};
     Show[gr,
        AxesOrigin->Reverse[FullOptions[gr,AxesOrigin]],
        Ticks->{Automatic,
                Map[f,FullOptions[gr,Ticks][[2]]]
               }]
]

Clear[center,angle,length,a,l,pendulum,calibratedpendulum];

pendulum[length_,angle_]:=
Module[
{center:={length Sin[Pi-angle],length Cos[Pi-angle]}},

Show[

Graphics[{Blue,Thickness[.01],
Line[{{0,0},{0,-(length+3)}}]}],

Graphics[{Blue,
Polygon[{{-5,-(length+3)},{-5,-(length+3.5)},{-5.3,-(length+3.5)},
{-5.3,-(length+4)},{5.3,-(length+4)},{5.3,-(length+3.5)},
{5,-(length+3.5)},{5,-(length+3)},{-5,-(length+3)}}]}],

Graphics[{Black,
Disk[{0,0},length,{(-Pi/2+angle-Pi/84),(-Pi/2+angle+Pi/84)}]}],

Graphics[{Black,
Disk[center,length,{(Pi/2+angle-Pi/500),(Pi/2+angle+Pi/500)}]}],

Graphics[{Red,PointSize[.05],Point[{0,0}]}],

Graphics[{Red,
Disk[center,length/5,{0,360 Degree}]}],

Graphics[{GoldenrodLight,
Disk[center,length/6,{330 Degree,350 Degree}]}],

Graphics[{Red,
Disk[center,length/7,{0,360 Degree}]}],

Graphics[{Black,PointSize[.02],Point[center]}],


AspectRatio->Automatic,
PlotRange->{{length+5,-(length+3)},{(length+4),-(length+4)}},
AxesOrigin->{0,0},
DisplayFunction->Identity]
]

calibratedpendulum[length_,angle_]:=
Module[
{center:={length Sin[Pi-angle],length Cos[Pi-angle]}},

Show[

Graphics[{Blue,Thickness[.01],
Line[{{0,0},{0,-(length+3)}}]}],

Graphics[{Blue,
Polygon[{{-5,-(length+3)},{-5,-(length+3.5)},{-5.3,-(length+3.5)},
{-5.3,-(length+4)},{5.3,-(length+4)},{5.3,-(length+3.5)},
{5,-(length+3.5)},{5,-(length+3)},{-5,-(length+3)}}]}],

Graphics[{Black,
Disk[{0,0},length,{(-Pi/2+angle-Pi/84),(-Pi/2+angle+Pi/84)}]}],

Graphics[{Black,
Disk[center,length,{(Pi/2+angle-Pi/500),(Pi/2+angle+Pi/500)}]}],

Graphics[{Red,PointSize[.05],Point[{0,0}]}],

Graphics[{Red,
Disk[center,length/5,{0,360 Degree}]}],

Graphics[{GoldenrodLight,
Disk[center,length/6,{330 Degree,350 Degree}]}],

Graphics[{Red,
Disk[center,length/7,{0,360 Degree}]}],

Graphics[{Black,PointSize[.02],Point[center]}],

Graphics[Text[StringForm["y[t] =  ``",angle],
{8 length/8 Sin[15 Pi/12], 8 length/8 Cos[5Pi/6]}]],

AspectRatio->Automatic,
PlotRange->{{length+5,-(length+3)},{(length+4),-(length+4)}},
AxesOrigin->{0,0},DisplayFunction->Identity]
]

L.1)

Here are three diffeq's:
a) y'[t]+0.2 y[t]=0 
b) y'[t]-0.2 y[t]=0
c) y'[t]+0.1 y[t]=0.
Which of these diffeqs is solved by
         y[t] = 13 (E^(-0.2 t)) ?

L.2)

Here are three diffeq's:
a) y'[t]+ y[t]=(E^(2 t)) 
b) y'[t]-y[t]=(E^(2 t))
c) y'[t]=(E^(2 t)).
Which of these diffeqs is solved by
         y[t] = 4 (E^t) +  (E^(2 t)) ?

L.3)

Here are three diffeq's:
a)  y'[t]+2  t y[t]=0 
b)  y'[t]-2  t y[t]=0
c)  y'[t]+ y[t]=0.
Which of these diffeqs is solved by
         y[t] = 8 (E^(-(t^2))) ?

L.4)

Here are three diffeq's:
a)  y''[t]+4 y[t]=0 
b)  y''[t]+9 y[t]=0
c)  y''[t]+16 y[t]=0.
Which of these diffeqs is solved by
         y[t] = 5 Sin[3 t] ?

L.5)

Just to see that you can handle yourself away from the machine, come up with formulas for the solutions of the following diffeqs:
a) y'[t]+0.3 y[t]=5 (E^(-t)) with y[0] = 5.
b) y'[t]- 0.3 y[t]=5  with y[0] = 1. 
c) y'[t]+ y[t]=DiracDelta[t  -  3] with y[0] = 2.

L.6)

You know that y'[t]=a y[t] for all x's and you know that a is positive and that y[0] is positive.  Does y[t] go up or down as t advances from left to right?

L.7)

If a is negative , does the solution of   y'[t]=a y[t]  with y[0] = 10 go up or down as t advances from left to right. Can the soution ever go negative?
Why or why not?

L.8)

The solution y[t] of
          y'[t]+r y[t]=f[t] with y[0] = starter
 is given by
         y[t]  =  
        (E^(-r t)) starter + 
          (E^(-r t)) 
            (∫_0^t) (E^(r t)) f[t] 
                dt . 
Explain this:
If r > 0, then, no matter what starter is, the plot of y[t] will eventually merge with the plot of
            y0[t]  =  
        (E^(-r t)) 
          (∫_0^t) (E^(r t)) f[t] 
              dt .

L.9)

Here are three plots of solutions of a certain forced exponential diffeq:

\(r = \ 0.6; 
f[t_] = 4\ Sin[2.5\ t]\  + \ Cos[2\ t]; 

    endtime\  = \ 20; 

Clear[y, y1, y2, y3, t]; 
starter1 = 7; 

    starter2 = 0; 
\(starter3 = \(-6\); \); 

    y1[t_] = E\^\(\(-r\)\ t\)\ starter1 + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\); 

    y2[t_] = E\^\(\(-r\)\ t\)\ starter2 + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\); 

    y3[t_] = E\^\(\(-r\)\ t\)\ starter3 + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\); 


    plots1 = Plot[{y1[t], y2[t], y3[t]}, {t, 0, endtime}, 
        PlotStyle 
          -> {{Thickness[0.018], Blue}, {Thickness[0.014], Red}, {
              Thickness[0.01], CadmiumOrange}}, PlotRange -> All, 
        AspectRatio -> Automatic, AxesLabel -> {"t", ""}]; 
    \)

You are given that all three plots are all either solutions of
a)   y'[t]+0.6 y[t]=4 Sin[2.5 t] +  Cos[2 t]
or solutions of
b)   y'[t]-0.6 y[t]=4 Sin[2.5 t] +  Cos[2 t].
Make your choice and say how you arrived at it.

L.10)

The solution y[t] of
          y'[t]+r y[t]=f[t] with y[0] = starter
 is given by
         y[t]  =  
        (E^(-r t)) starter + 
          (E^(-r t)) 
            (∫_0^t) (E^(r t)) f[t] 
                dt . 
Explain this:
If r < 0  then, unless starter = 0, the plot of y[t] will NOT eventually merge with the plot of
            y0[t]  =  
        (E^(-r t)) 
          (∫_0^t) (E^(r t)) f[t] 
              dt .

L.11)

Here are three plots of solutions of a certain forced exponential diffeq:

\(r = \ \(-0.15\); 
f[t_] = \ Sin[1.5\ t]\  + \ 2  Sin[1.7\ t]; 

    endtime\  = \ 20; 

Clear[y, y1, y2, y3, t]; 
starter1 = 7; 

    starter2 = 0; 
\(starter3 = \(-6\); \); 

    y1[t_] = E\^\(\(-r\)\ t\)\ starter1 + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\); 

    y2[t_] = E\^\(\(-r\)\ t\)\ starter2 + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\); 

    y3[t_] = E\^\(\(-r\)\ t\)\ starter3 + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\); 


    plots1 = Plot[{y1[t], y2[t], y3[t]}, {t, 0, endtime}, 
        PlotStyle 
          -> {{Thickness[0.018], Blue}, {Thickness[0.014], Red}, {
              Thickness[0.01], CadmiumOrange}}, PlotRange -> All, 
        AspectRatio -> 1/GoldenRatio, 
        AxesLabel -> {"t", ""}]; \)

You are given that all three plots are all either solutions of
a)   y'[t]+0.15 y[t]= Sin[1.5 t]  +  2  Sin[1.7 t]
or solutions of
b)   y'[t]-0.15 y[t]= Sin[1.5 t]  +  2  Sin[1.7 t].
Make your choice and say how you arrived at it.

L.12)

Here are plots of the solutions of
        diffeq a):    y'[t]+0.01 y[t]=0
        diffeq b):   y'[t]+ 0.3  y[t]=0,
        diffeq c):   y'[t]+ 1.3 y[t]=0,
        diffeq d):   y'[t]+ 2.3 y[t]=0,
all with the same starter y[0] = 7.
The plots are not in order.  Your job is to match the differential equation with the plot of its solution.

\(Clear[y1, y2, y3, y4, t]; 
y1[t_]\  = \ 7\ E^\((\(-0.1\)\ t)\); 

    y2[t_]\  = \ 7\ E^\((\(-0.3\)\ t)\); 

    y3[t_]\  = \ 7\ E^\((\(-1.3\)\ t)\); 

    y4[t_]\  = \ 7\ E^\((\(-2.3\)\ t)\); 
	endtime = 12; 

    one\  = Plot[y4[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.02], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {0, 7}, 
        PlotLabel -> "Plot A", DisplayFunction -> Identity]; 

    two\  = Plot[y2[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.02], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {0, 7}, 
        PlotLabel -> "Plot B", DisplayFunction -> Identity]; 

    three\  = 
      Plot[y1[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.02], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {0, 7}, 
        PlotLabel -> "Plot C", DisplayFunction -> Identity]; 

    four\  = Plot[y3[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.02], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {0, 7}, 
        PlotLabel -> "Plot D", DisplayFunction -> Identity]; 

    Show[GraphicsArray[{{one, two}, {three, four}}]]; \)

diffeq a) ------> Plot.......          diffeq b) ------> Plot.......
               diffeq c) ------> Plot.......          diffeq d) ------> Plot.......

L.13)

Do you expect solutions of 
         y'[t]-0.6 y[t]=0
to decay to 0 as t gets large?
Why or why not?

L.14)

Here are plots of solutions of the forced exponential diffeq
        y'[t]+0.8  y[t]=f[t]
with
        y[0] = 4.0 
for five choices of forcing functions f[t]:

\(\(r = \ 0.8; 
f[t_] = \ Sin[1.5\ t]\  + \ 2  Sin[1.7\ t]; 

    endtime\  = \ 20; 

Clear[y, y1, y2, y3, y4, f1, f2, f3, f4, t]; 
\ \ 
    f1[t] = 0.2  t; 
\ \ \ f2[t] = 5\ DiracDelta[t - 6]; 
\ \ \ 
    f3[t] = 2.3\ E\^\(\(-0.1\)\ t\)\ Cos[t]; 
\ \ \ f4[t] = 5\ Sin[2\ t]; 

    starter\  = \ 4.0; 

    y1[t_] = E\^\(\(-r\)\ t\)\ starter + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t E\^\(r\ t\)\ f1[t] \[DifferentialD]t\); 

    y2[t_] = E\^\(\(-r\)\ t\)\ starter + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t E\^\(r\ t\)\ f2[t] \[DifferentialD]t\); 

    y3[t_] = E\^\(\(-r\)\ t\)\ starter + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t E\^\(r\ t\)\ f3[t] \[DifferentialD]t\); 

    y4[t_] = E\^\(\(-r\)\ t\)\ starter + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t E\^\(r\ t\)\ f4[t] \[DifferentialD]t\); 


	
    endtime = 20; 

    one\  = Plot[y3[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.03], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {\(-4\), 7}, 
        PlotLabel -> "Plot A", DisplayFunction -> Identity]; 

    two\  = Plot[y4[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.03], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {\(-4\), 7}, 
        PlotLabel -> "Plot B", DisplayFunction -> Identity]; 

    three\  = 
      Plot[y1[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.03], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {\(-4\), 7}, 
        PlotLabel -> "Plot C", DisplayFunction -> Identity]; 

    four\  = Plot[y2[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.03], Red}}, 
        AxesLabel -> {"t", ""}, PlotRange -> {\(-4\), 7}, 
        PlotLabel -> "Plot D", DisplayFunction -> Identity]; 

    Show[GraphicsArray[{{one, two}, {three, four}}]]; 

\)\)

The four forcing functions f[t] used in these plots are:
         \(\(\ \ \ f1[t] = 0.2  t, 
\ \ \ f2[t] = 5\ DiracDelta[t - 6], 
\ \ \ 
      f3[t] = 2.3\ E\^\(\(-0.1\)\ t\)\ Cos[t], 
\ \ \ 
      f4[t] = 5\ \(Sin[2\ t] . \)\)\): 
 Your job is to match the plots to the forcing functions:
            f1[t]--------------> Plot.....      f2[t]--------------> Plot.....
            f3[t]--------------> Plot.....      f4[t]--------------> Plot.....

L.15)

Give the formula for the solution of  
        y'[x]=0.2 y[x] with  y[0] = 1
and pencil in a rough sketch of the solution on the axes below.

\(Clear[f, x]; 
f[x_] = E\^\(0.2\ x\); 

    \(Show[Graphics[Line[{{0, 0}, {13, 0}}]], 
      Graphics[{Red, PointSize[0.05], Point[{4, f[4]}]}], 
      PlotRange -> {\(-0.5\), 14}, Axes -> True, 
      AxesLabel -> {"x", "y"}, AspectRatio -> Automatic]; 
    \)\)

L.16)

Give the formula for the solution of  
        y'[x]=-0.5 y[x] with  y[0] = 6
and pencil in a rough sketch of the solution on the axes below.

\(Clear[f, x]; 
f[x_] = 6\ E\^\(\(-0.5\)\ x\); 
    Show[Graphics[Line[{{0, 0}, {8, 0}}]], 
      Graphics[{Red, PointSize[0.04], Point[{2, f[2]}]}], 
      PlotRange -> {\(-0.5\), 8}, Axes -> True, 
      AxesLabel -> {"x", "y"}, AspectRatio -> Automatic]; 
    \)

L.17)

You are given that 
         y[t] = 37.3 (E^(-0.045 t))
Write down a differential equation that y[t] solves.
Include starter data.

L.18)

Here are plots of solutions of
       y'[t]=0.6 y[t] with y[0] = 2
 and
      y'[t]=0.6 y[t] (1 - y[t]/100) with y[0] = 2 :

Clear[logisticy, expy, x, r, b];
DSolve[logisticy'[x]==r logisticy[x] (1 - logisticy[x]/b),logisticy[x],x];
thisr = 0.6; 
      thisb = 100; Clear[x, r, b, y];
solution=DSolve[logisticy'[x]==r logisticy[x] (1 - logisticy[x]/b),logisticy[x],x]/.{r -> thisr, b -> thisb};
Clear[y]; 
      logisticy[x_] = 
      logisticy[x] /. solution[[1]]; Csol = Solve[logisticy[0] == 2, C[1]]; logisticy[x_] = 
      logisticy[x] /. Csol[[1]]; expy[x_] = 2 (E^(0.6 x)); Plot[{expy[x], logisticy[x]}, {x, 0, 6}, AspectRatio ->  .5, 
      PlotStyle -> {{Red, Thickness[0.01]}, {Blue, Thickness[0.01]}}, 
      AxesLabel -> {"t", ""}];

Explain why as t advances from 0, the plots of both of these solutions had no choice but to share a lot of ink initially.
Explain why for larger t's, the plots had no choice but to pull apart, with one plot eventually sailing way above the other.

L.19)

Here are six plots:  They are plots of:
     a.  a solution of y'[x]=r y[x] with  r > 0.
     b.  a solution of y'[x]=r y[x] with  r < 0.
     c.  none of the above
   
 Which is which?

\(Clear[y, x, r, b]; 
r\  = \ 0.6; 
b\  = \ 65; 

    sol\  = \ NDSolve[{\(y'\)[x]\  == \ r\ y[x]\ \((1 - \((y[x]/b)\))\), \ 
          y[0]\  == \ 2}, y[x], {x, 0, 20}]; 
y[x_]\  = \ y[x] /. sol; 


    one\  = \ Plot[y[x], {x, 0, 12}, PlotStyle -> {{Red, Thickness[0.04]}}, 
        AspectRatio -> 0.5, 
		AxesLabel -> {"x", "y[x]"}, 
        PlotLabel -> "Plot 1", DisplayFunction -> Identity]; 

    two\  = \ Plot[2\ E\^\(0.4\ x\), {x, 0, 20}, 
        AxesLabel -> {"x", "y[x]"}, PlotRange -> All, 
        AxesOrigin -> {0, 2}, 
        PlotStyle -> {{Red, Thickness[0.04]}}, AspectRatio -> 1/2, 
        PlotLabel -> "Plot 2", DisplayFunction -> Identity]; 

    three\  = \ 
      Plot[9\ E\^\(\(-0.4\)\ x\) - 2, {x, 0, 40}, 
        AxesLabel -> {"x", "y[x]"}, PlotRange -> All, 
        AxesOrigin -> {0, 0}, 
        PlotStyle -> {{Red, Thickness[0.04]}}, AspectRatio -> 1/2, 
        PlotLabel -> "Plot 3", DisplayFunction -> Identity]; 

    four\  = \ 
      Plot[9\ E\^\(\(-0.4\)\ x\) + \(2\ Sin[x\/2]\^2\)\/\(1 + x\/6\), {x, 0, 
          40}, AxesLabel -> {"x", "y[x]"}, 
        PlotRange -> All, AxesOrigin -> {0, 0}, 
        PlotStyle -> {{Red, Thickness[0.04]}}, AspectRatio -> 1/2, 
        PlotLabel -> "Plot 4", DisplayFunction -> Identity]; 

    five\  = Plot[9\ E\^\(\(-0.4\)\ x\), {x, 0, 40}, 
        AxesLabel -> {"x", "y[x]"}, PlotRange -> All, 
        AxesOrigin -> {0, 0}, 
        PlotStyle -> {{Red, Thickness[0.04]}}, AspectRatio -> 1/2, 
        PlotLabel -> "Plot 5", DisplayFunction -> Identity]; 



    six\  = \ Plot[12\ E^\((\(-0.08\)\ x)\), {x, 0, 60}, 
        PlotStyle -> {{Red, Thickness[0.04]}}, AspectRatio -> 0.5, 
		
        AxesLabel -> {"x", "y[x]"}, PlotLabel -> "Plot 6", 
        PlotRange -> All, DisplayFunction -> Identity]; 

    Show[GraphicsArray[{{one, two}, {three, four}, {five, six}}]]; \)

Plot 1 ---->............    Plot 2 ---->............     Plot 3 ---->............
               Plot 4 ---->............    Plot 5 ---->............     Plot 6 ---->............

L.20)

a) You are given a solution  y[t] of   
        y'[t]+5 y[t]=6 DiracDelta[t  -  4.7]
\(What\ happens\ to\ y[t]\ \ at\ \ t\  = \ 
                4.7?
		
b\))  How does your response indicate that        DiracDelta[t - 4.7]  ≠  
          2 DiracDelta[t - 4.7] ?

L.21)

Here is the part of the plot of the solution of
              y'[t]+1.9 y[t]=5 DiracDelta[t - 3] with y[0] = 5.
Your job is to sketch in the rest of the plot.

Plot[5 E^(-1.9 t), {t, 0, 4}, 
      PlotStyle -> {{Red, Thickness[0.01]}}, PlotRange -> {{0, 8}, {0, 5}}, 
      AxesOrigin -> {0, 0}, AxesLabel -> {"t", "y[t]"}];

L.22)

a) Write down the values of
       (∫_0^4.99999) DiracDelta[t - 5] dt
       (∫_0^5.00001) DiracDelta[t - 5] dt
       (∫_5.00001^(100 ))  
        DiracDelta[t - 5] dt.
       
b) Write down the values of
       (∫_0^2.99999) 
        (E^t) DiracDelta[t - 3] dt
       (∫_2.999999^3.000001)  
        (E^t) DiracDelta[t - 3] dt
       (∫_3.00001^(100000 ))   
        (E^t) DiracDelta[t - 3] dt
      
c) Here's a plot of UnitStep[t - 2]:

\(Clear[t]; 

    Plot[UnitStep[t - 2], {t, 0, 6}, 
      PlotStyle -> {{Blue, Thickness[0.015]}}, 
      AxesLabel -> {"t", ""}, AspectRatio -> 1\/3]; \)

And here's a plot of UnitStep[t - 4]:

\(Clear[t]; 

    Plot[UnitStep[t - 4], {t, 0, 6}, 
      PlotStyle -> {{Blue, Thickness[0.015]}}, 
      AxesLabel -> {"t", ""}, AspectRatio -> 1\/3]; \)

Digest the two plots and explain the result of this Mathematica calculation:

\(Clear[t, x]; 

    ∫\_0\%t\( Sin[x]\ DiracDelta[x - 5]\) \[DifferentialD]x\)