Hexa Scholar

Slope fields: reading an ODE before solving it

A navy felt board with rows of short wooden sticks set at different angles, and a gold cord winding across it in waves along the sticks beside it.
Each stick shows the slope given by y′ = cos t − y/2. The gold cord traces a solution curve.

The question

y′ = y(2 − y)/2 sets the slope of y at every height. From y(0) = 0.25, can you sketch y(t) for 0 ≤ t ≤ 4 without solving it?

Sketch first; then the page draws the solution over your sketch.

  1. 1 SeeSketch three solutions from their slope fields.
  2. 2 TryPredict, then move the starting value.
  3. 3 ProveBuild the proof, line by line.
  4. 4 ApplyProblems to check yourself.
Before you start · 3 quick checks on tangent slopes, the chain rule and increasing functions, about 3 min

Two ideas before you start

2 ideas

Each segment is the slope the equation asks for

Figure: the slope field of y′ = t − y, short segments on a grid, with the segment at the chosen point drawn long. It needs JavaScript.

Point (t, y):

At (0, 2): y′ = t − y = 0 − 2 = −2

At each point (t, y) the equation gives a slope y′. The slope field draws that slope as a short segment at many points of the plane.

Exact definition

Differential equation. A first-order ordinary differential equation (ODE) for an unknown function \(y\) of \(t\) has the form \(y' = f(t, y)\), where \(f\) is a given function of two variables and \(y'\) is the derivative \(\tfrac{dy}{dt}\).

Solution. A solution on an open interval \(I\) is a differentiable function \(y\) on \(I\) with \(y'(t) = f(t, y(t))\) for every \(t\) in \(I\). An initial value problem adds a starting condition \(y(t_0) = y_0\) with \(t_0\) in \(I\).

Slope field. The slope field (or direction field) of \(y' = f(t, y)\) draws, at each point \((t, y)\) of a grid, a short segment through that point with slope \(f(t, y)\), measured in the units of the two axes.

A solution runs along the segments

Figure: the slope field of y′ = y with two curves from the point (0, 0.5): curve A, 0.5eᵗ, and curve B, the straight line 0.5 + 0.5t. It needs JavaScript.

Which one solves y′ = y?

Both curves start at (0, 0.5). Tap the one that is a solution of y′ = y.

A solution curve is tangent to the segment at every point it passes through. Matching the slope at the start only is not enough.

Exact definition

Solution curves. If \(y\) is a solution of \(y' = f(t, y)\) on \(I\), then at each point \((t, y(t))\) of its graph the tangent line has slope \(y'(t) = f(t, y(t))\), the slope of the field at that point. Conversely, a differentiable function whose graph has, at each of its points, the slope of the field there is a solution.

Fine print: names and notation

“Ordinary” means there is one independent variable, here \(t\); equations with partial derivatives in several variables are partial differential equations. The equation is first order because only \(y'\) appears, not \(y''\). An equation \(y' = f(y)\) whose right side does not involve \(t\) is called autonomous. Every segment of a slope field has its slope measured in the units of the axes, so on a figure whose two axes have different scales, a segment of slope 1 need not be drawn at 45°.

1 See

Sketch the solution from the slope field

How the page draws the solution and measures the gap

The page solves each equation numerically with the classical fourth-order Runge–Kutta method, step 0.001, and fills in between steps with cubic Hermite interpolation; the error is far smaller than the width of a line. Your sketch is the broken line from the start through your 8 handles, which move in steps of 0.05. The gap is the vertical distance between your sketch and the solution, measured at 4,001 equally spaced times from 0 to 4. Where it is more than 0.2 the strip is shaded, and the ends of each strip are the times where the gap equals 0.2, found by bisection. After the third round a table compares the three sketches; Start over clears everything.

2 Try

Change the starting value

Back to \(y' = y(2 - y)/2\) from the question at the top. Two predictions first; the explorer below them opens once both are answered.

The explorer, its goals and the summary open after you answer both predictions.

3 Prove

How far apart two solutions stay

Theorem

Assumptions. \(I\) is an open interval that contains 0, and \(y_1\) and \(y_2\) are solutions of \(y' = t - y\) on \(I\) with \(y_1(0) \ne y_2(0)\). Write \(d(t) = y_1(t) - y_2(t)\) for the gap between them, so \(d(0) \ne 0\).

Conclusion. For every \(t\) in \(I\),

\[\begin{aligned} d(t) &= d(0)e^{-t}. \end{aligned}\]

So \(d(t) \ne 0\) for every \(t\) in \(I\): the two solution curves never meet. And whenever \(t\) and \(t + 1\) are both in \(I\), \(|d(t + 1)| = e^{-1}|d(t)|\), with \(e^{-1} \approx 0.368\): the gap shrinks by that factor per unit of \(t\).

Facts the proof uses.

  • the product rule, \((uv)' = u'v + uv'\);
  • a function whose derivative is 0 at every point of an open interval is constant on it (a consequence of the mean value theorem);
  • \(\tfrac{d}{dt}e^{t} = e^{t}\), \(e^{s} \gt 0\) and \(e^{a}e^{b} = e^{a + b}\) for all real numbers \(s\), \(a\), \(b\).

Each option is one step about the \(y_1\), \(y_2\), \(d\) and \(I\) of the theorem. Pick the one that is true for every pair of solutions the theorem covers.

4 Apply

Problems

Each problem has hints and a full solution.

Key point Read a slope field before solving: the slope at a point is \(f(t, y)\), segments are flat where \(f(t, y) = 0\), and for \(y' = f(y)\) the zeros of \(f\) are equilibria whose stability the sign of \(f\) decides. For linear equations such as \(y' = t - y\) and \(B' = 0.05B - 2000\), subtract one known solution (\(t - 1\), or the constant 40,000): the gap \(d\) or \(v\) satisfies \(d' = -d\) or \(v' = 0.05v\), and an exponential factor turns that into a derivative equal to 0, which gives the solution exactly.
Level Intro Prerequisites What a derivative measures when you zoom in; the chain rule for exponentials and increasing functions (refreshed in Before you start) Time ~35 min

Related: What happens to (1 + 1/n)n as n grows? shows why \(e^{t}\) is its own derivative, which makes \(0.5e^{t}\) a solution of \(y' = y\); What degree does a Taylor polynomial need? builds on the tangent line, which is curve B on the second key-idea card.

Further reading