Solutions, Initial Value Problems,
Direction Fields

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, Sections 1.2, 1.3

Solutions

Example of Explicit Solution

Determine if the explicit function y(x) = (x^2 + e)/(x^2 e^x)  is a solution of the differential equation 
 x y' + (x + 2)  y = 2 e^(-x).

Clear[y]

Good practice, to remove prior definitions of y, if any.

y[x_] := (x^2 + e)/(x^2 * Exp[x])

x * D[y[x], x] + (x + 2)*y[x] == 2*Exp[-x]

D[f., x] is the derivative of   f  with respect to   x  .  See page 88 of Mathematica.
x = = y tests whether x and y are equal,  == is Mathematica notation for equality as in an equation, page 92.

Simplify[%]

Exercise #1

Nagle & Saff, page 12, Section 1.2, #1 (a)
Show that y(x) = x^2 is an explicit solution to 
x (dy/dx) = 2 y

Clear[y]

y[x_] := x^2

x*D[y[x], x] == 2*y[x]

Exercise #2

Nagle & Saff, page 12, #1 (b)
Show that  e^x - x is an explicit solution to 
(dy/dx) + y^2  = e^(2x) + (1 - 2x)*e^x + x^2 - 1.

Discuss whether it is easy to test for equality in this equation.

Implicit Functions and Solutions

Example of Implicit Function

Example of Nagel & Saff, Section 1.2, page 12, Number 10
Show that  e^(x y) + y  = x - 1  implicitly defines a solution to the differential equation
dy/dx = (e^(-xy) - y)/(e^(-xy) + x) .

The relation e^(x y) + y  = x - 1 defines y(x) implicitly a function of x.  It iseems to not be possible to explicitly solve for y(x) as a function of x.

Clear[y]

Analytic Examination of  the implicit relation

Solve[ Exp[x*y] + y == x - 1, y]

Solve[ ] attempts to analytically solve an equation in terms of the named variable, Mathematica Book, p. 95

Graphical Examination

<<Graphics`ImplicitPlot`

This loads a special package designed for implicit plotting,  Beginner's Guide, page 102.

ImplicitPlot[Exp[x*y] + y == x - 1, {x, -3,3}, {y,-3,3},
AxesOrigin -> {0,0}]

AxesOrigin locates where the axes cross, see Mathemtica Book, page 139.

Numerical Examination

Clear[y]

eqn = ReplaceAll[Exp[x*y] + y == x - 1, {x -> 1.0}]

FindRoot[eqn, {y,-1.}]

Discuss the function y[x].  Does it exist?  
In what sense is y[x] a meaningful function? A useful or useable function?

Implicit Differentiation and Substitution

D[ Exp[y[x]*x] + y[x] == x - 1, x]

implicitderiv = Solve[ %, y'[x]]

y'[x]  == (Exp[-x*y[x]] - y[x])/(Exp[-x*y[x]] + x) /. implicitderiv

Simplify[%]

Expand[%]

Discuss whether it is easy to test for equality in this equation.

Exercise #3

Nagle & Saff, page 12, Section 1.2, #11
Show that y - ln(y) = x^2 + 1  is an implicit solution for the differential equation
(dy/dx) = (2 x y)/(y - 1).

Direction Fields

<<Graphics`PlotField`

Example of Plotting a Direction Field

Plot the direction field for the differential equation (dy/dx) = x y

PlotVectorField[{1, x*y}, {x,-2,2},{y,-2,2},
Axes-> True]

Do the  directions of the arrows  make sense?  Explain why.

If an initial condition was given in the first quadrant  (x > 0, y > 0) would the corresponding solution of the differential equation be increasing or decreasing? 

 Is this consistent with the derivative information given by the differential erquation?

Exercise #4

Nagle & Saff, Section 1.3, page19, Number 7.
Plot the direction field of the differential equation
(dy/dx) = 2 - y + 1/x

What can one say about the behavior of a solution as x approaches  ¥?