For a nonhomogeneous linear ODE , the general solution decomposes as

where:

  • is the complementary solution — the general solution of the corresponding homogeneous equation .
  • is a particular solution — any specific function that satisfies .

Why this works

Linearity. If satisfies and satisfies , then by linearity:

So is a solution of the nonhomogeneous equation.

Conversely, if are both solutions of , then their difference satisfies — so the difference is a homogeneous solution. Therefore for some homogeneous .

This means: every nonhomogeneous solution differs from any specific particular solution by some homogeneous solution. Add the general homogeneous solution to one particular solution and you get the general nonhomogeneous solution.

Why we need both pieces

The complementary solution contains all the arbitrary constants needed to satisfy initial conditions. The particular solution has no free parameters — it’s a single specific function that handles the forcing term .

For a second-order ODE, has two arbitrary constants (). The full also has two arbitrary constants — perfect for fitting two initial conditions.

If you tried to satisfy initial conditions with just , you couldn’t — has no free parameters. You need the homogeneous freedom from .

Methodology

To solve a nonhomogeneous linear ODE:

  1. Find : solve the homogeneous version. Use Characteristic equation for constant coefficients, or other methods for variable coefficients.
  2. Find : choose a method based on :
  3. Combine: .
  4. Apply initial conditions to determine the constants in .

Worked example

.

Step 1: complementary solution. Characteristic equation: , roots . So .

Step 2: particular solution. Forcing is . Guess . Then , . Plug in:

So . Hence .

Step 3: combine.

Step 4: apply initial conditions to find if given.

Particular solution is any particular solution

A common confusion: which particular solution? Doesn’t matter — any one works. Different methods can give different particular solutions, all of which differ from each other by a homogeneous solution. When you add the general , the difference washes out into the arbitrary constants. The final general solution is the same regardless of which you started from.

For the systematic guess-and-solve method on common forcing terms, see Method of undetermined coefficients. For the universal but more involved method, see Method of variation of parameters.