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:

  1. (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 ().
  2. (A Particular Solution): Is any single solution that solves the full, original equation. It represents a specific response to the external forcing term.
  3. 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:

  1. Standard Form: Ensure the equation is in the form . Identify and .
  2. Calculate Integrating Factor (): Tip: You can ignore the constant of integration here, as it will cancel out.
  3. Multiply and Collapse: Multiply the entire standard-form equation by . The left side will magically collapse into the derivative of a product:
  4. Integrate Both Sides:
  5. Solve for y: This final expression contains both the particular and homogeneous parts.

Example: Solve

  1. Standard Form: Already done. , .
  2. Integrating Factor: .
  3. Multiply: .
  4. Integrate: .
  5. 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:

  1. Write the Characteristic Polynomial: Replace the -th derivative with . The ODE becomes the polynomial .
  2. Find the Roots of the Polynomial: Solve for all roots .
  3. Build the Solution from the Roots: For each root, add a term to according to the following cases.

Root-to-Solution Cheatsheet

CaseIf a Root is…The Corresponding Term(s) in are…
1. Distinct RealA simple real root
2. Repeated RealA real root with multiplicity
3. Complex ConjugateA pair of complex roots

Example: Solve

  1. Characteristic Poly: .
  2. Roots: This is . So we have one root, , with multiplicity 3.
  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:

  1. Identify the Form of : Look at the right-hand side of the ODE.
  2. Make an Initial Guess (Ansatz): Choose a guess for from the table below. Your guess must include all possible terms of that form.
  3. 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

  4. 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 aboveThe 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: