Second-Order Linear: Nonhomogeneous

the method of undetermined coefficients

Imagine you are asked, 'What kind of input gives what kind of output?' For a few well-behaved forcings, the answer is delightfully predictable: push a constant-coefficient system with a polynomial and the response is a polynomial; push it with e^(kx) and the response is a multiple of e^(kx); push it with a sine and the response is a sine-and-cosine combination. The method of undetermined coefficients exploits exactly this predictability — you guess a solution of the same shape as the forcing, with the coefficients left as unknowns, and let the equation tell you those coefficients.

It works in plain steps. First, look at g(x) and write down a trial solution y_p with the matching shape but undetermined constants: for g = 5e^(2x) try y_p = A e^(2x); for g = x^2 try y_p = A x^2 + B x + C; for g = sin(3x) try y_p = A cos(3x) + B sin(3x). Then substitute y_p, y_p', y_p'' into the left side, collect like terms, and match the result to g(x). This gives simple linear equations for the unknown constants, which you solve. Plug the constants back and you have one particular solution.

Two limits keep you honest. First, the method is for CONSTANT-coefficient equations and only for forcings built from polynomials, exponentials, sines, cosines, and their products and sums — for anything else (like g = tan x or 1/x) you must use variation of parameters instead. Second, if your guess happens to already solve the homogeneous equation, the substitution collapses to zero and the method seems to fail; that is the cue to apply the modification (multiply-by-x) rule. Within its range, though, it is the fastest hand method there is.

Solve y'' + y' - 2y = 4x. Guess y_p = Ax + B. Then y_p' = A, y_p'' = 0, and the left side becomes A - 2(Ax + B) = -2A x + (A - 2B). Matching to 4x + 0 gives -2A = 4 (so A = -2) and A - 2B = 0 (so B = -1). Thus y_p = -2x - 1.

Guess the shape, substitute, and match coefficients to pin down the unknowns.

Even a single x in the forcing forces a full polynomial guess (A x + B, not just A x): the lower-degree terms are needed because differentiation mixes degrees. Dropping them is the most common error.

Also called
undetermined coefficientsjudicious guessing待定係數judicious-guessing method