1. Some Basic Mathematical Models and Direction Fields

Introduction

Before we begin on the study of differential equations, lets talk about some terminology.

(d/dx),  (∂/(∂x)),  ∫ • dx

Each of these operators take, as an input, functions and have, as an output, functions.

Examples:  	If L = ((d^2)/(dx^2))-3x (d/dx)+Cos[x], then L[y] = 0 ⇔ y''+3x y'+Cos[x]y = 0.

If L = ((((d/dx)·))^2)+2(x^2), then L[y] = Sin[x] ⇔ (((y'))^2)+2(x^2)y = Sin[x].

Examples:

(i) 	y'=Sin[y].

(ii) 	y''+2y'+y=(x^2).

(iii) 	y''+x y'-6(x^2)y=Cos[x].

(iv) 	u''+u u'=0.

Ordinary vs Partial Differential Equations

Examples:

(i)	y'(x)=f(x,y(x)) 	⟵ ordinary DE.	vs. 	(Subscript[u, xx])+(Subscript[u, yy])=f(x,y) 	⟵ partial DE.

(ii)	m x''(t)=F(t,x(t))-k (((x'(t)))^2) 	⟵ falling body equation, ordinary DE.

(iii)	(Subscript[u, tt])+u ((|(Subscript[u, x])|)^2)=0 	⟵ Nonlinear Schrodinger Equation, partial DE.

Examples:

(i)	y'=f(x,y)	⟵ First order or order 1 ODE.

(ii)	y''+2y'-3y=Cos[x]	⟵ Second order or order 2 ODE.

(iii)	(Subscript[u, xxx])+(Subscript[u, tt])+(Subscript[u, xx])=0	⟵ Third order or order 3 PDE.

(iv)	y''+(((x y'))^3)+Sin[y]=(x^3)	⟵ Second order ODE.

Linear vs. Nonlinear

Examples:

(i)	y''+2x y'-3(x^2)y=(e^x)	⟵ Linear, second order ODE.

(ii)	θ''=-k Sin[θ]	⟵ Nonlinear (pendulum) equation.

(iii)	P'(t)=r P(t)	⟵ Linear (Mathusian) equation.

(iv)	P'(t)=a P(t)(1-((P(t))/k))	⟵ Nonlinear (Logistic) equation.

Direction Fields

A direction field for a first order ODE is a way of graphing the “flow” of solutions for the equation.  Direction fields are also referred to as Stream Curves or Vector Fields.  First the first order DE is put in the form:

y'(x)=f(x,y).

Then for each (x,y) value in the plan of interest, we can draw a vector in the direction of the vector ⟨1,f(x,y)⟩.  Mathematica can be used to do this using the VectorPlot command.

Examples:

(i)	y'(x)=k y(x), for k=2, 0.5, -1, -3.  The direction field for k=2 follows.

VectorPlot[
{1, 2 y}, {x, -4, 4}, {y, -4, 4},
FrameLabel->{x,y},
Axes->True,
VectorScale->{Small, Small, None},
PlotLabel->"Direction Field"
]

Here is the “cute” way to create the graphs for all of the k values quickly by using the Table command.

Table[
VectorPlot[
{1,k y}, {x, -4, 4}, {y, -4, 4},
FrameLabel->{x,y},
Axes->True,
VectorScale->{Small, Small, None},
PlotLabel->StringForm["Direction Field, k = ``.", k],
ImageSize->300
],
{k, {2, 0.5, -1, -3}}
]

We can also add sample solution curves to a direction field: Mathematica calls these stream lines and uses the StreamPoints option as follows.

VectorPlot[
{1, 2 y}, {x, -4, 4}, {y, -4, 4},
AxesLabel->{x,y},
Axes->True,
VectorScale->{Small, Small, None},
VectorStyle->Gray,
StreamPoints->Coarse,
StreamStyle->{Blue, Thick, "Line"},
StreamScale->Full,
PlotLabel->"Direction Field with Solution Curves"
]

If you wish to have particular solution curves through given initial conditions, then...

points={{0,1}, {0,-1}, {-2, 1}, {2, 1}, {2, -1}};
VectorPlot[
{1, 2 y}, {x, -4, 4}, {y, -4, 4},
FrameLabel->{x,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],Red, Point[points]}
]

Example:

(ii) 	y'(x)=(e^x)Cos[y], in the window [-1,6]×[-5,5].

VectorPlot[
{1, Exp[x]Cos[y]}, {x, -1, 6}, {y, -5, 5},
FrameLabel->{x,y},
Axes->True,
VectorScale->{Small, Small, None},
PlotLabel->"Direction Field"
]

2. Solutions of Some Differential Equations

Consider the ODE that models the velocity of a falling body:

m ((d v)/(d t))=m g-k v,

and a population model with harvesting:

((d P)/(d t))=r P-h.

Both of these ODE’s have the form:

((d y)/(d t))=a y+b,

where a and b are constants.  This form is considered “Separable” and also “Linear, First Order”.  We will investigate solution techniques for both of these type of problems later, but one way is to do the following.

((d y)/(y+(b/a)))=a dt,

then integrate both sides to get,

Log[y+(b/a)]=a t+C,

where C is an arbitrary constant.  Now solve for y,

y+(b/a)=(e^(a t+C)).

Since (e^C) is a constant, then

y(t)=c (e^(a t))-(b/a).

Depending on the sign of a, this solution is either exponential growth or exponential decay.  Also, this is called a family of solutions, where c is an arbitrary constant.  If we are also given initial conditions (IC), then we could find the particular solution from the family of solutions that passes through the IC.

Example:

Consider the ODE ((d y)/(d x))=4-0.5y.  The direction field for this equation is

VectorPlot[
{1, 4-0.5y}, {x, -1, 10}, {y, -1, 15},
FrameLabel->{x,y},Axes->True,VectorScale->{Small, Small, None},
PlotLabel->"Direction Field"
]

Now let’s see how Mathematica can be used to solve this equation directly.

DSolve[y'[t]==a*y[t]+b,y[t],t]

Note in particular the use of double equals “==” in the equation.  Also, the arbitrary constant is (C[1]).

3. Classification of Differential Equations

In section 1 we discussed terms like “ordinary” vs “partial” differential equations, the order of the equation and “linear” vs “nonlinear” equations.  Here are a couple more ways of describing the type of an equation.

Homogeneous vs. Nonhomogeneous

If L is a differential operator, then L[y]=f(x) is called homogeneous if f(x)≡0, and nonhomogeneous if f(x)≢0.

Examples:

(i) L Q''[t]+R Q'[t]+(1/C)Q[t]=E[t] is an example of a second order, linear, ordinary differential equation modeling the charge Q[t] on a capacitor in a circuit with capacitance C, resistance R, and inductance L.  This equation is nonhomogeneous provided E[t] is not identically zero.

(ii) (Subscript[u, t])-(a^2)(Subscript[u, xx])=0 is a second order, linear, homogeneous, partial differential equation that models heat transfer in a thin rod of uniform density.

Systems of Differential Equations

Example

x'[t]=2x[t]-x[t]y[t], y'[t]=(1/2)x[t] y[t]-(1/10)y[t].

Solutions of Differential Equations

Example

Show that y=(e^(t^2))(∫_0^t)(e^(-(s^2)))ds+(e^(t^2)) solves the equation y'-2t y=1.