← Back to Differential Equations

Nonhomogeneous equations

When an outside force drives the system, the solution is the natural response plus a particular response to the forcing.

Structure of solutions

For \(ay'' + by' + cy = g(x)\), the general solution is \(y = y_h + y_p\): the homogeneous solution \(y_h\) (with two constants) plus any one particular solution \(y_p\). The homogeneous part describes the system's natural behaviour; the particular part is its response to the forcing \(g\).

y = y_h + y_p

Undetermined coefficients

When \(g\) is a polynomial, exponential, sine, cosine, or a product of these, guess a \(y_p\) of the same form with unknown coefficients. For \(y'' - 3y' + 2y = 4x\), guess \(y_p = Ax + B\): substituting gives \(-3A + 2Ax + 2B = 4x\), so \(A = 2\), \(B = 3\), and \(y_p = 2x + 3\).

Guesses for common forcing terms

For \(e^{kx}\), guess \(Ae^{kx}\). For \(\sin kx\) or \(\cos kx\), guess \(A\cos kx + B\sin kx\), always including both. For a polynomial of degree \(n\), guess a general polynomial of degree \(n\). Products combine the guesses.

The modification rule

If the guess already solves the homogeneous equation, multiply it by \(x\) (or \(x^2\) if needed). For \(y'' - y = e^x\), \(e^x\) is a homogeneous solution, so guess \(y_p = Axe^x\). Substituting gives \(2Ae^x = e^x\), so \(A = \frac{1}{2}\). Forgetting this rule produces equations with no solution for \(A\).

Variation of parameters

For forcing terms where guessing fails, such as \(\tan x\) or \(\frac{1}{x}\), variation of parameters builds \(y_p = u_1y_1 + u_2y_2\) with \(u_1' = -\frac{y_2 g}{aW}\) and \(u_2' = \frac{y_1 g}{aW}\). It always works in principle, though the integrals may be difficult.

u_1' = -\frac{y_2 g}{aW},\quad u_2' = \frac{y_1 g}{aW}

Worked example

Solve \(y'' + y = 3\cos 2x\). Homogeneous: \(y_h = c_1\cos x + c_2\sin x\). Guess \(y_p = A\cos 2x + B\sin 2x\): \(-4A\cos 2x - 4B\sin 2x + A\cos 2x + B\sin 2x = 3\cos 2x\), so \(-3A = 3\), \(A = -1\), \(B = 0\). General solution: \(y = c_1\cos x + c_2\sin x - \cos 2x\).

Superposition of forcing

If \(g = g_1 + g_2\), find particular solutions for each piece and add them. This lets you handle forcing like \(e^x + \sin x\) one term at a time.

Common mistakes

Including only \(\cos\) in a guess when the forcing is \(\cos\). Forgetting the modification rule. Applying initial conditions to \(y_h\) alone instead of the full solution \(y_h + y_p\).

Key takeaways

The general solution is homogeneous plus particular. Undetermined coefficients guesses \(y_p\) of the forcing's form, multiplying by \(x\) when the guess duplicates a homogeneous solution. Variation of parameters handles any forcing. Apply initial conditions to the complete solution.

Flashcard

y = y_h + y_p

General solution of a nonhomogeneous equation

Natural response plus forced response.

Check your understanding

For y'' + 4y = e^x, the best guess for a particular solution is:

← Previous lesson Next lesson →