Fiveable

Linear Algebra and Differential Equations Unit 9 Review

QR code for Linear Algebra and Differential Equations practice questions

9.2 Method of Undetermined Coefficients and Variation of Parameters

9.2 Method of Undetermined Coefficients and Variation of Parameters

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
Linear Algebra and Differential Equations
Unit & Topic Study Guides

Particular Solution Forms

Polynomial and Exponential Forms

When you're solving a nonhomogeneous linear ODE, the first step is figuring out what form your particular solution ypy_p should take. The nonhomogeneous term (the right-hand side) tells you what to guess.

  • Polynomial right-hand side: guess a polynomial of the same degree, but include all lower-degree terms too.
    • For x2+3xx^2 + 3x, try yp=Ax2+Bx+Cy_p = Ax^2 + Bx + C. You need that constant CC even though the original has no constant term, because derivatives can shift degrees down.
  • Exponential right-hand side eaxe^{ax}: guess AeaxAe^{ax}.
    • For 5e2x5e^{2x}, try yp=Ae2xy_p = Ae^{2x}.
  • Products of functions: guess the corresponding product form.
    • For xexxe^x, try yp=(Ax+B)exy_p = (Ax + B)e^x. You need both AxAx and BB because differentiating the product will generate lower-degree polynomial terms.

Trigonometric and Special Cases

  • Sine or cosine right-hand side: always include both sine and cosine in your guess, even if only one appears on the right-hand side. Derivatives of sine produce cosine and vice versa.
    • For 3sin(4x)3\sin(4x), try yp=Asin(4x)+Bcos(4x)y_p = A\sin(4x) + B\cos(4x).
  • Combination of types: use the superposition principle. Build a guess that covers each piece.
    • For 2x+3ex+sin(x)2x + 3e^x + \sin(x), try yp=Ax+B+Cex+Dsin(x)+Ecos(x)y_p = Ax + B + Ce^x + D\sin(x) + E\cos(x).
  • Overlap with the homogeneous solution (the modification rule): if any term in your guess already solves the homogeneous equation, multiply that term by xkx^k, where kk is the multiplicity of the corresponding root in the characteristic equation.
    • If exe^x is already a homogeneous solution (simple root), try yp=Axexy_p = Axe^x instead of AexAe^x.
    • If exe^x corresponds to a double root, you'd need yp=Ax2exy_p = Ax^2 e^x.

Undetermined Coefficients Method

Procedure and Implementation

This method works for constant-coefficient linear ODEs where the right-hand side is a combination of polynomials, exponentials, sines, and cosines. Here's the process:

  1. Solve the homogeneous equation y+py+qy=0y'' + py' + qy = 0 to get ycy_c.
  2. Write a guess for ypy_p based on the form of the right-hand side (using the rules above).
  3. Check for overlap between your guess and ycy_c. If there's overlap, multiply the overlapping terms by xkx^k.
  4. Substitute ypy_p and its derivatives into the original ODE.
  5. Collect like terms and set coefficients equal on both sides.
  6. Solve the resulting algebraic system for the undetermined constants.

Worked example: Solve y+4y=x2y'' + 4y = x^2.

  1. Homogeneous solution: characteristic equation r2+4=0r^2 + 4 = 0 gives r=±2ir = \pm 2i, so yc=c1cos(2x)+c2sin(2x)y_c = c_1\cos(2x) + c_2\sin(2x).
  2. Right-hand side is a degree-2 polynomial, so guess yp=Ax2+Bx+Cy_p = Ax^2 + Bx + C. No overlap with ycy_c.
  3. Compute derivatives: yp=2Ax+By_p' = 2Ax + B, yp=2Ay_p'' = 2A.
  4. Substitute: 2A+4(Ax2+Bx+C)=x22A + 4(Ax^2 + Bx + C) = x^2, which gives 4Ax2+4Bx+(2A+4C)=x24Ax^2 + 4Bx + (2A + 4C) = x^2.
  5. Equate coefficients: 4A=14A = 1, 4B=04B = 0, 2A+4C=02A + 4C = 0.
  6. Solve: A=14A = \frac{1}{4}, B=0B = 0, C=18C = -\frac{1}{8}.

Particular solution: yp=14x218y_p = \frac{1}{4}x^2 - \frac{1}{8}.

Polynomial and Exponential Forms, Dirac delta function - Knowino

Verification and Special Considerations

Always verify by plugging ypy_p back into the original equation. For the example above: yp+4yp=2(14)+4(14x218)=12+x212=x2y_p'' + 4y_p = 2(\frac{1}{4}) + 4(\frac{1}{4}x^2 - \frac{1}{8}) = \frac{1}{2} + x^2 - \frac{1}{2} = x^2. It checks out.

The overlap rule is the most common source of errors. Consider yy=exy'' - y = e^x. The characteristic equation r21=0r^2 - 1 = 0 gives r=±1r = \pm 1, so exe^x is already part of ycy_c. Guessing yp=Aexy_p = Ae^x would just give zero on the left side. Instead, multiply by xx: try yp=Axexy_p = Axe^x, then solve for AA.

Limitations: This method does not work when:

  • The equation has variable coefficients (e.g., y+xy=ln(x)y'' + xy = \ln(x))
  • The right-hand side involves functions like tan(x)\tan(x), sec(x)\sec(x), ln(x)\ln(x), or 1x\frac{1}{x}

For those cases, you need Variation of Parameters.

General Solution of Nonhomogeneous Equations

Combining Solutions

The general solution to a nonhomogeneous equation has two parts:

y=yc+ypy = y_c + y_p

where ycy_c is the complementary solution (general solution of the associated homogeneous equation) and ypy_p is any particular solution of the nonhomogeneous equation.

The complementary solution carries all the arbitrary constants. For a second-order equation, that's two constants (c1c_1 and c2c_2); for an nnth-order equation, it's nn constants.

Continuing the earlier example: y=c1cos(2x)+c2sin(2x)+14x218y = c_1\cos(2x) + c_2\sin(2x) + \frac{1}{4}x^2 - \frac{1}{8}.

Verification and Applications

  • Superposition for multiple terms: If the right-hand side has several pieces, like y+y=sin(x)+exy'' + y = \sin(x) + e^x, you can find a particular solution for each piece separately, then add them. This often simplifies the algebra.
  • Initial/boundary conditions: Apply these to the general solution (not just ycy_c). Plug in the conditions to determine c1c_1 and c2c_2.
    • For example, given y(0)=1y(0) = 1 and y(0)=0y'(0) = 0, substitute x=0x = 0 into yy and yy', then solve the resulting system for c1c_1 and c2c_2.
Polynomial and Exponential Forms, Use the degree and leading coefficient to describe end behavior of polynomial functions ...

Variation of Parameters Method

Method Overview and Setup

Variation of Parameters is a more general technique that works for any nonhomogeneous term, not just polynomials, exponentials, and trig functions. The tradeoff is that the integrals can get messy.

The idea: take the complementary solution yc=c1y1+c2y2y_c = c_1 y_1 + c_2 y_2 and replace the constants with unknown functions:

yp=u1(x)y1(x)+u2(x)y2(x)y_p = u_1(x)\, y_1(x) + u_2(x)\, y_2(x)

where y1y_1 and y2y_2 are linearly independent solutions of the homogeneous equation.

For example, to solve y+y=sec(x)y'' + y = \sec(x): the homogeneous solutions are y1=cos(x)y_1 = \cos(x) and y2=sin(x)y_2 = \sin(x).

Implementation and Calculations

For a second-order equation written in standard form y+p(x)y+q(x)y=g(x)y'' + p(x)y' + q(x)y = g(x) (note: the coefficient of yy'' must be 1), follow these steps:

  1. Find y1y_1 and y2y_2 from the homogeneous equation.

  2. Compute the Wronskian: W=y1y2y2y1W = y_1 y_2' - y_2 y_1'

  3. Find u1u_1' and u2u_2' using the formulas: u1=y2g(x)W,u2=y1g(x)Wu_1' = \frac{-y_2\, g(x)}{W}, \qquad u_2' = \frac{y_1\, g(x)}{W}

  4. Integrate to get u1u_1 and u2u_2. (No constants of integration needed here; those are absorbed into ycy_c.)

  5. Write the particular solution: yp=u1y1+u2y2y_p = u_1 y_1 + u_2 y_2.

For higher-order equations, the pattern extends. A third-order equation uses yp=u1y1+u2y2+u3y3y_p = u_1 y_1 + u_2 y_2 + u_3 y_3, and you solve a 3×33 \times 3 system involving the Wronskian determinant.

Advantages and Limitations

Variation of Parameters handles right-hand sides that Undetermined Coefficients cannot touch:

  • y+y=tan(x)y'' + y = \tan(x)
  • y+y=sec(x)y'' + y = \sec(x)
  • Equations with variable coefficients (as long as you can find the homogeneous solutions)

The main difficulty is that the integrals in step 4 can be hard or impossible to evaluate in closed form. For instance, y+y=ex2y'' + y = e^{x^2} leads to integrals with no elementary antiderivative.

When to use which method:

  • If the equation has constant coefficients and the right-hand side is built from polynomials, exponentials, sines, and cosines, use Undetermined Coefficients. It's faster and cleaner.
  • For anything else, use Variation of Parameters.