Second-Order ODE Solver Notes

Published on: September 29, 2026

These Second-Order ODE Solver Notes explain how to solve a linear equation with constant coefficients that involves the second derivative, with the working shown line by line. Trying a solution of exponential shape turns the equation into an ordinary quadratic, called the characteristic equation. The kind of roots that quadratic has decides the shape of the answer, whether exponential, repeated or oscillating. When the right side is not zero, a particular solution is added, found by guessing its shape and matching coefficients. Following the same pattern every time keeps the three cases apart.

Step-by-step method

  1. Set up the problem.
  2. Write the method.
  3. Write the characteristic equation.
  4. Solve the characteristic equation.
  5. Write the homogeneous solution.
  6. Choose the form of the particular solution.
  7. Differentiate the guess.
  8. Substitute and compare coefficients.
  9. Find the unknown numbers.
  10. Write the general solution.

Formula: Characteristic Equation

Trying y = e^(rx) turns the equation into a quadratic in r. Its roots decide the form of the homogeneous solution.

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Useful Tips to Remember

Replace \(y''\) with \(r^{2}\), \(y'\) with \(r\) and \(y\) with 1 to write the characteristic equation straight away. Two different real roots give two exponentials, a repeated root needs an extra factor of x, and complex roots \(\alpha \pm \beta i\) give \(e^{\alpha x}\) times cosine and sine. For a right side that is not 0, guess a particular solution with the same shape, and multiply the guess by x if part of it already solves the homogeneous equation. The general solution always has two constants.

Required knowledge

Where Are Second Order Differential Equations Used?

Second-order equations come from Newton's second law, because acceleration is the second derivative of position. A mass on a spring, a swinging pendulum and a car's suspension are all modelled this way, and the roots of the characteristic equation decide whether they oscillate or settle. RLC circuits follow the same equation, and engineers use the forcing term to study resonance in bridges and buildings.

  • Springs and vibrating systems
  • Pendulums for small swings
  • RLC electrical circuits
  • Car suspension and damping
  • Resonance in bridges and buildings

Second Order ODE Practice Problems

Example 1 solves \(y'' - y = 0\), whose characteristic roots are real and different, and Example 2 solves \(y'' + 2y' + 5y = 0\), whose roots are complex. Examples 3 and 4 give you two more of the same kind to try, \(y'' - 5 y' + 6 y = 0\) and \(y'' + y = x^{2}\). Write the characteristic equation, solve it and pick the matching form.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(y'' - y = 0\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the method.
  3. Write the characteristic equation.
  4. Solve the characteristic equation.
  5. Write the homogeneous solution.
  6. Choose the form of the particular solution.
  7. Differentiate the guess.
  8. Substitute and compare coefficients.
  9. Find the unknown numbers.
  10. Write the general solution.

Formula

Formula: Characteristic Equation

Trying y = e^(rx) turns the equation into a quadratic in r. Its roots decide the form of the homogeneous solution.

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 1

Step 1 - Set up the problem.

In this problem: We are solving \(y'' - y = 0\). It is a second-order linear equation with constant coefficients, and the right side is 0, so it is homogeneous.

\(y'' - y = 0\)

Step 2

Step 2 - Write the method.

In this problem: Trying \(y = e^{rx}\) turns every derivative into a power of \(r\), which gives the characteristic equation. Its roots give the homogeneous solution \(y_{h}\).

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 3

Step 3 - Write the characteristic equation.

In this problem: Putting \(y = e^{rx}\), \(y' = re^{rx}\) and \(y'' = r^{2}e^{rx}\) into \(y'' - y = 0\) and dividing by \(e^{rx}\), which is never 0, gives \(r^{2} - 1 = 0\).

\(r^{2} - 1 = 0\)

Step 4

Step 4 - Solve the characteristic equation.

In this problem: Solving \(r^{2} - 1 = 0\), covered in the Quadratic Equation Calculator, gives \(r = -1\) and \(r = 1\).

\(r^{2} - 1 = 0 \;\Rightarrow\; r_{1} = -1,\; r_{2} = 1\)

Step 5

Step 5 - Write the general solution.

In this problem: The roots are real and different, so each one gives its own exponential, which gives the general solution \(y = C_{1} e^{- x} + C_{2} e^{x}\).

\(y = C_{1} e^{- x} + C_{2} e^{x}\)

Final Answer

\(y = C_{1} e^{- x} + C_{2} e^{x}\)
See Example 2 Hide Example 2

Problem

\(y'' + 2 y' + 5 y = 0\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the method.
  3. Write the characteristic equation.
  4. Solve the characteristic equation.
  5. Write the homogeneous solution.
  6. Choose the form of the particular solution.
  7. Differentiate the guess.
  8. Substitute and compare coefficients.
  9. Find the unknown numbers.
  10. Write the general solution.

Formula

Formula: Characteristic Equation

Trying y = e^(rx) turns the equation into a quadratic in r. Its roots decide the form of the homogeneous solution.

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 1

Step 1 - Set up the problem.

In this problem: We are solving \(y'' + 2 y' + 5 y = 0\). It is a second-order linear equation with constant coefficients, and the right side is 0, so it is homogeneous.

\(y'' + 2 y' + 5 y = 0\)

Step 2

Step 2 - Write the method.

In this problem: Trying \(y = e^{rx}\) turns every derivative into a power of \(r\), which gives the characteristic equation. Its roots give the homogeneous solution \(y_{h}\).

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 3

Step 3 - Write the characteristic equation.

In this problem: Putting \(y = e^{rx}\), \(y' = re^{rx}\) and \(y'' = r^{2}e^{rx}\) into \(y'' + 2 y' + 5 y = 0\) and dividing by \(e^{rx}\), which is never 0, gives \(r^{2} + 2 r + 5 = 0\).

\(r^{2} + 2 r + 5 = 0\)

Step 4

Step 4 - Solve the characteristic equation.

In this problem: Solving \(r^{2} + 2 r + 5 = 0\), covered in the Quadratic Equation Calculator, gives \(r = -1 - 2 i\) and \(r = -1 + 2 i\).

\(r^{2} + 2 r + 5 = 0 \;\Rightarrow\; r_{1} = -1 - 2 i,\; r_{2} = -1 + 2 i\)

Step 5

Step 5 - Write the general solution.

In this problem: The roots are complex, \(\alpha \pm \beta i\) with \(\alpha = -1\) and \(\beta = 2\), so the solution uses \(e^{\alpha x}\) with cosine and sine of \(\beta x\), which gives the general solution \(y = \left(C_{1} \cos {2 x} + C_{2} \sin {2 x}\right) e^{- x}\).

\(y = \left(C_{1} \cos {2 x} + C_{2} \sin {2 x}\right) e^{- x}\)

Final Answer

\(y = \left(C_{1} \cos {2 x} + C_{2} \sin {2 x}\right) e^{- x}\)
See Example 3 Hide Example 3

Problem

\(y'' - 5 y' + 6 y = 0\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the method.
  3. Write the characteristic equation.
  4. Solve the characteristic equation.
  5. Write the homogeneous solution.
  6. Choose the form of the particular solution.
  7. Differentiate the guess.
  8. Substitute and compare coefficients.
  9. Find the unknown numbers.
  10. Write the general solution.

Formula

Formula: Characteristic Equation

Trying y = e^(rx) turns the equation into a quadratic in r. Its roots decide the form of the homogeneous solution.

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 1

Step 1 - Set up the problem.

In this problem: We are solving \(y'' - 5 y' + 6 y = 0\). It is a second-order linear equation with constant coefficients, and the right side is 0, so it is homogeneous.

\(y'' - 5 y' + 6 y = 0\)

Step 2

Step 2 - Write the method.

In this problem: Trying \(y = e^{rx}\) turns every derivative into a power of \(r\), which gives the characteristic equation. Its roots give the homogeneous solution \(y_{h}\).

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 3

Step 3 - Write the characteristic equation.

In this problem: Putting \(y = e^{rx}\), \(y' = re^{rx}\) and \(y'' = r^{2}e^{rx}\) into \(y'' - 5 y' + 6 y = 0\) and dividing by \(e^{rx}\), which is never 0, gives \(r^{2} - 5 r + 6 = 0\).

\(r^{2} - 5 r + 6 = 0\)

Step 4

Step 4 - Solve the characteristic equation.

In this problem: Solving \(r^{2} - 5 r + 6 = 0\), covered in the Quadratic Equation Calculator, gives \(r = 2\) and \(r = 3\).

\(r^{2} - 5 r + 6 = 0 \;\Rightarrow\; r_{1} = 2,\; r_{2} = 3\)

Step 5

Step 5 - Write the general solution.

In this problem: The roots are real and different, so each one gives its own exponential, which gives the general solution \(y = C_{1} e^{2 x} + C_{2} e^{3 x}\).

\(y = C_{1} e^{2 x} + C_{2} e^{3 x}\)

Final Answer

\(y = C_{1} e^{2 x} + C_{2} e^{3 x}\)
See Example 4 Hide Example 4

Problem

\(y'' + y = x^{2}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the method.
  3. Write the characteristic equation.
  4. Solve the characteristic equation.
  5. Write the homogeneous solution.
  6. Choose the form of the particular solution.
  7. Differentiate the guess.
  8. Substitute and compare coefficients.
  9. Find the unknown numbers.
  10. Write the general solution.

Formula

Formula: Characteristic Equation

Trying y = e^(rx) turns the equation into a quadratic in r. Its roots decide the form of the homogeneous solution.

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0\)

Step 1

Step 1 - Set up the problem.

In this problem: We are solving \(y'' + y = x^{2}\). It is a second-order linear equation with constant coefficients.

\(y'' + y = x^{2}\)

Step 2

Step 2 - Write the method.

In this problem: Trying \(y = e^{rx}\) turns every derivative into a power of \(r\), which gives the characteristic equation. Its roots give the homogeneous solution \(y_{h}\). When the right side is not 0, a particular solution \(y_{p}\) is added, found by guessing its form and matching coefficients.

\(ay'' + by' + cy = 0 \;\Rightarrow\; ar^{2} + br + c = 0,\qquad y = y_{h} + y_{p}\)

Step 3

Step 3 - Write the characteristic equation.

In this problem: Putting \(y = e^{rx}\), \(y' = re^{rx}\) and \(y'' = r^{2}e^{rx}\) into \(y'' + y = 0\) and dividing by \(e^{rx}\), which is never 0, gives \(r^{2} + 1 = 0\).

\(r^{2} + 1 = 0\)

Step 4

Step 4 - Solve the characteristic equation.

In this problem: Solving \(r^{2} + 1 = 0\), covered in the Quadratic Equation Calculator, gives \(r = - i\) and \(r = i\).

\(r^{2} + 1 = 0 \;\Rightarrow\; r_{1} = - i,\; r_{2} = i\)

Step 5

Step 5 - Write the homogeneous solution.

In this problem: The roots are complex, \(\alpha \pm \beta i\) with \(\alpha = 0\) and \(\beta = 1\), so the solution uses \(e^{\alpha x}\) with cosine and sine of \(\beta x\), which gives \(y_{h} = C_{1} \cos {x} + C_{2} \sin {x}\).

\(y_{h} = C_{1} \cos {x} + C_{2} \sin {x}\)

Step 6

Step 6 - Choose the form of the particular solution.

In this problem: The guess copies the shape of the right side \(x^{2}\) with unknown numbers in place of the coefficients, and no part of it already solves the homogeneous equation. This gives \(y_{p} = A x^{2} + B x + C\).

\(y_{p} = A x^{2} + B x + C\)

Step 7

Step 7 - Differentiate the guess.

In this problem: The unknown numbers are constants, so each part of the guess is differentiated on its own, covered in the Derivative Calculator. Doing this twice gives \(y_{p}'\) and \(y_{p}''\).

\(\begin{gathered} y_{p}' = 2 A x + B \\ y_{p}'' = 2 A \end{gathered}\)

Step 8

Step 8 - Substitute and compare coefficients.

In this problem: Putting \(y_{p}\), \(y_{p}'\) and \(y_{p}''\) into the left side and collecting terms gives \(A x^{2} + 2 A + B x + C\). This must equal \(x^{2}\), so the coefficients of matching terms must be equal.

\(\begin{gathered} x^{2}:\; A = 1 \\ x:\; B = 0 \\ \text{constant}:\; 2 A + C = 0 \end{gathered}\)

Step 9

Step 9 - Find the unknown numbers.

In this problem: The equations are solved one unknown at a time, which gives \(A = 1,\; B = 0,\; C = -2\).

\(A = 1,\; B = 0,\; C = -2\)

Step 9a

Step 9a - Find A.

In this problem: The equation \(A = 1\) has only \(A\) left in it, so \(A = 1\).

\(A = 1\)

Step 9b

Step 9b - Find B.

In this problem: The equation \(B = 0\) has only \(B\) left in it, so \(B = 0\).

\(B = 0\)

Step 9c

Step 9c - Find C.

In this problem: The equation \(C + 2 = 0\) has only \(C\) left in it, and solving it, covered in the Linear Equation Calculator, gives \(C = -2\).

\(C = -2\)

Step 10

Step 10 - Write the general solution.

In this problem: Putting the numbers into the guess gives \(y_{p} = x^{2} - 2\), and adding it to \(y_{h}\) gives the general solution \(y = C_{1} \cos {x} + C_{2} \sin {x} + x^{2} - 2\).

\(y = C_{1} \cos {x} + C_{2} \sin {x} + x^{2} - 2\)

Final Answer

\(y = C_{1} \cos {x} + C_{2} \sin {x} + x^{2} - 2\)

Calculator and Practice Mode