An Algorithmic Cheatsheet for Solving Linear ODEs
This guide provides a step-by-step, procedural approach to solving the most common types of linear ODEs encountered in science and engineering.
The Master Algorithm
Almost every linear ODE problem is solved with the same three-step master plan.
The Grand Unifying Equation
The general solution to any linear ODE is the sum of two parts:
- (The Homogeneous Solution): Solves the equation when the right-hand side is set to zero. This solution describes the system’s natural, unforced behavior and will contain all the free constants ().
- (A Particular Solution): Is any single solution that solves the full, original equation. It represents a specific response to the external forcing term.
- The General Solution: The sum of the two. An Initial Value Problem (IVP) simply uses the initial conditions to solve for the constants in .
Part 1: First-Order Linear ODEs
Canonical Form:
This is the most fundamental type. The most robust and algorithmic solution is the Integrating Factor Method.
Algorithm:
- Standard Form: Ensure the equation is in the form . Identify and .
- Calculate Integrating Factor (): Tip: You can ignore the constant of integration here, as it will cancel out.
- Multiply and Collapse: Multiply the entire standard-form equation by . The left side will magically collapse into the derivative of a product:
- Integrate Both Sides:
- Solve for y: This final expression contains both the particular and homogeneous parts.
Example: Solve
- Standard Form: Already done. , .
- Integrating Factor: .
- Multiply: .
- Integrate: .
- Solve: .
Part 2: Higher-Order Linear ODEs with Constant Coefficients
Canonical Form:
We follow the Master Algorithm: find , then find .
Step A: Finding the Homogeneous Solution ()
This is a purely algebraic process.
Algorithm:
- Write the Characteristic Polynomial: Replace the -th derivative with . The ODE becomes the polynomial .
- Find the Roots of the Polynomial: Solve for all roots .
- Build the Solution from the Roots: For each root, add a term to according to the following cases.
Root-to-Solution Cheatsheet
| Case | If a Root is… | The Corresponding Term(s) in are… |
|---|---|---|
| 1. Distinct Real | A simple real root | |
| 2. Repeated Real | A real root with multiplicity | |
| 3. Complex Conjugate | A pair of complex roots |
Example: Solve
- Characteristic Poly: .
- Roots: This is . So we have one root, , with multiplicity 3.
- Build Solution: This is Case 2 with and .
Step B: Finding the Particular Solution ()
We use the Method of Undetermined Coefficients (The Educated Guess / Ansatz). This works when is a polynomial, exponential, sine/cosine, or a product of these.
Algorithm:
- Identify the Form of : Look at the right-hand side of the ODE.
- Make an Initial Guess (Ansatz): Choose a guess for from the table below. Your guess must include all possible terms of that form.
- Check for Duplication: Compare your guess for with the terms in your homogeneous solution .
The Golden Rule of the Ansatz is already part of , you must multiply your entire guess by . Repeat this until no term in the guess is a solution to the homogeneous equation.
If any term in your guess for
- Solve for Coefficients: Substitute your (possibly modified) guess into the full original ODE. Group terms by form (e.g., powers of , , etc.) and equate coefficients on both sides of the equation to solve for the unknown constants in your guess.
Ansatz Cheatsheet
| If is… | Your Initial Guess for is… |
|---|---|
| A polynomial of degree : | |
| An exponential: | |
| A sine or cosine: or | (You need both!) |
| Products of the above | The product of the corresponding guesses |
| Example: | |
| Example: |
Full Walkthrough Example
Solve the IVP: , with .
Step 1: Find the Homogeneous Solution ()
- Equation:
- Characteristic Poly:
- Roots: . This is the complex case with .
- Homogeneous Solution: .
Step 2: Find a Particular Solution ()
- Identify : .
- Initial Guess: From the table, for , our guess is .
- Check for Duplication: Warning! Both and are already in . Our guess will fail.
- Modify Guess: Apply the Golden Rule. Multiply the entire guess by . Our new guess is .
- Solve for Coefficients: We need and .
- Substitute into ODE: The terms with cancel out perfectly (this is the magic of the method).
- Equate Coefficients:
- :
- :
- Our Particular Solution: .
Step 3: Combine for General Solution
Step 4: Apply Initial Conditions (IVP)
- We have : .
- We need : .
- We have : .
Final Unique Solution
With and , the unique solution is: