The equation and the structure of its solution
- y″ + ay′ + by = f(x)
Holds when a and b are constants and f is continuous on an interval.
The equation is non-homogeneous because the right side is not 0. The general solution above has two parts:
- yₕ, the general solution of the homogeneous equation y″ + ay′ + by = 0. It comes from the characteristic equation r² + ar + b = 0, exactly as on the page about the homogeneous equation, and holds the constants C₁ and C₂.
- yₚ, a particular solution: any one solution of the full equation.
Why that is enough: if y and yₚ both solve the equation, their difference y − yₚ solves the homogeneous equation, because the left side is linear. So y − yₚ is one of the functions in yₕ.
Finding yₚ: the guess
The particular solution is guessed in the same form as the right side, with unknown coefficients found by substituting.
| f(x) | Guess for yₚ |
|---|---|
| a polynomial of degree n | a polynomial of degree n |
| e^(kx) | A·e^(kx) |
| sin kx or cos kx | A cos kx + B sin kx |
If the guess already solves the homogeneous equation, substituting gives 0 = f(x), and the guess is multiplied by x (by x² if k is a double root of the characteristic equation). The same goes for a polynomial when b = 0.
Examples
y″ + 2y′ + 5y = 5x.
- Homogeneous part: r² + 2r + 5 = 0 gives r = −1 ± 2i, so yₕ = e^(−x)(C₁ cos 2x + C₂ sin 2x).
- Guess yₚ = Ax + B: yₚ′ = A and yₚ″ = 0, so 2A + 5(Ax + B) = 5x. That gives A = 1 and B = −2/5.
- y = e^(−x)(C₁ cos 2x + C₂ sin 2x) + x − 2/5.
y″ − y′ − 6y = 4eˣ.
- Homogeneous part: r² − r − 6 = 0 gives r = 3 and r = −2, so yₕ = C₁e^(3x) + C₂e^(−2x).
- Guess yₚ = Aeˣ: A − A − 6A = 4 gives A = −2/3.
- y = C₁e^(3x) + C₂e^(−2x) − (2/3)eˣ.
Where next
- The same structure at first order: the first-order linear differential equation.
Common mistakes
- Applying the initial conditions to yₕ. C₁ and C₂ come from the whole y = yₕ + yₚ, after yₚ is found.
- Forgetting yₕ. yₚ on its own is one solution, not the general one.
- A guess that already solves the homogeneous equation. Substituting then gives 0 on the left; multiply the guess by x.
Common questions
Does it matter which particular solution I find?
No. Two particular solutions differ by a solution of the homogeneous equation, and that difference is
taken up by C₁ and C₂. The general solution is the same set of functions.