Separable Differential Equations

Steve Dunbar

Department of Mathematics and Statistics
University of Nebraska-Lincoln
Lincoln, NE 68588-0323
sdunbar@mathlab01.unl.edu


Fall Semester, 1993

Covers Nagle & Saff, Section 2.2

A Simple Example of Solution by Separation

Solve the initial value problem
	dy         t2
	---  = --------
	 dt      1 + y5
By inspection, we can see that the differential equation is separable. 

The idea  is to force Mathematica to set up and solve the equation by mimicing what we do on paper.   This example is easy enough to do "in our head".

lhs = (1 + y[t]^5) y'[t]

rhs = t^2

implicitsoln = Integrate[lhs, t] == Integrate[rhs,t] + C

Because the left side is a high degree polynomial in y, there is not much hope of explicitly solving for y.  Nevertheless, we can look at the solution curves defined implicitly by the implicit solution.

cp = ContourPlot[ y + y^6/6 - t^3/3,  {t, -2,2}, {y,-2,2},
ContourShading-> False ]

Note that we get a  whole family of solution curves.  Which solution curve we want is defined by an initial condition.

vf = PlotVectorField[ {1, t^2/(1 +y^5)}, {t,-2,2}, {y,-2,2},
Axes-> True]

Show[cp, vf]

Another Example of Solution by Separation

Solve the initial value problem
	(1 + t2) (dy/dt) = t y3/(1 + t2)1/2     with     y(0) = 1.
By inspection, we can see that the differential equation is separable. 

The idea  is to force Mathematica to set up and solve the equation by mimicing what we do on paper.  Set up the differential equation with a name:

Clear[ de, y, t, implicitsoln]

de = Sqrt[1 + t^2] * D[y[t], t] == t*y[t]^3/Sqrt[1 + t^2]

Divide through to put the equation in separated form:
Do this in your head or on scratch paper,  there is no convenient way to force 
Mathemtica to do this operation!

(1/y[t]^3) D[y[t],t] == t/(1 + t^2)

lhs = Integrate[ y'[t]/y[t]^3, t]

rhs = Integrate[t/(1 + t^2), t]

implicitsoln = lhs == rhs + C

Solve[ implicitsoln, y[t]]

Note the presence of the Imaginary constant ( I = Sqrt[-1]) in here.
This occurs because Mathematica is formula-driven (not heurisitic) in solving for y[t].

Note that there are two solution formulas.  Which solution formula is chosen depends on the initital conditions.

implicitsoln /. { t -> 0, y[t] -> 1}

impsolnwithIC = implicitsoln /. { C -> -1/2}

/. is the Mathematica symbol for evaluation.  See the Mathematica book page 74.

Solve[ impsolnwithIC, y[t]]

Plot[ 1/(Sqrt[ 1- Log[1+t^2]]), {t, -2,2}]

Why is Mathematica complaining with all of the error messages?
What is the domain of the solution?

<<Graphics`PlotField`

The normal form for the differential equation is
	dy                t y3
	----      =     -----
	 dt              1 + t2

PlotVectorField[ {1, t*y^3/(1 + t^2)}, {t,-2,2}, {y,-2,2},
Axes-> True]

The normal form for the differential equation is
	dy                t y3
	----      =     -----
	 dt              1 + t2

Does the graph of the solution agree with what you guess from the direction fields?

?DSolve

?Command is a way of getting information about a command.  See the Mathematica book page 374.

DSolve[de, y[t],t]