Recipe
Find a particular solution with undetermined coefficients
Use when: you have a nonhomogeneous linear ODE ay''+by'+cy=g(x) where g(x) is a polynomial, exponential, sine/cosine, or a sum/product of these
Goal: a particular solution y_p to add to the homogeneous solution y_h
Taught in The method of undetermined coefficients · a later section extends this recipe with more cases
Quick recipe
-
1
Write y_p with the same kind of terms as g(x): a polynomial for a polynomial, an exponential for an exponential, a sine-and-cosine pair for a sine or cosine forcing, each carrying an unknown coefficient.
Example
For y''-y=2x^2+3, the forcing g(x)=2x^2+3 is a degree-2 polynomial, so guess a full degree-2 polynomial back: every degree up through 2, plus the constant term: y_p=Ax^2+Bx+C
- Not yet: the natural guess duplicates a term already in y_h — covered in The resonance modification rule
Why: differentiating a polynomial, exponential, or sine/cosine stays inside that same family of functions, and that closure is exactly what makes the coefficients solvable by matching, rather than needing a whole new method.
-
2
Compute y_p' and y_p'', then substitute all three into ay''+by'+cy=g(x).
Example
Continuing with y_p=Ax^2+Bx+C: y_p'=2Ax+B and y_p''=2A. Substituting into y''-y=2x^2+3: 2A-(Ax^2+Bx+C)=2x^2+3 which rearranges to -Ax^2-Bx+(2A-C)=2x^2+0x+3.
Why: this is the step that turns an unknown function into a system of unknown numbers.
-
3
Group the substituted equation by term type (the x^2 terms, the x terms, the constant terms, and so on) and set each side's coefficients equal.
Example
From -Ax^2-Bx+(2A-C)=2x^2+0x+3, matching term by term: x^2:\ -A=2 \qquad x:\ -B=0 \qquad \text{constant:}\ 2A-C=3
Why: two polynomials (or two exponential/trig combinations) are equal only if they agree term by term, which is what turns the guess into a solvable linear system for the unknown coefficients.
-
4
Solve the resulting system for A, B, and any other unknowns in the guess.
Example
From -A=2: A=-2. From -B=0: B=0. Substituting A=-2 into 2A-C=3: -4-C=3, so C=-7. That gives y_p=-2x^2-7
Why: this pins down the specific numbers that make the guessed form actually satisfy the equation.
-
5
Write the full general solution as y=y_h+y_p.
Example
The homogeneous equation y''-y=0 has characteristic roots r=\pm1 (Chapter 7's recipe), so y_h=C_1e^x+C_2e^{-x}. Adding the particular solution from Step 4: y=C_1e^x+C_2e^{-x}-2x^2-7
Why: a nonhomogeneous equation's general solution is always the homogeneous solution plus any one particular solution, a consequence of superposition, not a coincidence specific to this method.
Common mistakes
- Guessing a trial form one degree too low, such as y_p=A for a linear forcing g(x)=3x, instead of matching every degree present.
- Substituting y_p into the equation but forgetting to also substitute y_p' and y_p'' everywhere they appear.
- Matching coefficients by eye instead of grouping systematically by term type, and missing one.
- Reporting y_p alone as "the solution" instead of adding it to y_h.