Prefer to click through the interactive model?

First-order differential equations — study guide

The same fragments the interactive model serves, read in order. One source, two views.

An equation about its own rate of change

A first-order differential equation says something about a quantity's own rate of change rather than about the quantity itself. Instead of an equation like y = 3x + 1, which pins down what y equals at every x, an ODE (ordinary differential equation) pins down what dy/dx equals — sometimes in terms of x, sometimes in terms of y, often both. Solving it means finding the function y(x) whose derivative actually behaves that way.

The word first-order tells you how far the equation reaches into the derivative side of things: only the first derivative dy/dx shows up, never d^2y/dx^2 or anything higher. That single restriction turns out to unlock a whole toolkit of techniques, several of which this concept covers, while leaving the higher-order case for later.

What makes these equations worth a whole concept is that a rate-of-change rule, written down honestly, usually has more than one function obeying it — the equation constrains the shape of the answer without pinning down a single curve. Working out which curves qualify, what they look like, and when the search is even guaranteed to succeed is what the rest of this concept walks through.

Reading dy/dx = f(x, y)

The standard way to write a first-order ODE is dy/dx = f(x, y), where f stands for whatever expression built from x, y, and constants happens to describe the slope rule. The left side is the derivative you already know how to take; the right side is the rule you are being handed, and solving the equation means finding a y(x) whose actual derivative matches it.

The order of an ODE is defined by the highest derivative that appears in it, and first-order means exactly one thing: only dy/dx shows up, never a second derivative or beyond. That is the entire classification — nothing about how complicated f itself is allowed to get.

A few notation examples ground the pattern. dy/dx = 3x says the slope at any point depends only on x. dy/dx = x - y says the slope depends on both coordinates and flattens to zero exactly where x equals y. dy/dx = xy says the slope depends on the product of the two. All three are first-order — none of them mentions a second derivative — and all three fit the same template dy/dx = f(x, y) with a different rule standing in for f.

One equation, many curves

x y C = -2 C = 0 C = 2 y = x^2 + C, for a few values of C
The equation dy/dx = 2x is satisfied by every curve y equals x squared plus C, so one differential equation describes a whole family of parabolas stacked vertically, one for each value of the constant C.

A solution to a first-order ODE is a function y(x) that makes the equation true everywhere on some interval — plug y(x) and its derivative back into dy/dx = f(x, y) and both sides genuinely agree, not just approximately. Finding one is fundamentally different from solving 2x + 3 = 7 for a number; here the unknown is an entire function, and checking a candidate means differentiating it and comparing.

Take the simplest possible case, dy/dx = 2x. Because the right-hand side depends only on x, solving it is just undoing a derivative: find a function whose derivative is 2x. y = x^2 works, but so does y = x^2 + 5, and so does y = x^2 - 100 — any constant added to x^2 disappears the moment you differentiate, so the derivative comes out to 2x no matter which constant you picked. The honest answer is not one curve but the whole family y = x^2 + C, one parabola for every value of C, like a stack of transparencies, each shifted up or down by a fixed amount, all obeying the exact same shape rule.

That arbitrary constant is not a defect of this particular equation — differentiating always throws information away (a vertical shift vanishes under d/dx), so undoing a derivative always leaves a gap exactly that shape. Narrowing the family down to one specific curve takes an extra piece of information beyond the equation itself, which is a question worth asking on its own.

The field of directions dy/dx draws

x y dy/dx = x - y origin: slope 0
For the slope field of dy/dx equals x minus y, each short segment is drawn at the exact slope x minus y computed at its own grid point, so a solution curve threaded through the field stays tangent to the local segment everywhere it goes.

Written geometrically, dy/dx = f(x, y) is not a rule about one curve — it is a rule that assigns a slope to every point (x, y) in the plane, independent of any particular solution. Stand at any point, evaluate f there, and you know which way a solution curve passing through that exact spot would have to be heading.

Plot that slope as a short line segment at a sample of grid points across the plane and you get a slope field, also called a direction field: a whole grid of tiny direction markers, each one computed independently from f, none of them yet committed to belonging to any specific curve — like iron filings scattered around a magnet, each one twisting to point along the local field instead of belonging to any single traced-out line.

A solution curve is then a path threaded through the field that stays tangent to the local segment at every point it crosses — never cutting across an arrow, always following where it points. The figure alongside plots exactly this for dy/dx = x - y: the segment at the origin lies flat because the slope there is zero, and the segments tilt more steeply the farther a point sits from the line x = y, where the two coordinates pull apart the hardest.

Splitting the variables apart

Not every first-order ODE splits apart the way dy/dx = 2x did, but a large and useful class does: any equation that can be written dy/dx = g(x) h(y), where the right-hand side factors into one piece depending only on x and one piece depending only on y. These are called separable, and recognizing the factorization is the whole trick — once you see it, the rest is bookkeeping.

The bookkeeping is a specific rearrangement. Divide both sides by h(y) (wherever it isn't zero) and multiply through by dx, which moves every y to one side and every x to the other: dy / h(y) = g(x) dx. Integrate each side on its own — the left with respect to y, the right with respect to x — and the two arbitrary constants that integration produces collapse into a single constant, because only their difference actually matters.

Dividing by h(y) does quietly assume h(y) is not zero, and wherever h(y) = 0 for some constant value of y, that constant function is its own valid solution — sitting flat forever, dy/dx = 0 on both sides. Separation finds the family of curved solutions; those flat ones are worth checking for separately, and sometimes turn out to already be hiding inside the family once you allow the constant of integration to take the right value.

Solving one, start to finish

x y y = e^(x^2) x = -1 x = 0 x = 1 tangent slope = 2xy
At three sample points on the curve y equals e to the x squared, a short tangent segment drawn at slope 2xy lines up exactly with the curve's own direction, confirming the algebraic solution matches the original equation everywhere it was checked.

Take dy/dx = 2xy. The right-hand side is 2x times y, so it factors as g(x) h(y) with g(x) = 2x and h(y) = y — separable, by the definition just given.

Separating gives dy / y = 2x dx (valid wherever y is not zero), and integrating each side on its own gives ln|y| = x^2 + C, where C is the single constant left over from combining the two sides' integration constants.

Solving for y means undoing the natural log: |y| = e^(x^2 + C) = e^C * e^(x^2), and since e^C is just some positive number, call it A and drop the absolute value by letting A range over all nonzero reals (positive or negative, matching whichever sign y actually has). Folding in the flat constant solution y = 0 — which the division by y had quietly excluded — lets A include zero too, so the full general solution is y = A * e^(x^2), for any real constant A.

Checking is a matter of differentiating the candidate and comparing: if y = A * e^(x^2), then dy/dx = A * 2x * e^(x^2), which is exactly 2x times A * e^(x^2) — in other words exactly 2x times y itself, matching the original equation dy/dx = 2xy for every value of x and every choice of A. The figure alongside plots one member of this family, y = e^(x^2) (the case A = 1), and marks three points where an independently computed tangent of slope 2xy lines up with the curve's own direction — the algebra and the geometry agreeing at every point checked, not just approximately.

Does a solution exist, and is it the only one?

So far every example here has assumed a solution exists and is worth pinning down, but that assumption is not automatic. Given a first-order ODE and a specific starting point (x0, y0), two honest questions come first: does any solution curve actually pass through that point, and if one does, is it the only one?

Under reasonably tame conditions on f — specifically, f(x, y) continuous near the point and not changing too abruptly as y varies there (a technical condition called Lipschitz continuity in y) — a result known as the Picard-Lindelof theorem guarantees exactly one solution curve threads through (x0, y0). The guarantee is local: it promises that unique curve on some interval around x0, which the theorem's own bookkeeping might make quite short, not necessarily the whole domain f is defined on.

Drop either condition and the guarantee drops with it. Some equations do have several different solutions squeezing through the very same starting point, and some solutions exist only up to a limited interval before they escape to infinity or the underlying f stops making sense — both are the reason existence and uniqueness get checked, rather than assumed, whenever it actually matters.

Where rate-of-change equations show up

Rate-of-change rules like the ones in this concept are not a mathematical curiosity — they are how you write down almost any physical process whose future depends on its present state: a quantity that grows fastest exactly when it is smallest, a quantity that resists change harder the further it is pushed, a system whose next instant depends on this one. Anywhere a quantity's own behavior feeds back into how fast it is changing, a first-order ODE is the natural sentence to write.

A small self-driving RC car build leans on exactly this pattern: a car reacting moment to moment to its own sensor readings is, underneath the engineering, a system whose state evolves according to a rate-of-change rule — the mathematics of steering a response smoothly, rather than jerking between corrections, builds on the ground covered here.

What is covered here — reading the notation, recognizing a family of solutions instead of a single answer, solving the separable case by hand, and knowing when a solution is even guaranteed — is the algebraic and geometric foundation. Turning a starting condition into one specific curve, chaining several rates of change together, and letting a computer grind through equations too messy to solve by hand are each their own separate story.