ODE Dojo · First-Order Methods

There is no single method.
There is only the right one.

Every first-order ODE has a hidden structure. The game is to spot it — then apply the one technique that unlocks it. This page is the whole dojo.

look at the form  →  classify it  →  pick the matching tool

Ask these questions in order

Work down the list. Stop at the first question that says yes. That's your method.

Form to look for
dy/dx = f(x) · g(y)
The right side splits into a pure x-part times a pure y-part.
What to do
1/g(y) dy = f(x) dx
∫ 1/g(y) dy = ∫ f(x) dx
Move all y's left, all x's right. Once separated, each side is a single-variable integral. This is always the first thing to check — it's the easiest method if it applies.
Form to look for
y' + P(x)·y = Q(x)
y and y' appear to the first power only. No y², no sin(y).
Integrating factor recipe
μ(x) = e^(∫P(x)dx)
d/dx[μy] = μ·Q(x)
→ integrate both sides
The equation almost satisfies a product rule — μ is the missing piece that completes it. Once the left side collapses into d/dx[μy], you integrate once and you're done.
Form & test
M dx + N dy = 0
Check: ∂M/∂y = ∂N/∂x
What to do — find F
F_x = M → F = ∫M dx + g(y)
F_y = N → solve for g'(y)
Solution: F(x,y) = C
The mixed-partial test confirms a hidden "potential function" F exists such that the ODE is just dF = 0. The solution is the level curves of F. You're reverse-engineering the hill from its slope field.
Form to look for
y' + P(x)y = Q(x)yⁿ
(n ≠ 0, n ≠ 1)
Substitution
u = y^(1−n)
u' = (1−n)y^(−n)y'
→ linear ODE in u
The yⁿ is the monster. The substitution u = y^(1−n) kills the monster by turning the equation linear. Solve for u, then back-substitute to recover y.
Form to look for
dy/dx = F(y/x)
or M, N same degree
Substitution
v = y/x, so y = vx
y' = v + xv'
→ separable in v, x
The equation has scale symmetry — it only cares about the direction of (x,y), not the distance. Setting v = y/x strips away the scale, reducing it to a separable equation in v and x.
Extra information given
y(x₀) = y₀
What to do
1. Find general solution
2. Plug in (x₀, y₀)
3. Solve for C
The general solution is a whole family of curves — one for each value of C. The initial condition is the GPS pin that picks the single curve passing through (x₀, y₀).

Worked examples

Five problems, one per method. Every algebraic step is shown — nothing skipped. Use the arrows to step through each solution.

Separable dy/dx = x·y² ,   y(0) = 1
Step 1 of 5
Linear y' − 2y = 4x
Step 1 of 5
Exact (3x²y + 2x)dx + (x³ + 1)dy = 0
Step 1 of 5
Bernoulli y' + (1/x)y = x²y³
Step 1 of 6
Homogeneous dy/dx = (x² + y²) / (2xy)
Step 1 of 6

Why each method works

First principles. Every method is an answer to one question: what hidden structure is this ODE carrying, and how do we expose it so we can integrate?

The core idea

When dy/dx = f(x)·g(y), the x-influence and y-influence on the slope are completely independent — they don't talk to each other. So the equation splits cleanly. Each side, once separated, is a single-variable integral.

Two knobs on a mixing board. One controls only bass (x), one controls only treble (y). They're independent — so you can undo each one independently. That's separation.

Why cross-multiplying is valid

When we write (1/g(y))dy = f(x)dx, we're treating dy and dx as "differentials" — infinitesimally small pieces. The formal justification is the chain rule. If we write y as a function of x, then:

dy/dx = f(x)g(y) → (1/g(y))·(dy/dx) = f(x)

Integrate both sides with respect to x. On the left, the chain rule turns ∫(1/g(y))(dy/dx)dx into ∫(1/g(y))dy by substitution. So the "cross-multiply" is really a u-substitution in disguise.

Where μ comes from

Start with y' + P(x)y = Q(x). We want to multiply by some function μ(x) so the left side becomes a perfect derivative. If d/dx[μy] = μy' + μ'y, we need μ' = μP(x). This gives:

dμ/μ = P(x) dx → ln|μ| = ∫P dx → μ = e^(∫P dx)

This is a separable ODE for μ itself — we solved an ODE to find the tool that solves another ODE.

You're handed a puzzle box that's almost assembled. The integrating factor is the missing piece. Once you click it in, the whole left side snaps into a single derivative — and one integration finishes the job.

Why the product rule is key

Product rule: d/dx[μy] = μy' + μ'y. Our equation after multiplying by μ reads:

μy' + μPy = μQ

Left side matches d/dx[μy] when μ' = μP — exactly the condition μ satisfies. So the left side always collapses. The right side ∫μQ dx is just a standard integral.

What "exact" really means

Consider a function F(x,y). Its total differential is dF = F_x dx + F_y dy. If the ODE is M dx + N dy = 0, and we find that M = F_x, N = F_y for some F — then the ODE is just dF = 0, meaning F = constant along every solution.

Imagine being handed a gradient vector field (M, N) and asked what hill has that gradient. The exactness condition ∂M/∂y = ∂N/∂x is exactly Clairaut's theorem — it confirms the field is conservative, i.e., a real hill exists. Finding F is hiking uphill to read the elevation function.

Why the mixed-partial test works

If F exists with F_x = M and F_y = N, then by Clairaut's theorem (equality of mixed partials):

∂M/∂y = ∂²F/∂y∂x = ∂²F/∂x∂y = ∂N/∂x

So ∂M/∂y = ∂N/∂x is a necessary condition. For simply connected domains, it's also sufficient — the test both ways. If it fails, the equation is not exact as-is (though you can sometimes find an integrating factor to make it exact).

Why the substitution linearizes the equation

Start with y' + P(x)y = Q(x)yⁿ. Divide by yⁿ:

y'·y⁻ⁿ + P(x)·y^(1−n) = Q(x)

Set u = y^(1−n). By the chain rule:
du/dx = (1−n)·y^(−n)·y', so y'·y⁻ⁿ = u'/(1−n).

Substituting gives a linear equation in u — the nonlinearity is gone. The exponent (1−n) is chosen precisely so the chain rule produces the term y'·y⁻ⁿ that we created by dividing.

You're distorting the coordinate system so a bumpy road becomes flat. The substitution is a change of variables that flattens the nonlinearity. Solve the flat version, then map back.

The scale symmetry argument

If dy/dx = F(y/x), then scaling x → λx and y → λy leaves F(y/x) = F(λy/λx) unchanged. The equation doesn't care about scale — only direction. This is a symmetry.

Substituting v = y/x (the "direction") removes the scale variable. After substitution, x factors out and the equation becomes separable in v and x — always. This is guaranteed by the homogeneity.

Think of a function that only depends on which direction you're pointing a compass, not how far you've walked. Switching to v = y/x means you're working in "angle space" instead of (x,y) space — and the equation separates cleanly there.

Why y' = v + xv'

This is just the product rule. If y = vx, then:

dy/dx = d(vx)/dx = v·(dx/dx) + x·(dv/dx) = v + x·dv/dx

This replacement turns the original equation into one involving v, v', and x — and the homogeneity guarantees the x's cancel or factor, leaving a separable equation in v and x.

Quick reference

The full strategy on one screen. Interrogate every ODE in this order.

Method Signature form Key move Result
Separable dy/dx = f(x)g(y) Divide by g(y), multiply by dx. Integrate both sides. ∫1/g dy = ∫f dx + C
Linear y' + P(x)y = Q(x) Multiply by μ = e^∫P dx. Left becomes d/dx[μy]. y = (1/μ)∫μQ dx + C/μ
Exact M dx + N dy = 0
∂M/∂y = ∂N/∂x
Find F with F_x=M, F_y=N via integration + g(y) recovery. F(x,y) = C (implicit)
Bernoulli y' + Py = Qyⁿ
n ≠ 0, 1
Divide by yⁿ. Sub u = y^(1−n). Becomes linear in u. Solve linear u ODE, then y = u^(1/(1−n))
Homogeneous dy/dx = F(y/x) Sub y = vx, y' = v + xv'. Becomes separable in v, x. Solve, then replace v = y/x
Autonomous dy/dx = f(y) Separable. Equilibria at f(y) = 0 reveal long-run behavior. ∫1/f(y) dy = x + C
IVP y(x₀) = y₀ Find general solution first. Substitute (x₀, y₀) to find C. Particular solution curve
The meta-rule
Classify first. Then apply the matching technique.
If nothing fits — try a substitution to transform the equation into one of these forms. The whole course is: recognize hidden structure.