Skip to main content

Direction Fields and Existence

Direction fields connect the equation y=f(x,y)y'=f(x,y) to the geometry of its solutions. At each point (x,y)(x,y) in the plane, the value f(x,y)f(x,y) gives the slope of any solution curve that passes through that point. Before solving symbolically, a direction field can reveal equilibrium solutions, blow-up, attraction, repulsion, and whether a proposed formula has the right qualitative behavior.

Existence and uniqueness theorems explain when an initial value problem is well posed. They do not usually give the solution, but they tell us whether one solution curve should pass through a starting point or whether several curves might pass through the same point. This is essential in engineering modeling because a deterministic model should usually produce a unique future from a specified present state.

Definitions

For an explicit first-order ODE

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

a direction field, or slope field, assigns to each point (x,y)(x,y) a short line segment of slope f(x,y)f(x,y). A solution curve is tangent to these segments at every point it crosses.

An initial value problem is

y=f(x,y),y(x0)=y0.y'=f(x,y),\qquad y(x_0)=y_0.

The function ff is the velocity field in the (x,y)(x,y) phase picture. When ff depends only on yy, the equation is autonomous:

y=f(y).y'=f(y).

The zeros of f(y)f(y) are equilibrium solutions. If f(y)=0f(y_*)=0, then y(x)=yy(x)=y_* is a constant solution.

Euler's method approximates the solution by stepping along the local slope. With step size hh,

xn+1=xn+h,yn+1=yn+hf(xn,yn).\begin{aligned} x_{n+1}&=x_n+h,\\ y_{n+1}&=y_n+h f(x_n,y_n). \end{aligned}

This is a numerical version of following the direction field.

Key results

The basic existence theorem says that if ff is continuous in a rectangle around (x0,y0)(x_0,y_0), then at least one local solution exists. The stronger existence and uniqueness theorem says that if both ff and fyf_y are continuous in such a rectangle, then exactly one local solution passes through (x0,y0)(x_0,y_0).

The word local matters. The theorem may guarantee a solution near x0x_0 even though the solution later leaves the rectangle, hits a singularity, or becomes unbounded. For example, y=y2y'=y^2, y(0)=1y(0)=1, has solution y=1/(1x)y=1/(1-x), which exists only for x<1x\lt 1 despite the smooth right side.

Uniqueness has a geometric meaning: solution curves cannot cross in a region where the uniqueness hypotheses hold. If two different curves crossed at the same point, the same initial condition would have two futures. This crossing rule is often the fastest way to reject an incorrect sketch.

Nonuniqueness commonly appears when fyf_y is not continuous or when ff is not Lipschitz in yy. The classic example is

y=y,y(0)=0.y'=\sqrt{|y|},\qquad y(0)=0.

The zero solution is valid, but so are solutions that remain zero for a while and then peel away. The direction field alone may look harmless near the axis, so the theorem's hypotheses provide a sharper warning.

For autonomous equations, a phase line summarizes all solution directions. Mark the equilibria on the yy-axis and test the sign of f(y)f(y) between them. Positive sign means arrows upward as xx increases; negative sign means arrows downward. Stable equilibria attract nearby solutions, unstable equilibria repel them, and semistable equilibria attract from one side and repel from the other.

Euler's method has local truncation error of order h2h^2 and global error of order hh under typical smoothness assumptions. That means halving hh usually halves the accumulated error. This is useful for estimates, but Euler's method can behave poorly on stiff equations or over long intervals. Direction fields are qualitative; numerical values still need step-size checks.

Isoclines make slope fields easier to draw by hand. An isocline is a curve on which f(x,y)f(x,y) has a constant value cc. Along that curve, every field segment has slope cc. For the equation y=xyy'=x-y, the isoclines are lines xy=cx-y=c, or y=xcy=x-c. Drawing a few isoclines gives the field's structure without computing a separate slope at every grid point.

Nullclines are especially important. In a first-order scalar equation, a nullcline is a curve where y=0y'=0. A solution crossing such a curve has a horizontal tangent. In autonomous equations the nullclines are exactly the equilibrium levels, but in nonautonomous equations they can move with xx. A nullcline is not automatically a solution curve unless the right side remains zero along that curve in the way the differential equation requires.

Comparison ideas also come from the direction field. If two solution curves start ordered and uniqueness holds, they cannot cross, so their order is preserved as long as both remain in the same uniqueness region. This is often used to bound complicated solutions between simpler ones. For instance, if a model has a nonlinear drag term that is difficult to solve exactly, one can compare it with a linear drag model to estimate decay.

The theorem's hypotheses are sufficient, not necessary. A problem can have a unique solution even if the standard condition on fyf_y fails, and a problem can be useful even if the theorem does not apply at a few exceptional points. The practical habit is to state what the theorem guarantees, then use direct checking or modeling information for points outside its reach.

When using a direction field as a diagnostic, check three features. First, the initial tangent should match f(x0,y0)f(x_0,y_0). Second, a solution should flatten near attracting equilibria or nullclines. Third, any claimed explicit solution should follow the same monotonicity and concavity suggested by nearby field segments. These checks catch many algebra mistakes before substitution.

Visual

SituationWhat to inspectQualitative consequence
f(y)=0f(y_*)=0Horizontal phase-line markConstant solution y=yy=y_*
fyf_y continuousUniqueness hypothesesSolution curves do not cross
ff discontinuousBreaks in slope fieldExistence may fail at that point
Large f\vert f\vert Very steep field segmentsRapid change or possible blow-up
Euler step too largeNumerical path cuts across slopesApparent behavior may be artificial

Worked example 1: Phase line for logistic growth

Problem. Analyze the autonomous equation

y=0.4y(1y10).y'=0.4y\left(1-\frac{y}{10}\right).

Method.

  1. Find equilibria:
0.4y(1y10)=0.0.4y\left(1-\frac{y}{10}\right)=0.

Thus

y=0ory=10.y=0\quad \text{or}\quad y=10.
  1. Test intervals.

For y<0y\lt 0, choose y=1y=-1:

0.4(1)(1+0.1)<0,0.4(-1)(1+0.1)<0,

so arrows point downward.

For 0<y<100\lt y\lt 10, choose y=5y=5:

0.4(5)(10.5)>0,0.4(5)(1-0.5)>0,

so arrows point upward.

For y>10y\gt 10, choose y=11y=11:

0.4(11)(11.1)<0,0.4(11)(1-1.1)<0,

so arrows point downward.

  1. Determine stability. Arrows point away from 00 on both sides, so 00 is unstable. Arrows point toward 1010 from both sides, so 1010 is stable.

Answer. Positive initial data below 1010 increase toward 1010, while positive initial data above 1010 decrease toward 1010.

Check. The carrying capacity is 1010. The model's long-term behavior matches the interpretation: growth slows as the population approaches the carrying capacity.

Worked example 2: Existence without uniqueness

Problem. Show that the initial value problem

y=y,y(0)=0y'=\sqrt{|y|},\qquad y(0)=0

does not have a unique solution.

Method.

  1. Verify the zero solution:
y(x)=0y=0,y=0.y(x)=0\quad \Rightarrow\quad y'=0,\qquad \sqrt{|y|}=0.

So y=0y=0 satisfies the ODE and initial condition.

  1. Look for a positive solution for x0x\ge 0. If y>0y\gt 0,
y=y.y'=\sqrt{y}.

Separate:

dyy=dx.\frac{dy}{\sqrt{y}}=dx.
  1. Integrate:
2y=x+C.2\sqrt{y}=x+C.
  1. Use a curve that leaves the origin immediately. With y(0)=0y(0)=0,
C=0,C=0,

so

y=x2,y=x24(x0).\sqrt{y}=\frac{x}{2},\qquad y=\frac{x^2}{4}\quad (x\ge 0).
  1. Check:
y=x2,y=x24=x2(x0).y'=\frac{x}{2},\qquad \sqrt{y}=\sqrt{\frac{x^2}{4}}=\frac{x}{2}\quad (x\ge 0).
  1. More generally, for any delay a0a\ge 0,
y(x)={0,0xa,(xa)24,x>ay(x)= \begin{cases} 0,&0\le x\le a,\\ \dfrac{(x-a)^2}{4},&x>a \end{cases}

is also a solution.

Answer. The problem has infinitely many solutions, so uniqueness fails.

Check. The derivative of f(y)=yf(y)=\sqrt{\vert y\vert } is unbounded near y=0y=0, so the usual uniqueness hypothesis is not satisfied.

Code

import numpy as np

def euler(f, x0, y0, h, n):
xs = [x0]
ys = [y0]
x, y = x0, y0
for _ in range(n):
y = y + h * f(x, y)
x = x + h
xs.append(x)
ys.append(y)
return np.array(xs), np.array(ys)

def logistic(x, y):
return 0.4 * y * (1.0 - y / 10.0)

xs, ys = euler(logistic, 0.0, 2.0, h=0.1, n=100)
print(ys[-1])

Common pitfalls

  • Treating the existence theorem as a global theorem. It only guarantees a solution near the initial point.
  • Forgetting that uniqueness requires more than continuity of ff; a condition such as continuity of fyf_y or a Lipschitz condition in yy is needed.
  • Drawing solution curves that cross in a region where uniqueness holds.
  • Inferring stability from the location of equilibria alone. The signs of f(y)f(y) between equilibria determine the arrows.
  • Using Euler's method with a large step size and trusting the plot without checking convergence as hh decreases.
  • Ignoring singular lines such as x=0x=0 or y=0y=0 when the formula for ff contains denominators.
  • Calling a horizontal tangent an equilibrium in a nonautonomous equation. A moving nullcline only marks where the instantaneous slope is zero.
  • Forgetting to report the interval over which a numerical or qualitative conclusion is being made.

Connections