JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Linear First-Order Equations & Their Tricks

One reliable recipe — the integrating factor — cracks every linear first-order equation in closed form. Then two famous substitutions, Bernoulli's and Riccati's, smuggle whole families of nonlinear equations back into that same trustworthy machine.

One shape, one guaranteed answer

The previous guide showed that a separable equation is a lucky accident — the variables happen to pull apart, and when they do not, the trick simply fails. This guide hands you something far more dependable. The linear first-order equation is the one differential equation in this whole rung that always surrenders to a single fixed recipe, every single time, with no guessing and no luck required. Once you can bend your equation into its shape, you are essentially done.

The standard form is dy/dx + P(x) y = Q(x). Read it carefully: the unknown y appears alone, only to the first power, multiplied at most by a function of x — never by y itself, never inside a sine or a square root. That linearity in y is the whole reason a closed-form recipe exists. The right side Q(x), the forcing or source term, depends only on x; it is the input driving the system. If your equation does not look like this yet, your first job is always to massage it into this exact template.

The integrating factor: turning the left side into one derivative

Here is the obstacle. The left side, dy/dx + P(x) y, is almost the derivative of a product — but not quite. Recall from Volume I that the product rule says d/dx of (mu y) equals mu (dy/dx) + (d(mu)/dx) y. Compare that to our left side: if only the bare y were riding a coefficient that is the derivative of the coefficient on dy/dx, the two would collapse into one tidy term. The integrating factor is the multiplier mu(x) engineered to force exactly that collapse.

Multiply the whole standard-form equation through by mu(x). The left side becomes mu (dy/dx) + mu P y, and we want this to equal d/dx of (mu y) = mu (dy/dx) + (d(mu)/dx) y. Matching the two y-terms demands d(mu)/dx = mu P — a tiny separable equation for mu itself, whose solution is mu(x) = e^{integral of P(x) dx}. That exponential is the magic spoonful. With it in hand the left side is exactly d/dx of (mu y), and the equation reads d/dx(mu y) = mu Q. Now integrate both sides once — invoking the antiderivative you already trust — and you are home: mu y = integral of mu Q dx + C, so y = (1/mu)(integral of mu Q dx + C).

dy/dx + P(x) y = Q(x)            standard form

mu(x) = e^( integral P(x) dx )   the integrating factor

multiply through by mu:
  d/dx ( mu * y ) = mu * Q(x)    left side is now ONE derivative

integrate once:
  mu * y = integral( mu * Q ) dx + C
  y = (1/mu) * ( integral( mu * Q ) dx + C )
The complete integrating-factor recipe: build mu, multiply, collapse to one derivative, integrate once.

Walking one through — and reading the answer

Take dy/dx + (1/x) y = x, valid for x > 0. Here P = 1/x, so mu = e^{integral of 1/x dx} = e^{ln x} = x. Multiply through by mu = x: the equation becomes d/dx(x y) = x^2, the left side now a single derivative exactly as promised. Integrate once: x y = x^3/3 + C, and so y = x^2/3 + C/x. One multiplication, one integration, and the entire family of solutions appears — the C/x term is the freedom you expect from a first-order equation, pinned down only once you supply an initial condition.

Look at the structure of that answer, because it is the seed of everything that follows in the ladder. The piece C/x solves the homogeneous version (with Q = 0), and the piece x^2/3 is one particular response to the forcing Q = x. Every linear solution splits this way: a homogeneous part plus a particular part. When the forcing is switched off (Q = 0), the answer is purely y = C/mu = C e^{-integral of P} — a decaying or growing exponential, the system relaxing on its own. Turn the forcing on and you simply add the response it drives. This homogeneous-plus-particular decomposition is the backbone of all the higher linear theory still to come.

This is not a textbook toy. The very same equation, dq/dt + q/(RC) = V/R, describes a capacitor charging through a resistor; mu = e^{t/(RC)} delivers the familiar q(t) = C_0 V (1 - e^{-t/(RC)}), the smooth approach to full charge. Swap the symbols and it is a mixing tank filling and draining, or Newtonian cooling toward a drifting ambient temperature, or radioactive decay under a steady feed. Wherever a quantity changes at a rate linear in itself plus an outside push, this is the equation — and the integrating factor never fails on it.

Bernoulli: a nonlinear equation that is secretly linear

Because the integrating factor is so dependable, the natural next move is greedy: can we drag nonlinear equations into linear form so the same machine finishes them? Often yes. The most celebrated case is the Bernoulli equation, dy/dx + P(x) y = Q(x) y^n. It looks just barely out of reach — that lone y^n on the right is the only nonlinear blemish, the single term that disqualifies the integrating factor. (When n is 0 or 1 the equation is already linear, so those cases are excluded.)

  1. Spot the pattern and read off n — the power of y on the right side.
  2. Substitute v = y^{1-n}. Differentiate it (using the chain rule) so that dv/dx pulls out exactly the y^{-n} factor needed to cancel the nonlinear term.
  3. The equation becomes linear in v: dv/dx + (1-n) P(x) v = (1-n) Q(x). Solve it by its integrating factor, exactly as above.
  4. Undo the substitution: replace v by y^{1-n} and solve for y to recover the answer in the original variable.

A concrete picture: dy/dx + y = y^2, so n = 2 and we set v = y^{1-2} = 1/y. Differentiating gives dv/dx = -y^{-2}(dy/dx), and after substituting the equation collapses to the linear dv/dx - v = -1. Its integrating factor is e^{-x}, and the solution is v = 1 + C e^x. Undo it: y = 1/v = 1/(1 + C e^x) — an unmistakably S-shaped curve. That is no coincidence. With n = 2 the logistic equation of bounded growth is itself a Bernoulli equation, and this substitution is one clean way to solve it.

Riccati: where the closed forms run out

Push one rung higher and you hit the Riccati equation, dy/dx = q_0(x) + q_1(x) y + q_2(x) y^2 — a constant term, a linear term, and the telltale y^2. It looks barely more complicated than Bernoulli, yet that single quadratic changes everything. There is no formula that produces its general solution from the coefficients alone; in general a Riccati equation simply cannot be solved in elementary functions. This is an honest mathematical frontier, the place where the tidy class of solvable first-order equations runs out.

Two lifelines keep it from being hopeless. First, a remarkable transformation: the substitution y = -u'/(q_2 u) turns the Riccati equation into a linear second-order equation for u. So a single nonlinear first-order equation is exactly equivalent to a linear one of one order higher — which is why Riccati equations are bound up with second-order linear theory and special functions, and you will meet them again on the next rung. Second, a partial gift: if you can somehow guess one particular solution y_1, then the substitution y = y_1 + 1/v reduces what remains to a Bernoulli (in fact linear) equation you can finish off completely.

Be precise about the claim, because it is easy to overstate. 'No elementary solution in general' does not mean 'no solution'. A Riccati equation always has genuine solutions — existence is not in doubt. They simply may not be expressible as a finite combination of elementary functions, just as the integral of e^{-x^2} is a real, well-defined number with no elementary antiderivative. To pin a Riccati solution down you may need a known particular solution, a special function, or a numerical method — but the solution is always there.

Step back and see the arc of these three. The integrating factor solves every linear equation outright. Bernoulli's substitution linearizes a clean nonlinear family and hands it back to that machine. Riccati's quadratic finally breaks the spell — yet even there, structure survives: the equation lifts to a solvable linear problem one order up, or yields to a lucky guess. The recurring lesson of this rung is that the real dividing line is not linear-versus-nonlinear but 'has hidden structure' versus 'does not', and substitution is how you go hunting for that structure.