Second-Order ODE Solver Notes
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
- Set up the problem.
- Write the method.
- Write the characteristic equation.
- Solve the characteristic equation.
- Write the homogeneous solution.
- Choose the form of the particular solution.
- Differentiate the guess.
- Substitute and compare coefficients.
- Find the unknown numbers.
- 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.
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
- How to solve the characteristic equation, covered in the Quadratic Equation Calculator.
- How to differentiate the guess, covered in the Derivative Calculator.
- How to solve for the unknown numbers, covered in the Linear Equation Calculator.
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
Approach
Step-by-step method
- Set up the problem.
- Write the method.
- Write the characteristic equation.
- Solve the characteristic equation.
- Write the homogeneous solution.
- Choose the form of the particular solution.
- Differentiate the guess.
- Substitute and compare coefficients.
- Find the unknown numbers.
- 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.
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.
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}\).
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\).
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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Rewrite the equation in standard form, with every term on the left and 0 on the right.
- Identify the coefficients a, b and c.
- Write the quadratic formula.
- Substitute the coefficients into the formula.
- Work out the numbers in the formula.
- Split the \(\pm\) into the two solutions.
Depending on the equation, some of these steps are not needed, so they are skipped.
Formula
Formula: Quadratic Formula
This formula is used to solve any equation in the form ax² + bx + c = 0. Put in a, b and c, then work out the + and − versions to get the two solutions.
Step 1
Step 1 - Set up the problem.
In this problem: The equation to solve is \(r^{2} - 1 = 0\), and the unknown is \(r\).
Step 2
Step 2 - Identify the coefficients a, b and c.
In this problem: Matching \(r^{2} - 1 = 0\) with \(ax^{2} + bx + c = 0\) gives \(a = 1\), \(b = 0\) and \(c = -1\).
Step 3
Step 3 - Write the quadratic formula.
In this problem: The quadratic formula solves any equation in the form \(ax^{2} + bx + c = 0\).
Step 4
Step 4 - Substitute the coefficients into the formula.
In this problem: Putting \(a = 1\), \(b = 0\) and \(c = -1\) into the formula gives \(r = \frac{-0 \pm \sqrt{0^{2} - 4(1)(-1)}}{2(1)}\).
Step 5
Step 5 - Work out the numbers in the formula.
In this problem: Under the square root, \(0^{2} = 0\) and \(4(1)(-1) = -4\), so \(0 + 4 = 4\). Underneath, \(2(1) = 2\). Then \(\sqrt{4} = 2\).
Step 6
Step 6 - Split the \(\pm\) into the two solutions.
In this problem: The \(\pm\) means there are two solutions, one with \(+\) and one with \(-\).
Step 6a
Step 6a - Take the \(+\) sign.
In this problem: Using \(+\) gives \(r = \frac{0 + 2}{2} = \frac{2}{2} = 1\).
Step 6b
Step 6b - Take the \(-\) sign.
In this problem: Using \(-\) gives \(r = \frac{0 - 2}{2} = \frac{-2}{2} = -1\).
Final Answer
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}\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the method.
- Write the characteristic equation.
- Solve the characteristic equation.
- Write the homogeneous solution.
- Choose the form of the particular solution.
- Differentiate the guess.
- Substitute and compare coefficients.
- Find the unknown numbers.
- 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.
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.
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}\).
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\).
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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Rewrite the equation in standard form, with every term on the left and 0 on the right.
- Identify the coefficients a, b and c.
- Write the quadratic formula.
- Substitute the coefficients into the formula.
- Work out the numbers in the formula.
- Split the \(\pm\) into the two solutions.
Depending on the equation, some of these steps are not needed, so they are skipped.
Formula
Formula: Quadratic Formula
This formula is used to solve any equation in the form ax² + bx + c = 0. Put in a, b and c, then work out the + and − versions to get the two solutions.
Step 1
Step 1 - Set up the problem.
In this problem: The equation to solve is \(r^{2} + 2r + 5 = 0\), and the unknown is \(r\).
Step 2
Step 2 - Identify the coefficients a, b and c.
In this problem: Matching \(r^{2} + 2r + 5 = 0\) with \(ax^{2} + bx + c = 0\) gives \(a = 1\), \(b = 2\) and \(c = 5\).
Step 3
Step 3 - Write the quadratic formula.
In this problem: The quadratic formula solves any equation in the form \(ax^{2} + bx + c = 0\).
Step 4
Step 4 - Substitute the coefficients into the formula.
In this problem: Putting \(a = 1\), \(b = 2\) and \(c = 5\) into the formula gives \(r = \frac{-2 \pm \sqrt{2^{2} - 4(1)(5)}}{2(1)}\).
Step 5
Step 5 - Work out the numbers in the formula.
In this problem: Under the square root, \(2^{2} = 4\) and \(4(1)(5) = 20\), so \(4 - 20 = -16\). Underneath, \(2(1) = 2\). A negative number has no real square root, so the equation has no real solutions.
Final Answer
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}\).
Final Answer
See Example 3 Hide Example 3
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the method.
- Write the characteristic equation.
- Solve the characteristic equation.
- Write the homogeneous solution.
- Choose the form of the particular solution.
- Differentiate the guess.
- Substitute and compare coefficients.
- Find the unknown numbers.
- 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.
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.
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}\).
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\).
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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Rewrite the equation in standard form, with every term on the left and 0 on the right.
- Identify the coefficients a, b and c.
- Write the quadratic formula.
- Substitute the coefficients into the formula.
- Work out the numbers in the formula.
- Split the \(\pm\) into the two solutions.
Depending on the equation, some of these steps are not needed, so they are skipped.
Formula
Formula: Quadratic Formula
This formula is used to solve any equation in the form ax² + bx + c = 0. Put in a, b and c, then work out the + and − versions to get the two solutions.
Step 1
Step 1 - Set up the problem.
In this problem: The equation to solve is \(r^{2} - 5r + 6 = 0\), and the unknown is \(r\).
Step 2
Step 2 - Identify the coefficients a, b and c.
In this problem: Matching \(r^{2} - 5r + 6 = 0\) with \(ax^{2} + bx + c = 0\) gives \(a = 1\), \(b = -5\) and \(c = 6\).
Step 3
Step 3 - Write the quadratic formula.
In this problem: The quadratic formula solves any equation in the form \(ax^{2} + bx + c = 0\).
Step 4
Step 4 - Substitute the coefficients into the formula.
In this problem: Putting \(a = 1\), \(b = -5\) and \(c = 6\) into the formula gives \(r = \frac{-(-5) \pm \sqrt{(-5)^{2} - 4(1)(6)}}{2(1)}\).
Step 5
Step 5 - Work out the numbers in the formula.
In this problem: On top, \(-(-5) = 5\). Under the square root, \((-5)^{2} = 25\) and \(4(1)(6) = 24\), so \(25 - 24 = 1\). Underneath, \(2(1) = 2\). Then \(\sqrt{1} = 1\).
Step 6
Step 6 - Split the \(\pm\) into the two solutions.
In this problem: The \(\pm\) means there are two solutions, one with \(+\) and one with \(-\).
Step 6a
Step 6a - Take the \(+\) sign.
In this problem: Using \(+\) gives \(r = \frac{5 + 1}{2} = \frac{6}{2} = 3\).
Step 6b
Step 6b - Take the \(-\) sign.
In this problem: Using \(-\) gives \(r = \frac{5 - 1}{2} = \frac{4}{2} = 2\).
Final Answer
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}\).
Final Answer
See Example 4 Hide Example 4
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the method.
- Write the characteristic equation.
- Solve the characteristic equation.
- Write the homogeneous solution.
- Choose the form of the particular solution.
- Differentiate the guess.
- Substitute and compare coefficients.
- Find the unknown numbers.
- 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.
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.
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.
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\).
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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Rewrite the equation in standard form, with every term on the left and 0 on the right.
- Identify the coefficients a, b and c.
- Write the quadratic formula.
- Substitute the coefficients into the formula.
- Work out the numbers in the formula.
- Split the \(\pm\) into the two solutions.
Depending on the equation, some of these steps are not needed, so they are skipped.
Formula
Formula: Quadratic Formula
This formula is used to solve any equation in the form ax² + bx + c = 0. Put in a, b and c, then work out the + and − versions to get the two solutions.
Step 1
Step 1 - Set up the problem.
In this problem: The equation to solve is \(r^{2} + 1 = 0\), and the unknown is \(r\).
Step 2
Step 2 - Identify the coefficients a, b and c.
In this problem: Matching \(r^{2} + 1 = 0\) with \(ax^{2} + bx + c = 0\) gives \(a = 1\), \(b = 0\) and \(c = 1\).
Step 3
Step 3 - Write the quadratic formula.
In this problem: The quadratic formula solves any equation in the form \(ax^{2} + bx + c = 0\).
Step 4
Step 4 - Substitute the coefficients into the formula.
In this problem: Putting \(a = 1\), \(b = 0\) and \(c = 1\) into the formula gives \(r = \frac{-0 \pm \sqrt{0^{2} - 4(1)(1)}}{2(1)}\).
Step 5
Step 5 - Work out the numbers in the formula.
In this problem: Under the square root, \(0^{2} = 0\) and \(4(1)(1) = 4\), so \(0 - 4 = -4\). Underneath, \(2(1) = 2\). A negative number has no real square root, so the equation has no real solutions.
Final Answer
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}\).
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\).
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}''\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x^{2}\). This is a power of \(x\), so the exponent is \(n = 2\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Substitute the given power into the formula.
In this problem: Here, \(n = 2\). Substitute this exponent into the power rule, but do not simplify yet.
Step 4
Step 4 - Solve and simplify.
In this problem: Now subtract 1 from the exponent. This gives \(2{x}^{1}\).
Final Answer
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- If there is a number in front, move it out with the constant multiple rule.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(2\) times \(x\). Rewrite the variable part as \(x^{1}\), so the power rule can be used with exponent \(n = 1\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Move the number in front out with the constant multiple rule.
In this problem: \(2\) is a constant coefficient, so it moves in front of the derivative and the power rule only works on \(x\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant multiple rule formula.
- Apply the constant multiple rule.
Step 1
Step 1 - Set up the coefficient and the variable part.
In this problem: We are given \(2 x^{1}\). The constant coefficient is \(2\), and the variable part is \(x^{1}\).
Step 2
Step 2 - Write the constant multiple rule formula.
In this problem: The constant multiple rule says a constant coefficient stays outside the derivative.
Step 3
Step 3 - Apply the constant multiple rule.
In this problem: Move the constant coefficient \(2\) outside the derivative and leave \(x^{1}\) inside the derivative.
Final Answer
Step 4
Step 4 - Substitute the exponent into the formula.
In this problem: Use the rewritten power form from Step 1. Here, \(n = 1\). Substitute this exponent into the power rule, then keep the coefficient \(2\) outside.
Step 5
Step 5 - Solve and simplify.
In this problem: Apply the power rule to \(x\) and multiply by the constant \(2\). This gives \(2\).
Final Answer
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.
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\).
Step 9a
Step 9a - Find A.
In this problem: The equation \(A = 1\) has only \(A\) left in it, so \(A = 1\).
Step 9b
Step 9b - Find B.
In this problem: The equation \(B = 0\) has only \(B\) left in it, so \(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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Expand and simplify. Remove the brackets and combine the like terms on each side, covered in the Simplifying Algebraic Expressions Calculator.
- Collect the variable terms. Move every term that holds the variable onto one side by adding or subtracting that term on both sides, so the equation stays balanced.
- Collect the constant terms. Move every constant onto the other side by adding or subtracting that constant on both sides, so the equation stays balanced.
- Isolate the variable. Undo the coefficient that is still attached to the variable, covered in the Solving One-Step Equations Calculator.
- Verify the solution. Put the answer back into the original equation and check that both sides come out equal.
Depending on the equation, some of these steps are not needed, so they are skipped.
Step 1
Step 1 - Set up the problem.
In this problem: The equation is \(C + 2 = 0\), with \(C + 2\) on the left of the equals sign and \(0\) on the right.
Step 2
Step 2 - Collect the constant terms. Move every constant onto the other side by adding or subtracting that constant on both sides, so the equation stays balanced.
In this problem: The left side is \(C + 2\), which still holds the constant \(2\).
Step 2a
Step 2a - Subtract \(2\) from both sides.
In this problem: \(2\) is subtracted from both sides to clear that constant off the left.
Step 2b
Step 2b - Work out each side.
In this problem: On the left, \(2 - 2 = 0\), so only the variable term is left there. On the right, \(0 - 2 = -2\).
Step 3
Step 3 - Verify the solution. Put the answer back into the original equation and check that both sides come out equal.
In this problem: The answer \(C = -2\) is checked in three parts: write the original equation, put \(-2\) in place of \(C\), then work out both sides.
Step 3a
Step 3a - Write the original equation.
In this problem: The original equation is \(C + 2 = 0\).
Step 3b
Step 3b - Put the answer in place of the variable.
In this problem: Putting \(-2\) in place of every \(C\) in \(C + 2 = 0\) gives \(-2 + 2 = 0\).
Step 3c
Step 3c - Work out both sides.
In this problem: On the left, \(-2 + 2 = 0\). On the right, \(0\). Both sides are equal, so \(C = -2\) is correct.
Final Answer
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\).
Final Answer
Calculator and Practice Mode
Want to check your own working? The Second Order ODE Solver Calculator solves any problem you type in and shows every step, so you can compare it line by line with your answer and find exactly where a mistake crept in. When you are ready to test yourself, Second Order ODE Solver Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode for this calculator is available on the Pro plan.