Variation of parameters
Undetermined coefficients is a good trick as long as the right-hand side of a linear ODE looks like something you could have guessed — a polynomial, an exponential, a sine. The moment the forcing term is , , , or , the guess-a-trial-form method has nothing to guess. Variation of parameters is the fallback that never runs out of road: instead of guessing a particular integral, it promotes the two arbitrary constants of the complementary function into unknown functions of , then pins those functions down by direct substitution into the ODE. It works for any continuous right-hand side and even for equations with variable coefficients, provided the complementary function is already known. This article builds the method from the standard-form ODE up to a fully solved trigonometric example, the natural next step after mastering undetermined coefficients.
Replacing the constants in the complementary function by unknown functions , and imposing one convenient auxiliary condition, converts the ODE into a solvable linear system for and — giving a particular integral for any right-hand side , not just standard trial forms.
The core idea
Where it fits. Variation of parameters is presented in the MA10001 ODE unit as the general-purpose alternative to undetermined coefficients: reach for it when is not polynomial, exponential, or sinusoidal, or when the ODE has non-constant coefficients. It leans entirely on the complementary function already found from the auxiliary-equation method, so that earlier topic is a hard prerequisite here.
The setup. Write the ODE in standard form, leading coefficient equal to one:
where: are the coefficient functions and is the forcing term after dividing through by whatever multiplied originally. Suppose the complementary function is already known,
where: are two linearly independent solutions of the homogeneous equation . The method looks for a particular integral of the same shape but with the constants promoted to unknown functions,
Two unknown functions need two equations. One comes from substituting into the ODE; the other is a free choice — imposed purely to keep the algebra from spiralling into second derivatives of . The standard choice is . Together with the equation the ODE forces, this yields the pair
The picture below shows the shift in strategy this represents: undetermined coefficients hands you a fixed trial shape to match against ; variation of parameters instead lets the "constants" of the complementary function flex into functions, solved for by the system above.
Solving the system by Cramer's rule, using the Wronskian as the determinant, gives closed forms for the two derivatives:
Integrating each gives and ; the particular integral is then , and the general solution is , exactly as with undetermined coefficients. Nothing here required to have any particular shape — that is the entire point of the method.
The goal of this derivation is to justify, from the two simultaneous equations above, the specific formulas and that let a student read off both derivatives directly once the complementary function and are known, rather than re-deriving the linear-algebra step from scratch on every problem.
Step 1. Start from the pair of equations obtained by substituting into the ODE and imposing the auxiliary condition:
Treat and as the two unknowns of a linear system, with all known functions of at this stage.
Step 2. Write the system in matrix form to expose its determinant:
The determinant of the coefficient matrix is precisely the Wronskian, . Because are linearly independent solutions of the homogeneous equation, everywhere on the interval of interest, so the system has a unique solution — this is exactly why the method never gets stuck.
Step 3. Apply Cramer's rule for : replace the first column of the coefficient matrix with the right-hand side column and divide by .
Step 4. Apply Cramer's rule for : replace the second column instead.
Step 5. Both formulas are now purely in terms of the known complementary-function pair , their derivatives, the Wronskian , and . Integrating and with respect to (dropping the constants of integration, since they only reproduce the already present in ) gives and , and follows immediately.
Worked example
Problem. Solve using variation of parameters.
Step 1. Find the complementary function. The auxiliary equation is , giving , , and . Undetermined coefficients cannot be used here since is not a standard trial type — this is exactly the signal to reach for variation of parameters.
Step 2. Compute the Wronskian: .
Step 3. Compute and using the boxed formulas, with : , and .
Step 4. Integrate: , and .
Step 5. Assemble the particular integral: .
Step 6. State the general solution: .
Competitive stretch
The same machine handles repeated roots and non-trigonometric together. For (), the auxiliary equation gives the repeated-root complementary function , , with Wronskian . Then and , so and . That gives , and the general solution is — note the piece could be absorbed into but is left explicit for clarity of derivation.
Common traps
- Skipping the auxiliary condition . That condition is what turns one second-order ODE into a solvable pair of first-order equations for two unknowns; omit it and the system is underdetermined.
- Forgetting to reduce to standard form first. If the given equation is with , divide through by before reading off — using directly gives a wrong particular integral.
- Sign slip between and . Remember carries a minus sign while does not; swapping the signs is the single most common arithmetic error in this method.
- Reaching for undetermined coefficients on a non-standard such as , , , or instead of recognising that only variation of parameters applies to these forcing terms.
Ask the tutor: if the Wronskian setup or the sign in keeps tripping you up, ask the AI tutor to walk through a fresh variation-of-parameters problem with you line by line.
Why do we need the extra condition u1 prime y1 plus u2 prime y2 equals zero — where does it actually come from?
It is a free choice, not something forced by the ODE. Differentiating once gives terms in as well as ; substituting a second time into the ODE would otherwise drag in second derivatives of , making the algebra much messier. Setting deliberately kills those extra terms before the second differentiation, so only first derivatives of survive. It is consistent because we still have two unknown functions and, with this condition plus the equation the ODE forces, exactly two equations to pin them down.
Can variation of parameters be used even when undetermined coefficients would also work?
Yes — variation of parameters is fully general and will reproduce the same particular integral (up to reabsorbing a constant into ) for any that undetermined coefficients can also handle, such as a polynomial or an exponential. It is simply more work: undetermined coefficients skips the Wronskian and the integration steps entirely by guessing a trial form. In practice, use undetermined coefficients whenever is a standard trial type, and switch to variation of parameters only when it is not, or when the coefficients are not constants.
What happens if the two solutions y1 and y2 chosen for the complementary function are not linearly independent?
Then the Wronskian is identically zero, and the formulas , involve division by zero — the method breaks down completely, because a single solution repeated cannot span the two-dimensional solution space of a second-order ODE. This is why the complementary function must always be built from two genuinely independent solutions (for a repeated root , that means and , not twice); a nonzero Wronskian is exactly the algebraic test for that independence.