Initialization Cells (Code Needed for Most Plot3D Statements)

ticks[min_,max_]:=Join[
Table[{i,If[i==0, ,Style[i,12]],{0.01,0}},{i,Ceiling[min],Floor[max], 2}],(* Numbered ticks *)
Table[{j, ,{0.01,0}},{j,Round[min],Round[max-1],1}]]         (* Un-numbered ticks *)


(* 2D Options *)
SetOptions[
Plot,
ImageSize->350,
AxesOrigin->{0,0},
AspectRatio->1,
AxesStyle->Directive[Medium, Bold],
Ticks->ticks
];

SetOptions[
ParametricPlot,
ImageSize->350,
AxesOrigin->{0,0},
AspectRatio->1,
AxesStyle->Directive[Medium, Bold],
Ticks->ticks
];

SetOptions[
VectorPlot,
ImageSize->350,
AxesOrigin->{0,0},
AspectRatio->1,
Axes->True,
Frame->False,
AxesStyle->Directive[Medium, Bold],
Ticks->ticks
];

(* 3D Options *)

SetOptions[
Plot3D,
ImageSize->600,
BoxRatios->1,Boxed->False,AxesOrigin->{0,0,0},
AxesStyle->Directive[Medium, Bold],
Ticks->ticks, 
Mesh->None,
ViewPoint->{2,0.9,1},
ViewVertical->{0,0,1}
];

SetOptions[
ContourPlot3D,
ImageSize->600,
BoxRatios->1,Boxed->False,AxesOrigin->{0,0,0},
AxesStyle->Directive[Medium, Bold],
Ticks->ticks, 
Mesh->None,
ViewPoint->{2,0.9,1},
ViewVertical->{0,0,1}
];

SetOptions[
ParametricPlot3D,
ImageSize->600,
BoxRatios->1,Boxed->False,AxesOrigin->{0,0,0},
AxesStyle->Directive[Medium, Bold],
Ticks->ticks, 
Mesh->None,
ViewPoint->{2,0.9,1},
ViewVertical->{0,0,1}
];

SetOptions[
RegionPlot3D,
ImageSize->600,
BoxRatios->1,Boxed->False,AxesOrigin->{0,0,0},
AxesStyle->Directive[Medium, Bold],
Ticks->ticks, 
Mesh->None,
ViewPoint->{2,0.9,1},
ViewVertical->{0,0,1}
];

SetOptions[
VectorPlot3D,
ImageSize->350,
AxesOrigin->{0,0,0},
AspectRatio->1,
BoxRatios->1,
Axes->True,
AxesStyle->Directive[Medium, Bold],
Ticks->ticks,
ViewPoint->{2,0.9,1},
ViewVertical->{0,0,1}
];

SetOptions[
RevolutionPlot3D,
ImageSize->350,
AxesOrigin->{0,0,0},
AspectRatio->1,
BoxRatios->1,
Boxed->False,
Axes->True,
AxesStyle->Directive[Medium, Bold],
Ticks->ticks,
ViewPoint->{2,0.9,1},
ViewVertical->{0,0,1}
];

First Order Differential Equations

Existence and Uniqueness of Solutions

Existence Theorem

Suppose f(t,y) is a continuous function in a rectangle of the form {(t,y)|a<t<b, c<y<d} in the t y -plane.  If ((Subscript[t, 0]),(Subscript[y, 0]))  is a point in this rectangle, then there exists an ϵ>0 and a function y(t) defined for (Subscript[t, 0])-ϵ<t<(Subscript[t, 0])+ϵ that solves the initial value problem

({{({{(dy/dt)=f(t,y),       y((Subscript[t, 0]))=(Subscript[y, 0]).}})}})

Example

Consider the differential equation

({{({{(dy/dt)=3 (y^(2/3)),    y(0)=0.}})}})

Find all solutions.  What is the domain of existence?  How large can ϵ be in the existence theorem?

Example

Consider the differential equation

({{({{(dy/dx)=(y/(1-x)),    y(0)=1.}})}})

Find all solutions.   What is the domain of existence?  How large can ϵ be in the existence theorem?

Uniqueness Theorem

Suppose f(t,y) and ((∂f)/(∂y)) are continuous functions in a rectangle of the form {(t,y)|a<t<b, c<y<d} in the t y -plane.  If ((Subscript[t, 0]),(Subscript[y, 0]))  is a point in this rectangle and if (Subscript[y, 1])(t) and (Subscript[y, 2])(t) are two functions that solve the initial-value problem,

({{({{(dy/dt)=f(t,y),       y((Subscript[t, 0]))=(Subscript[y, 0]).}})}})

for all t in the interval (Subscript[t, 0])-ϵ<t<(Subscript[t, 0])+ϵ (where ϵ is a positive number), then

({{({{(Subscript[y, 1])(t)=(Subscript[y, 2])(t)}})}})

for  (Subscript[t, 0])-ϵ<t<(Subscript[t, 0])+ϵ.  That is, the solution to the initial-value problem is unique.

Example

Consider the differential equation

({{({{(dy/dt)=(y+1)  (y-1).}})}})

Find any solutions.

Apart[1/((y+1) (y-1))]

Why does this not violate the uniqueness theorem?

Consider the initial condition y(0)=(1/2).   Find this solution.  Is it unique?

Consider the direction field.  For 0<y(0)=(Subscript[y, 0])<1, what happens as t->∞?  Can you prove this?

points={{0,1}, {0,1/2}, {0,0},{0, -1},{0,3/2},{0,-3/2}};
VectorPlot[
{1, (y+1) (y-1)}, {t, -2, 2}, {y, -2, 2},
AxesLabel->{t,y},
Axes->True,
VectorScale->{Small, Small, None},
VectorStyle->Gray,
StreamPoints->points,
StreamStyle->{Blue, Thick, "Line"},
StreamScale->Full,
PlotLabel->"Direction Field Using Particular Solution Curves",
Epilog->{PointSize[Large], Point[points]}
]

Suppose you have two solutions based upon 0<(Subscript[y, 1])(0)<1 and 0<(Subscript[y, 2])(0)<1.  If (Subscript[y, 1])(0) < (Subscript[y, 2])(0), sketch the two curves below.

points={{0,1},  {0,-1}};
VectorPlot[
{1, (y+1) (y-1)}, {t, -2, 2}, {y, -1.5, 1.5},
AxesLabel->{t,y},
Axes->True,
VectorScale->{Small, Small, None},
VectorStyle->Gray,
StreamPoints->points,
StreamStyle->{Blue, Thick, "Line"},
StreamScale->Full,
PlotLabel->"Direction Field Using Particular Solution Curves",
Epilog->{PointSize[Large], Point[points]}
]

D[y^2 t^3+y Cos[t], t]
D[y^2 t^3+y Cos[t], y]

Homework - For Software, Use Mathematica.  You need to learn some programming, so use the code I have provided!  In particular, stay away from DSolve and NDSolve.

Pages:		    71 - 74
Problems:	    1 - 10 ALL, 13, 14, 17, 18

Equilibria and the Phase Line

Definitions

Suppose that (dy/dt)=f(y), that is we have an autonomous differential equation.  Then

The solutions for f(y)=0 are called critical numbers,c.

We say that y(t)≡c is an equilibrium solution.

Note that this is true because (dc/dt)=0=f(c).

We say that the equilibrium solution is stable if for every   ϵ>0, there exists δ > 0, such that  |y(0)-c|<δ   ⟹    |y(t)-c|<ϵ,    ∀t > 0.

Otherwise we say it is unstable.

An equilibrium point c is a sink if any solution with initial condition sufficiently close to c is asymptotic to c as t increases.  This is sometimes called local asymptotic stability.

An equilibrium point c is a source if all solutions that start sufficiently close to c tend toward c as t decreases.  Note that this implies it is unstable.

An equilibrium point that is neither a source nor a sink is called a node.

A phase line is a graphical representation of sinks, sources, and nodes.

Example

Consider the differential equation (dy/dt)=0.1  y(y-1) (((2+y))^2) (3-y).

Find the critical numbers.

Classify the stability of the equilibria using a phase line.

Classify the stability of the equilibria using a direction field.

theDE=0.1  y *(y-1)* (2+y)^2* (3-y);
ivp={{0,4}, {0,0.75}, {0, -2.5}, {0,1.25}, {0, -1.75}};

Show[
VectorPlot[{1, theDE}, {t, -0.1,3}, {y, -4,4.5},
AxesLabel->{t,y},
Axes->True,
VectorScale->{Tiny, Tiny, None}, VectorStyle->Gray,
StreamScale->Full,
StreamStyle->{Blue, Thick, "Line"},
StreamPoints->{ivp},
PlotLabel->"Direction Field with a Phase Line",
Epilog->{PointSize[Large], Point[ivp]}
],
Plot[{-2,0,1,3}, {t, -.1, 3}, PlotStyle->{{Red, Thick, Dashed},{Red, Thick, Dashed},{Red, Thick, Dashed},{Red, Thick, Dashed}}],
ContourPlot[
t==-0.5, {t, -2.5,3}, {y, -4, 4.5},
ContourStyle->{Thick, Darker[Green]}],
Graphics[{PointSize[Large],Red,Point[{-0.5,3}]}],
Graphics[{PointSize[Large],Red,Point[{-0.5,1}]}],
Graphics[{PointSize[Large],Red,Point[{-0.5,0}]}],
Graphics[{PointSize[Large],Red,Point[{-0.5,-2}]}],
PlotRange->{{-0.75,3}, {-4, 4.5}}
]

Example

Use a phase line to construct sample solution curves for the differential equation (dy/dt)=(((y+1))^2) (y-2).

Show[
Plot[0,{x,-0.25, 3}, 
AxesLabel->{t,y}],
ContourPlot[
t==-0.5, {t, -2.5,3}, {y, -4, 4.5},
ContourStyle->{Thick, Darker[Green]}],
Graphics[{PointSize[Large],Red,Point[{-0.5,2}]}],
Graphics[{PointSize[Large],Red,Point[{-0.5,-1}]}],
PlotRange->{{-0.75,3}, {-4, 4.5}}
]

Linearlization Theorem

Suppose c is an equilibrium point of the differential equation (dy/dt)=f(y) where f  is a continuously differentiable function. Then,

If f'(c)<0, then c is a sink.  That is, it is locally asymptotically stable.

If f'(c)>0, then c is a source. Hence, it is unstable (and not locally asymptotically stable).

If f'(c)=0, then the test fails.  Sad.

Example

Classify the equilibria of the differential equation (dy/dt)=(((y+1))^2) (y-2) using the linearlization theorem.

Homework - For Software, Use Mathematica.  You need to learn some programming, so use the code I have provided!  In particular, stay away from DSolve and NDSolve.

Pages:		    89 - 94
Problems:	    1, 2, 3, 5, 6, 10, 11, 13, 14, 15, 22, 28, 30, 31, 34, 37, 38, 39

Bifurcations

Harvesting a Logistic Population

Suppose that a > 0 and b > 0.  Let h≠0.   Then the general harvesting (or stocking) problem is given by

({{({{(dx/dt)=a x-b (x^2)-h}, {=k x (M-x) - h}, {=((-k x)^2)+k M x - h=f(x)}})}})

where if
	h>0, then we have harvesting at a constant rate
	h<0, then we have stocking at a constant rate.

Note that

({{({{f(x)=0   ⟺    x=((-k M ±(Sqrt[(((k M))^2)-4 k h]))/(2(-k)))=((M ∓ (Sqrt[(M^2)-((4 h)/k)]))/2)}}).}})

Hence, we have two real solutions if and only if

({{({{(M^2)-((4 h)/k)> 0    ⟺      ((k (M^2))/4)}}) > h.}})

Therefore, we can always choose h small enough so that this occurs.

Note that when ((k (M^2))/4)=h, then we obtain one real solution.  When ((k (M^2))/4)<h, then we obtain two complex solutions.  A parameter, like h, that controls the qualitative nature (number and stability) of the solutions is called a bifurcation parameter.  A number, like h=((k (M^2))/4), where these changes occur is called a bifurcation point or bifurcation value.
So, choose h suitably small so that we obtain two real solutions and 0<H<N<M.  Further, define our critical numbers to be

({{({{H=((M  -  (Sqrt[(M^2)-((4 h)/k)]))/2)     and     N=((M  +  (Sqrt[(M^2)-((4 h)/k)]))/2)}}).}})

So, we can write (dx/dt)=k(N-x)(x-H).  So, it is easy to see that N is stable, and H is unstable.

Example

Consider a population following the logistic equation with harvesting (dx/dt)=x (8-x)-h=-(x^2)+8 x-h.
	A.	Determine the equilibria, H, N.
	B.	Determine the stability of the equilibria for various values of h.
	C.	Determine the bifurcation point.
	D.	Draw a bifurcation diagram.

Consider a population following the logistic equation with harvesting (dx/dt)=x (8-x)-15=-(x^2)+8 x-15.
Notice that the equilibria are given by

Solve[-(x^2)+8 x-15==0, x]

theDE=x (8-x)-15;
ivp={{0,2},{0,8},{0,3.5},{2,2},{2,3.5},{2,8}};

Show[
VectorPlot[{1, theDE}, {t, -0.1,4}, {x, -1,10},
FrameLabel->{t,x},
Axes->True,
VectorScale->{Tiny, Tiny, None}, VectorStyle->Gray,
StreamScale->Full,
StreamStyle->{Blue, Thick, "Line"},
StreamPoints->{ivp},
PlotLabel->"Direction Field",
Epilog->{PointSize[Large], Point[ivp]}
],
Plot[{3, 5}, {t, -.1, 4.5}, PlotStyle->{{Red, Thick, Dashed},{Darker[Green], Thick, Dashed}}]
]

Manipulate[
Show[
VectorPlot[{1, x (8-x)-h}, {t, -0.1,4}, {x, -5,10},
FrameLabel->{t,x},
Axes->True,
VectorScale->{Tiny, Tiny, None}, VectorStyle->Gray,
StreamScale->Full,
StreamStyle->{Blue, Thick, "Line"},
StreamPoints->{ivp},
PlotLabel->"Direction Field"
],
Plot[{4-(Sqrt[16-h]),4+(Sqrt[16-h])}, {t, -.1, 4.5}, PlotStyle->{{Red, Thick},{Darker[Green], Thick}}]
],
{h, -15, 20, 0.5}
]

Below is how we create a bifurcation diagram.  Notice that as h changes, the number of equilibria will change from 2 (when h<16)  to 1 (when h=16) to 0 (when h>16) real solutions.

Solve[-(x^2)+8 x-h == 0, x]

Plot[
{4-(Sqrt[16-h]), 4+(Sqrt[16-h])}, 
{h, -5, 17},
PlotStyle->{{Red, Thick}, {Darker[Green], Thick}},
AxesLabel->{h, "Critical Numbers"}
]

Homework - For Software, Use Mathematica.  You need to learn some programming, so use the code I have provided!  In particular, stay away from DSolve and NDSolve.

Pages:		    106 - 110
Problems:	    1 - 5 ALL, 9, 10, 11, 13, 20

Linear Equations and Integrating Factors

Basic Definitions

A linear first order equation has the form (dy/dx)+P(x) y=Q(x), where P(x) and Q(x) are both continuous on some interval I.
An integrating factor is μ(x)=(e^(∫P(x) dx)).

The Theory

Notice that (d/dx)[y(x) (e^(∫P(x) dx))]=y'(x) (e^(∫P(x) dx))+y(x)P(x)(e^(∫P(x) dx))=(e^(∫P(x) dx))Q(x).  So, we can solve liner first order equations by multiplying by an integrating factor, (e^(∫P(x) dx)).  Hence, we have

({{({{y(x)=(e^(-∫P(x) dx))}})[∫Q(x) (e^(∫P(x) dx))  dx+C].}})

The Theorem

Consider (dy/dt)+P(t) y = Q(t), where y((Subscript[t, 0]))=(Subscript[y, 0]), where P and Q are both continuous on some interval I.  Then the initial value problem has a unique solution given by

({{({{y(t)=(e^(-∫P(t) dt))}})[∫Q(t) (e^(∫P(t) dt))  dt+C].}})

(for an appropriate choice of C) which is defined on the entire interval I.

Example

Sovle the differential equation y'-2 x y=(e^(x^2)).

Example

Consider the differential equation y'-2 y=(e^(-x)).
A.	Solve the differential equation.
B.	Determine the constant C for the following initial conditions.
	1.	y(0)=((-1)/3)
	2.	y(0)=1
	3.	y(0)=-1
C.	What is the end behavior?  I.e. compute the limit of y(x) as x goes to infinity.  Do you see why we say that the initial condition y(0)=((-1)/3) is critical in determining the behavior?
D.	Generate a direction field with the equilibrium solution using red/dashed lines.

theDE=2 y+Exp[-x];
ivp={{0,0}, {0,1}, {0,-1}, {2,1}, {1,-2}, {-2, 1}, {-1,2}};
Show[
VectorPlot[{1, theDE}, {x, -3, 3}, {y, -3,3},
FrameLabel->{x,y},
Axes->True,
VectorScale->{Small, Tiny, None}, VectorStyle->Gray,
StreamScale->Full,
StreamStyle->{Blue, Thick, "Line"},
StreamPoints->{ivp},
PlotLabel->"Direction Field",
Epilog->{PointSize[Large], Point[ivp]}
],
Plot[-1/3 Exp[-x], {x, -3, 3}, PlotStyle->{Red, Dashed, Thick}]
]

Solving Linear Differential Equations

Suppose

({{({{(Subscript[a, n]) (y^((n)))+(Subscript[a, n-1]) (y^((n-1)))+⋯+(Subscript[a, 1]) y'+(Subscript[a, 0]) y=f(x)}}).}})

This has a general solution y(x)=(Subscript[y, p])(x)+(Subscript[y, c])(x) where the complementary solution (Subscript[y, c]) is the general solution to the homogeneous ODE

({{({{(Subscript[a, n]) (y^((n)))+(Subscript[a, n-1]) (y^((n-1)))+⋯+(Subscript[a, 1]) y'+(Subscript[a, 0]) y=0}})}})

and (Subscript[y, p]) is any particular solution to the nonhomogeneous ODE.

Goal:  Find a Particular Solution to the Nonhomogeneous ODE.

Method of Undetermined Coefficients

If f(x) is a linear combination of finite products of functions:
	A)	A polynomial in x
	B)	An exponential function (e^(k x))
	C)	cos(k x) or sin(k x)
Then,
	1)	Find the complementary solution (Subscript[y, c])
	2)	Construct a particular solution (Subscript[y, p]):
		A)	If f(x) contains a term (x^m) (e^(k x)), where m is the largest such power, 
			Then include ((Subscript[k, 0])+(Subscript[k, 1]) x+⋯+(Subscript[k, m]) (x^m)) (e^(k x)).  Note that m or k can equal zero!
		B)	If f(x) contains a term (x^m) (e^(k x)) cos(b x) or (x^m) (e^(k x)) sin(b x) where m is the largest such power,
			Then include ((Subscript[A, 0])+(Subscript[A, 1]) x+⋯+(Subscript[A, m]) (x^m)) (e^(k x)) cos(b x)+((Subscript[B, 0])+(Subscript[B, 1]) x+⋯+(Subscript[B, m]) (x^m)) (e^(k x)) sin(b x).
		C)	If any term(s) in (Subscript[y, p]) duplicate a similar set of terms in (Subscript[y, c]),
			Then multiply those terms in (Subscript[y, p]) by a power of x one higher than the highest power of x in that (Subscript[y, c]) term.
		D)	"Delete" any "duplicate" terms in (Subscript[y, p]).
	3)	Substitute (Subscript[y, p]) into the nonhomogeneous ODE and find the coefficients.
	4)	Your solution is y=(Subscript[y, c])+(Subscript[y, p]).

Example

Solve y''+y'=2 (e^x).

Example

Solve y''+y=2 cos(x).

Homework - For Software, Use Mathematica.  You need to learn some programming, so use the code I have provided!  In particular, stay away from DSolve and NDSolve.

Pages:		    121 - 124
Problems:	    1 - 11 ALL

Pages:		    133 - 135
Problems:	    1 - 6 ALL, 24