Linear First-Order Equations
Suppose a tank holds brine whose concentration is stirred by an inflow. That inflow itself changes with time. How does the amount of salt evolve? This question, and hundreds like it in circuits, mixing, cooling, and population models, leads to a differential equation. In this equation, the unknown function and its derivative appear only to the first power. But the coefficients are allowed to depend on the independent variable. Such equations are not generally separable. The forcing term and the coefficient tangle and together. This resists factoring into -stuff times -stuff. The remarkable fact is that every such equation can be solved in closed form. This works by a single unifying trick. Multiply through by a cleverly chosen function called an integrating factor. It is chosen precisely so that the left side collapses into the derivative of a product. This converts the differential equation into something you can integrate directly. The trick is old — it goes back to Leibniz in the 1690s. It is one of the first places a student sees a general strategy. That strategy is "transform the equation into a shape you already know how to solve." The big picture is that linear first-order equations sit at the base of a tower. The integrating-factor idea reappears, generalized, when treating Exact Equations and general Integrating Factors for nonlinear equations. The explicit solution formula derived here is also a seed. From it, the variation-of-parameters method for higher-order linear equations grows. The entire linear theory is later reorganized using the The Laplace Transform: Definition and Existence. This transform converts differentiation into algebra. This article gives the precise definition of a linear first-order equation. It builds geometric intuition via slope fields. It proves the general solution formula rigorously (existence, uniqueness, and an explicit closed form). It works two asymmetric examples in full. It shows exactly which hypothesis cannot be dropped, and why.
- A linear first-order ODE has the form , with no powers or products of and .
- The integrating factor turns the left side into .
- Multiplying by and integrating gives an explicit formula for every solution.
- Continuity of and on an interval guarantees a unique solution through any initial point in that interval.
- The general solution is (particular solution) + (constant) (homogeneous solution) — a preview of linear superposition.
- Key idea: multiply by so the left-hand side becomes a single derivative, , which integrates directly.
Where this lives today
The integrating-factor solution to is not a historical curiosity; it is a working tool across quantitative science.
Circuits. An RL circuit with resistance , inductance , and a time-varying source voltage obeys , exactly a linear first-order equation with , ; the integrating-factor formula gives the current directly, including the transient decay from the homogeneous part.
Population and pharmacokinetics. Drug concentration in the bloodstream with a time-dependent infusion rate and constant elimination rate satisfies ; clinicians use exactly this formula to predict blood concentration profiles for variable-rate IV infusions.
Newton's law of cooling with variable ambient temperature. If the surrounding temperature oscillates (e.g. daily temperature cycles), the object's temperature obeys , again solved by the integrating factor, producing phase-shifted, damped oscillatory responses relevant to building thermal modeling.
Numerical analysis and control theory. The variation-of-constants formula proven here is the prototype for the matrix exponential solution in linear systems and control theory, where generalizes to a fundamental matrix.
Transform methods. The The Laplace Transform: Definition and Existence later re-derives and vastly generalizes this solution formula algebraically, converting the ODE into -type algebraic relations for constant-coefficient cases, recovering the integrating-factor result as a special case and extending naturally to higher-order and coupled systems.
Numerical ODE solvers. Implicit and exponential integrators used in stiff ODE solvers (e.g. exponential Euler methods) are direct numerical descendants of the exact integrating-factor formula, using -type factors to stabilize step sizes for stiff linear parts of a system.
Ask the tutor: How does the integrating-factor method change if and are replaced by matrices and vectors in a linear system ?
A linear first-order ordinary differential equation is an equation of the form
where and are given functions of (the coefficient and the forcing term, respectively), and is the unknown function. The equation is called linear because the left-hand side is a linear combination of and with coefficients depending only on — no terms like , , , or appear. If , the equation is called homogeneous; otherwise it is nonhomogeneous (or inhomogeneous). A function , differentiable on an interval , is a solution on if holds for every . An integrating factor for this equation is a function such that
identically in and , i.e. converts the left side into an exact derivative.
Intuition
Picture the equation as a rule assigning a slope to every point in the plane: the slope at is . A solution curve is a curve that, at every one of its points, has exactly the slope prescribed there — it "follows the arrows" of this slope field. Because the slope depends on linearly, the slope field has a rigid, orderly structure: along any vertical line , the slope is an affine (linear) function of , so the arrows tilt in a single consistent way as increases, never folding back on themselves. This rigidity is exactly why a closed-form solution exists for every choice of continuous and , unlike general nonlinear equations. The integrating factor can be understood as a reweighting of the unknown. Instead of tracking directly, track the auxiliary quantity . The differential equation, written in terms of this new quantity, becomes trivial: its derivative is just , a known function of alone. Antidifferentiating recovers , and dividing by recovers . The whole solution process is: multiply, recognize a product rule in reverse, integrate, divide.
The theorem
Let and be continuous functions on an open interval , and let and be given. Then the initial value problem
has one and only one solution defined on the entire interval . It is given explicitly by
Equivalently, writing for any fixed antiderivative of and , the general solution of on is
and every solution on arises from exactly one value of .
Technique. Direct construction via an integrating factor, followed by a uniqueness argument using the Fundamental Theorem of Calculus. This is a completely self-contained argument; it invokes only Separable Equations-style integration and basic calculus, not any later machinery.
Step 1: Existence of the integrating factor. Since is continuous on , it has an antiderivative on ; fix one and call it , so for all (this uses the Fundamental Theorem of Calculus, valid because is continuous). Define
Since is a composition of the exponential function with a differentiable function, is differentiable on , and by the chain rule,
Also for every , since the exponential function is everywhere positive. In particular on , so division by is always legitimate.
Step 2: collapses the left side into a derivative. Suppose is any differentiable function on . Consider the product . By the product rule,
Hence for any differentiable function ,
This confirms is an integrating factor in the sense of the definition: it converts into an exact derivative , for every candidate , before we have even assumed solves anything.
Step 3: Reduction of the ODE to a quadrature. Suppose solves on . Multiplying both sides of the equation by (legitimate, since this is an equality of functions and is a specific nonzero number at each ) gives
By , the left side equals . So
The right-hand side, , is continuous on because and are both continuous there ( is even , is given continuous). By the Fundamental Theorem of Calculus, integrating both sides from to (both in , and is an interval so the segment between them lies in ) gives
Imposing and solving for (dividing by , Step 1) yields exactly the claimed formula
This shows: if a solution to the IVP exists on , it must be given by . This proves uniqueness, granting existence.
Step 4: Existence — verify actually solves the IVP. We must check the converse: that the function defined by formula really does satisfy the differential equation and the initial condition, not merely that it is forced by the algebra above. Define by . First,
using that an integral from to is zero. This verifies the initial condition. Next, differentiate . Write where is a constant and . Since is continuous on , the Fundamental Theorem of Calculus gives , and is differentiable (hence continuous) on . Since is differentiable and nowhere zero on , is differentiable, with . By the product rule,
Rearranging, for every . So genuinely solves the differential equation on all of , and combined with , solves the IVP on all of .
Step 5: Uniqueness, restated. Step 3 showed any solution on must coincide with the specific function (the algebra in Step 3 used only that solves the equation and satisfies , and every step there was a reversible algebraic/integration manipulation forcing a unique output). Step 4 showed that function indeed solves the IVP. Hence the solution exists and is unique on all of .
Step 6: General solution formula. Two antiderivatives of differ by a constant, so any two choices of integrating factor differ by a positive multiplicative constant, which does not affect the ratio up to an additive constant of integration. Concretely, from , integrating without fixed limits gives for an arbitrary constant (this is exactly the general antiderivative, again by the Fundamental Theorem of Calculus, since is continuous), so
Every choice of gives a solution by the same verification as Step 4 (with replaced by ), and every solution corresponds to exactly one , namely -type matching to any one data point, by the uniqueness in Step 5. This proves the general-solution claim.
∎If on and is continuous on , the unique solution of , , is
In particular the only solution vanishing at some point of is the identically zero solution — a fact used repeatedly when arguing two solutions of a nonhomogeneous linear equation differ by a multiple of the homogeneous solution.
Worked examples
Example 1 (variable coefficient, nonzero forcing, nonzero initial time). Solve
Step 1 — standardize. Divide by (valid since ):
So , , both continuous on , which contains . Step 2 — integrating factor.
so take
Check: . ✓. Step 3 — multiply through.
and the left side is by construction. Step 4 — integrate. We need . Integrate by parts twice. First: let , , so , :
Second, on : let , , , :
Combine:
So
Step 5 — solve for .
Step 6 — impose . Since has (as , cosine period ) and :
Solve for :
Final answer.
This solution is valid and unique on the entire interval by the theorem, since are continuous there.
Example 2 (mixing problem — a genuine modeling application). A 200-liter tank initially contains 40 kg of dissolved salt in 100 liters of brine. Starting at , brine containing of salt flows in at , while the well-mixed solution drains out at only (so the tank fills up over time). Find the amount of salt (in kg) for (the tank overflows at , since it gains 2 L/min net and starts at 100 L, filling the remaining 100 L in 50 min). Setting up the equation. Volume in the tank at time : inflow rate L/min, outflow rate L/min, so net rate L/min, giving
Salt balance: rate in minus rate out.
since the outflow concentration equals the tank's current concentration (well-mixed assumption). So
Rearrange to standard linear form:
Here and , both continuous on (the denominator throughout), so the theorem applies with extended to an open interval containing it, and . Integrating factor.
so
Multiply through and integrate.
Integrate the right side using the substitution , :
So
Apply the initial condition .
Final answer.
Sanity checks: at , ✓, matching the given initial condition. As (formally, ignoring the overflow constraint), while the equilibrium concentration -type behavior is approached; the correction term , so the solution is asymptotic to , i.e. concentration kg/L, matching the inflow concentration — exactly the physically expected long-run behavior since outflow becomes a vanishing fraction of the ever-larger tank relative to a constant inflow rate of pure input concentration. This qualitative check confirms the algebra.
The theorem requires (and ) to be continuous on an interval containing . Drop this and both existence and uniqueness can fail on any interval straddling the discontinuity. Consider
so , which is not continuous at — it is not even defined there. Try to solve the IVP on the interval , which contains the discontinuity at . Direct substitution shows solves for every constant , and every one of these satisfies . So the IVP has infinitely many solutions on — uniqueness fails completely. Worse, try the IVP on the same interval. If then for every , and one can show no differentiable function satisfies both the ODE and on an interval containing : near the equation forces finite behavior incompatible with while forces for by the corollary applied separately on and , and any such piecewise solution is forced to vanish at if continuous there. So existence fails for this data. This is precisely because blows up at : the interval of continuity for is really or , never an interval containing . The theorem's guarantee — existence and uniqueness on the whole interval — is only as strong as the interval on which are continuous, and one must never apply the formula across a singularity of .
Scope, edge cases & common traps
| Situation | What happens |
|---|---|
| continuous on all of | Solution exists and is unique for all ; no finite escape time (linear equations with everywhere-continuous coefficients never blow up in finite time). |
| has a discontinuity (e.g. jump, pole) at | Solve separately on each maximal interval of continuity not containing ; matching solutions across requires extra physical/continuity conditions, and uniqueness across can fail (see counterexample). |
| piecewise continuous (e.g. a switched forcing) | Solve on each piece, then match values at the switch point to fix constants — standard in circuits with a switch closing at . |
| Forgetting | The homogeneous solution must be retained; omitting it silently discards the entire one-parameter family of solutions and violates the initial condition in general. |
| Sign error in | , not ; the sign is easy to flip and instantly breaks in the proof. |
| Dividing by (or another vanishing factor) to reach standard form | Valid only away from the zero; changes the natural domain of the problem — always re-state the interval after this step. |
The mathematician behind it
Origins · 1 minGottfried Wilhelm Leibniz and how this was discovered
Leibniz developed the calculus notation and many of its early techniques, including the method for solving linear first-order differential equations by an integrating factor, in correspondence and papers during the 1690s. Working alongside Jacob and Johann Bernoulli on a flood of new differential equations arising from mechanics and geometry, Leibniz recognized that multiplying an equation by a well-chosen factor could reduce it to something directly integrable — the germinal idea behind essentially all of the elementary solution techniques that followed, including separation of variables and, much later, the systematic linear theory built on matrix exponentials and transforms.
Why is the equation called "linear" if can be a wild nonlinear function of ?
"Linear" refers strictly to how the unknown and its derivative enter the equation, not to how the independent variable enters. The left side is a linear (degree-one, no products) combination of and ; the coefficients and the forcing term can be arbitrarily nonlinear or even non-elementary functions of alone, and this does not affect linearity in . This distinction matters because linearity in is exactly what makes superposition, the integrating-factor trick, and closed-form solvability possible — none of that requires or to be simple functions of .
What if I cannot compute or in closed form?
The theorem guarantees existence and uniqueness regardless of whether the integrals are elementary; the formula is a rigorous, exact representation of the solution even when the integrals must be left as definite integrals or evaluated numerically. This is common with equations like : the solution is entirely legitimate and well-defined, just not expressible via elementary functions, and one reports it either as a definite integral or approximates it numerically.
How does this relate to separable equations?
Separable Equations are those where can be split as . A linear equation is separable only in the special homogeneous case , since then separates cleanly. Once , the equation is generically not separable — you cannot isolate all -dependence on one side — which is exactly why the integrating-factor method, a genuinely different technique, is needed for the nonhomogeneous case.
Does the integrating-factor method generalize beyond first order?
Yes, in spirit. For higher-order linear equations, the analogous tool is variation of parameters, which uses a fundamental set of homogeneous solutions in place of the single factor . For systems , the scalar generalizes to a matrix-valued fundamental solution , and the analogous formula holds under suitable hypotheses. The scalar case here is the base of that entire hierarchy.
Can or be complex-valued, or can range over an unbounded interval like ?
Yes to both. The proof only used continuity, the Fundamental Theorem of Calculus, and basic algebra, none of which require real-valuedness or a bounded interval; it goes through verbatim for complex-valued (interpreting the exponential via its complex power series) and for , , or all of . This generality is exactly what is exploited later when linear equations with complex or oscillatory forcing (e.g. ) are solved via the same formula.
Is the integrating factor unique?
No — any positive constant multiple of is also a valid integrating factor, since constant multiples don't affect whether holds (both sides simply get scaled by the same constant). What is unique, given the equation, is the family ; conventionally one fixes (or, as in the theorem, picks the antiderivative vanishing at ) for simplicity, but the final solution that results is identical regardless of that choice.
What goes wrong if I try to apply this method to a genuinely nonlinear equation like ?
The key identity in the proof crucially used that and appear to the first power, so that literally equals by the product rule. If replaces , no single multiplier turns into an exact derivative of a simple product, because the product rule applied to produces a term linear in , not . Such equations (e.g. the Bernoulli equation ) require a nonlinear substitution, like , to convert them into a linear equation first — a different, though related, technique building directly on this one.