From a grid to solution curves
Jump to the animated existence & uniqueness exploration ↓
Start with a grid of sample points in the x–y plane. A differential equation assigns a slope to each point: inspect one tangent, reveal the sampled slope field, then follow a solution whose tangent direction changes along the curve.
Change Grid density to display more local directions. Change Step size in Short steps to change the numerical approximation. These controls act independently; the equation defines slopes between the grid points too.
In Follow a solution, change the initial value, move along the curve, and increase the number of sampled tangents. In Short steps, compare finite straight steps with the exact solution and reduce the step size.
Choose y′ = x + y for Problem 21. Its short steps run backward from x = 0 to x = −4, so you can estimate y(−4). Each restart begins at the displayed initial value.
Grid → slopes → solution
What the grid represents
A regular grid is one kind of mesh. Each point (xᵢ, yⱼ) is a place to evaluate mᵢⱼ = f(xᵢ, yⱼ) and draw a short segment with that slope. When x is time and y is position, this is a time–state grid: it samples possible positions at different times.
The differential equation specifies a slope at every point where f is defined. The grid displays a finite sample of this field. Making the grid denser shows more directions; it does not change the equation or its exact solutions.
The short-step approximation evaluates f at its current approximate point, which can lie between grid points. Its step size controls the distance advanced in x. Keep the grid fixed and reduce the step size to compare approximation errors; then keep the step size fixed and change only the grid density.
Why the tangent determines the local direction
At a point (x₀, y₀), the equation supplies the slope m = f(x₀, y₀). The line through that point with that slope is:
y = y₀ + f(x₀, y₀)(x − x₀).
A solution has this tangent direction at every point along its graph. Its local behavior is y(x₀ + h) ≈ y(x₀) + hf(x₀, y(x₀)). The smooth curve is not a finite chain of straight segments.
For a point moving on the graph as x increases, the direction vector is (1, f(x,y)). A negative slope means motion down and to the right. Zero slope gives a horizontal tangent; the graph point still moves right. If x is physical time and y is a position on a line, the scalar f is that particle's velocity, while (1,f) describes motion on the time-position graph.
Slope-field segments are normalized for readability. Their displayed lengths do not represent speed.
Exact curves and tangent-step approximations
The reference curves use analytic solutions with y(0) = y₀:
y′ = x − y: y(x) = x − 1 + (y₀ + 1)e−x
y′ = x + y: y(x) = (y₀ + 1)ex − x − 1.
Short steps instead use xₙ₊₁ = xₙ + h and yₙ₊₁ = yₙ + hf(xₙ,yₙ). Each slope is evaluated at the new approximate point. This is a preview of Euler's method from Section 2.4. For the backward estimate in Problem 21, h is negative.
With y′ = x + y and y(0) = 0, the exact value is y(−4) = 3 + e−4 ≈ 3.0183. Reveal the exact solution after making your estimate. The displayed error is the absolute difference at the current endpoint.
Two questions to discuss
Is the zero-slope line a solution? For y′ = x − y, the field is horizontal on y = x, but that line has slope 1. For y′ = x + y, the field is horizontal on y = −x, but the line has slope −1. Neither line is a solution of its corresponding equation.
Can distinct solutions cross? For each equation here, f and its partial derivative fᵧ are continuous everywhere. The local uniqueness theorem rules out crossing solutions of the same equation. That conclusion requires a uniqueness condition; a common tangent alone is not enough.
Existence & uniqueness, in motion
Play the three views to see how an initial value extends to a solution on an interval. Pause or drag the progress slider at any point.
At the same x
Why this bound gives uniqueness
Continuous fᵧ on a small closed rectangle ⇒ a finite bound |fᵧ| ≤ L. The mean value theorem then gives |Δm| ≤ Ld at the same x. Here fᵧ = −1, so L = 1.
For two solutions with the same initial value, let E be their largest gap on a small common interval [−h,h]. Their gap comes from accumulating slope differences, so:
What the animations show mathematically
Existence: on R = [−1, 1] × [−1, 3], f(x,y) = x − y is continuous. The theorem guarantees a solution on some interval around x = 0. This example uses the known solution y = x − 1 + 2e−x to display intervals I = (−h,h) and compare finite tangent steps on both sides. Every allowed interval and its drawn curves stay inside R. The available slider range is chosen for this example; a general existence theorem does not promise an arbitrarily chosen interval or the full width of R.
Why continuity helps: locally bounded slopes keep short approximations inside R. Continuity lets their slope errors tend to zero as the steps shrink. The mathematical proof extracts a convergent subsequence and shows its limit satisfies the integral equation. A finite animation illustrates this reasoning; it is not a proof of the theorem for every continuous field.
Uniqueness: fᵧ = −1. The solid and dashed curves are exact solutions with starting values 1 and 1 + δ. Their difference is δe−x. The selected x moves across the whole interval. The orange bracket measures d = |yB − yA|; the two highlighted tangent segments use the same horizontal span. The bars compare d and |Δm| on a common scale, and the marker shows the bound Ld. With δ = 0 both gaps vanish; the ratio 0/0 is not evaluated.
In general, continuity of fᵧ on a small closed rectangle gives a finite bound L. The mean value theorem gives |f(x,y₁) − f(x,y₂)| ≤ L|y₁ − y₂| for points at the same x. For any two solutions with identical initial values, |y₁(x) − y₂(x)| ≤ L|∫₀ˣ |y₁(s) − y₂(s)| ds| ≤ LhE, where E is the maximum gap on a common interval [−h,h] inside their domains and R. Hence E ≤ LhE. Choosing Lh < 1 forces E = 0. This is a local argument; covering a longer common interval uses continuation. The displayed h values all satisfy Lh < 1 for this example.
Same tangent, two solutions: f(x,y) = 3|y|2/3 is continuous, while fᵧ is undefined at y = 0. The solid solution is yA = max(0,x)3; the dashed solution is yB = max(0,x−c)3, with c > 0. Both have y(0) = 0 and y′(0) = 0. Both are differentiable and satisfy the equation, including at their joining points. They differ arbitrarily close to the right of 0, so this is actual local nonuniqueness. Their curves are drawn from exact formulas, not from a numerical solver that might remain at zero.
Continuity of f and fᵧ is a sufficient condition for local uniqueness. Failure of that condition alone does not prove nonuniqueness; here the two explicit solutions demonstrate it.