Variation of Parameters
Suppose a mass on a spring is forced not by a clean sinusoid, but by a signal like or . Can any method still hand us an explicit particular solution? This question matters because most forcing functions occurring in real circuits, structures, and orbits are not the polynomials, exponentials, and sinusoids that Method of Undetermined Coefficients can handle. Variation of parameters answers the question completely. Given any continuous forcing function, and given only the homogeneous solutions, it produces a particular solution. It does so by an explicit integral formula. The technique replaces the constants in the homogeneous solution with unknown functions. It then forces those functions to satisfy a clever pair of algebraic constraints. These constraints are solvable precisely because the The Wronskian and Linear Independence of the homogeneous solutions never vanishes. This article states and proves the variation-of-parameters formula for second-order linear equations in full generality. It works two asymmetric examples by hand. It shows exactly what fails without linear independence. Finally, it points toward its extension to higher-order and first-order linear systems.
- Variation of parameters produces a particular solution for any continuous forcing , not just special forms.
- It starts from the homogeneous solutions and lets the "constants" become functions .
- Two algebraic conditions on come from substitution; solving them requires the Wronskian .
- The final formula is an explicit definite integral built from , , , and .
- It strictly generalizes undetermined coefficients and handles , , , etc.
- Key idea: replace constants by functions, and choose those functions so the extra derivative terms cancel exactly.
Where this lives today
Variation of parameters extends directly to higher-order linear equations (see Higher-Order Linear Equations), where an linear system built from the Wronskian-like determinant of fundamental solutions plays the same role, and to first-order linear systems (see Systems of First-Order Linear ODEs), where the fundamental matrix replaces the pair and the formula becomes . In physics, the same "constants become slowly varying functions" idea underlies classical perturbation theory for planetary orbits (Lagrange's original motivation) and the interaction picture in quantum mechanics, where wavefunction coefficients evolve slowly under a perturbing Hamiltonian. In electrical engineering, it computes the response of an circuit to an arbitrary time-varying voltage source that is not expressible via simple Laplace-transform table entries. In control theory, the variation-of-parameters (Duhamel) formula gives the state of a linear time-varying system driven by an arbitrary input, forming the basis of convolution representations of system response. In numerical analysis and applied math more broadly, the formula is the continuous analogue of Duhamel's principle, used to build solution representations for inhomogeneous PDEs (heat and wave equations) from their homogeneous Green's functions.
Ask the tutor: How does the variation-of-parameters formula change for a third-order linear equation, and what replaces the Wronskian system?
Consider the second-order linear nonhomogeneous equation in standard form
where are continuous on an open interval . Let be a fundamental set of solutions of the associated homogeneous equation
on , so that the Wronskian
satisfies for every . Variation of parameters seeks a particular solution of the form
where are functions (not constants) determined by imposing
Solving this linear system for via Cramer's rule and integrating yields the particular solution
Intuition
The starting point is the general homogeneous solution , valid when . When , constants can no longer make the equation balance — the equation has a "budget" of forcing to absorb at every instant, and fixed constants have no way to track a moving target. The fix is to let the coefficients drift in time, and , giving them exactly enough freedom to soak up the forcing at each instant while still riding along the shapes that solve the homogeneous problem. There is a subtlety: differentiating twice introduces four new terms involving , and substituting into the ODE gives one equation in two unknown functions — hopelessly underdetermined without another condition. The trick is to impose a second condition by choice: demand . This eliminates the second-derivative terms from the substitution entirely, and what remains collapses to a clean linear algebraic system for at each fixed . That system's coefficient matrix is exactly the matrix whose determinant is the Wronskian — this is the payoff for demanding be linearly independent solutions in the first place. Geometrically, think of and as two vectors in the phase plane at each time . Linear independence of as functions is equivalent to these two vectors never being parallel, i.e. . The system for asks: "in the basis given by these two non-parallel vectors, how do I resolve the pure forcing vector ?" Because the vectors are never parallel, this resolution is always possible and unique.
The Central Theorem
Let be an open interval and let be continuous functions. Consider
and suppose form a fundamental set of solutions of the homogeneous equation
on , i.e. are twice continuously differentiable, each solves the homogeneous equation, and their Wronskian is nonzero for every . Fix any . Then the function
is well-defined, twice continuously differentiable on , and satisfies on . Consequently, the general solution of on is
Technique: direct construction and verification (variation of the constants, followed by substitution check). Step 1 — Setting up the ansatz. Seek a particular solution of the form
for functions to be determined, assumed differentiable where needed (this will be justified by the explicit formula obtained). Differentiate once:
There are two unknown functions but so far only one equation will eventually come from substituting into ; to pin down uniquely we impose, by choice, the auxiliary condition
This is legitimate: we are not assuming a fact but choosing one of two degrees of freedom to simplify the computation; we must verify at the end that a solution satisfying (A) actually produces a genuine particular solution, which we do below. With (A) imposed,
Step 2 — Second derivative and substitution. Differentiate again:
Substitute into :
Group terms by and :
Since and each solve the homogeneous equation, the two parenthesized coefficients of and vanish identically. What remains is the second condition
Step 3 — Solving the linear system (A)–(B) using the Wronskian. Conditions (A) and (B) together form the linear system
at each . The coefficient matrix has determinant exactly , which is nonzero for all by hypothesis (this is precisely where linear independence of , via The Wronskian and Linear Independence, is used). Hence the matrix is invertible at every , and by Cramer's rule the unique solution is
Both right-hand sides are continuous on : are hence continuous, is continuous by hypothesis, and is continuous (a sum of products of continuous functions) and nonvanishing, so the quotient is continuous. Continuous functions have antiderivatives (by the Fundamental Theorem of Calculus), so define
for a fixed base point . These are well-defined, differentiable on (again by the Fundamental Theorem of Calculus, since the integrands are continuous), with derivatives exactly matching the required above. Since are themselves continuous, are in fact , and since , the combination is as required (each term is a product of a and a function, hence ; and we already showed is differentiable again in Step 2's computation, which used only existing and existing — all present). Step 4 — Verification that solves . By construction, satisfy (A) and (B) by the Fundamental Theorem of Calculus applied to their defining integrals. Retracing Steps 1–2 in reverse: because (A) holds, ; because (A) and (B) both hold, the substitution computation in Step 2 shows
Thus solves on . Substituting the explicit forms of gives the stated closed formula for . Step 5 — General solution. Let be any solution of on . Then satisfies, by linearity of the differential operator,
so solves the homogeneous equation. Since form a fundamental set, every homogeneous solution is uniquely for some constants (this is the standard existence-and-uniqueness consequence for linear homogeneous equations, taken as known background here). Hence , establishing that this family is exactly the general solution of .
∎Worked examples
Example 1: Non-constant forcing requiring variation of parameters, with . Solve on the interval (where is continuous). The homogeneous equation has fundamental set , . Compute the Wronskian:
So on , confirming a fundamental set. Undetermined coefficients cannot handle (it is not a solution of any constant-coefficient homogeneous equation), so variation of parameters is the tool required. Using the formula with :
Integrate:
Next,
so
Assemble the particular solution:
Expand and simplify:
The terms cancel exactly — a useful arithmetic check. The general solution is
and since already appears in the homogeneous family, one may absorb it: with arbitrary. As a sanity check, differentiate directly:
using . Then
Add: , confirming the solution.
Example 2: A Cauchy–Euler equation with forcing (variable coefficients, asymmetric homogeneous solutions). Solve, for ,
First convert to standard form by dividing by (valid since ):
This is a Cauchy–Euler equation; trying in gives , i.e. , so . Take the fundamental set
Compute the Wronskian:
nonzero for , confirming linear independence there. Now apply the formula with the standard-form :
Integrate by parts ():
Next,
so, integrating by parts (),
Assemble:
Expand:
Since is not a homogeneous solution (the homogeneous solutions are , not ), this term must remain — a good asymmetry check distinguishing this from Example 1, where a stray homogeneous term appeared and could be absorbed. Check by direct substitution. With :
Now compute :
This matches the original right-hand side exactly, confirming the solution. The general solution is
Drop the hypothesis that form a fundamental set, and instead pick two homogeneous solutions that are linearly dependent. Consider again on , but instead of the correct fundamental set, take
Both solve (any scalar multiple of a homogeneous solution is a homogeneous solution), but , so they are linearly dependent. Their Wronskian is
Attempting the variation-of-parameters system,
has coefficient matrix with determinant , hence it is never invertible on any subinterval. Cramer's rule breaks down (division by zero), and in fact the system is either inconsistent or has infinitely many solutions at each rather than a unique one — the derivation in Step 3 of the theorem's proof collapses entirely, since the very first step (inverting the coefficient matrix) is impossible. No consistent choice of continuous solving both (A) and (B) can be extracted by this method. The deeper reason: with dependent, spans only a one-dimensional space of functions, so can only ever produce multiples of , regardless of how are chosen — it cannot produce the needed extra "boost" (, found in Example 1) that lies outside . This confirms that the nonvanishing-Wronskian hypothesis is not a technical convenience but is load-bearing: without it the ansatz cannot reach the required particular solution at all.
Scope, edge cases & common traps
| Situation | What happens | Correct handling |
|---|---|---|
| Equation not in standard form | Using the raw from | Divide through by first; the formula needs the standard-form |
| is a "nice" function (polynomial × exponential × sinusoid) | Both methods work | Undetermined coefficients is usually faster; variation of parameters always works too |
| , etc. | Undetermined coefficients fails (no finite trial family) | Variation of parameters is the only elementary route |
| Interval where at isolated points | Formula's integrals may diverge or be undefined | Restrict to a subinterval where throughout |
| Homogeneous solutions chosen linearly dependent | , system uninvertible everywhere | Always verify before proceeding — see the counterexample |
| Resulting contains a homogeneous-solution term | Looks "wrong" compared to a textbook answer | It is still correct; such a term can be absorbed into |
The mathematician behind it
Origins · 1 minJoseph-Louis Lagrange and how this was discovered
Lagrange, born in Turin and later a central figure at the Berlin Academy and the Paris École Polytechnique, developed the method of variation of arbitrary constants (his own term for what is now called variation of parameters) in his work on celestial mechanics during the 1770s and 1780s. He needed a way to describe how the orbital "constants" of a two-body Kepler orbit — semi-major axis, eccentricity, and so on — slowly drift under the gravitational perturbation of a third body. Treating these constants as slowly varying functions of time, governed by a system of differential equations derived exactly as in the proof above, became one of the most durable techniques in both pure and applied analysis, later reappearing as the foundation of perturbation theory in mechanics and in the modern treatment of first-order linear systems.
Do I need to memorize the boxed integral formula, or is it enough to know the derivation?
Either works, but knowing the derivation is far more robust. The boxed formula is easy to misremember (sign errors, swapped subscripts), while the derivation — impose , substitute to get , solve the system via the Wronskian, integrate — regenerates the correct formula every time and also makes clear exactly what "standard form" means for . For exams, deriving from scratch on the given equation is safer than recalling the formula verbatim.
Does variation of parameters work when the homogeneous equation has variable coefficients, not just constant coefficients?
Yes — this is exactly where variation of parameters is indispensable, since undetermined coefficients requires constant coefficients (or at least a finite-dimensional annihilator structure) and simply does not apply to variable-coefficient equations. Example 2 above is a Cauchy–Euler (variable-coefficient) equation, and the method worked without modification, using whatever fundamental set happens to solve the homogeneous variable-coefficient equation. The only requirements are that be continuous on the interval and that a fundamental set with nonvanishing Wronskian be known or found by other means (such as the Cauchy–Euler trial solution , or reduction of order given one solution).
What if I cannot find and explicitly?
Then variation of parameters cannot get started, because the entire formula is built from and their Wronskian. The method presupposes that the homogeneous equation has already been solved. If only one homogeneous solution is known, the technique of reduction of order can sometimes produce a second, linearly independent solution , after which variation of parameters applies as usual. For homogeneous equations with no closed-form solution at all, one typically resorts to power series methods or numerical integration instead.
Is variation of parameters ever the wrong tool even when it technically applies?
Yes, in the sense of practicality. If is a polynomial, exponential, sine/cosine, or product of these, and the equation has constant coefficients, undetermined coefficients is almost always faster because it avoids computing integrals (sometimes quite involved ones, as in Examples 1–2 above, requiring integration by parts or logarithms of trigonometric expressions). Variation of parameters is best reserved for forcing functions like , , , or that undetermined coefficients cannot handle at all, or for variable-coefficient equations where undetermined coefficients does not apply in principle.
Why does the formula involve dividing by rather than just by or individually?
Because the system for is a genuine linear system, not two separate one-variable equations. Cramer's rule for such a system always produces a determinant (here, the Wronskian) in every denominator, reflecting the fact that and each depend on both rows of the original system simultaneously. Dividing by or alone would implicitly assume the system decouples, which it does not — the two conditions and are coupled equations in together.
Can this method produce a particular solution that already contains a piece of the homogeneous solution?
Yes, and this is not an error. Example 1 above produced , where the term is itself a homogeneous solution. Since the constant in the definite integrals is arbitrary, different choices of shift by constants times — all such choices give equally valid particular solutions, and they all get absorbed into the arbitrary constants when writing the general solution .
How does this generalize beyond second-order equations?
For an th-order linear equation with fundamental set , the ansatz is supplemented by auxiliary conditions analogous to (A), plus one final condition analogous to (B) coming from substitution, giving an linear system for whose coefficient matrix determinant is again the Wronskian of . The same idea, phrased in matrix form using a fundamental matrix , gives the variation-of-parameters (Duhamel) formula for general first-order linear systems , which is the natural setting explored in Systems of First-Order Linear ODEs.