Second Order ODE Solver

Published on: November 16, 2025

This Second Order ODE Solver helps you solve second-order differential equations and shows each step clearly. It can be used to work with common second-order ODE forms, apply suitable solution methods, and optionally use up to two initial conditions to find a particular solution. This makes it useful for checking answers, understanding how second-order ODEs are solved, and practising differential equations step by step.

Step-by-step method

  1. Write the ODE clearly using y′ and y″ or derivative notation.
  2. Check whether the equation is linear in y, y′, and y″.
  3. Detect the main type: constant coefficients, Euler-Cauchy, or general linear second order.
  4. Apply the matching method.
  5. Write the general solution with constants C1 and C2.
  6. If initial conditions are given, solve for C1 and C2.
  7. Write the final solution as y(x).

Formula bank:

Constant coefficients: a
d²y
dx²
+ b
dy
dx
+ cy = 0
Characteristic equation: ar² + br + c = 0
Distinct roots: y = C₁er₁x + C₂er₂x
Repeated root: y = (C₁ + C₂x)erx
Complex roots α±βi: y = eαx(C₁cos(βx)+C₂sin(βx))
Euler-Cauchy: x²y″ + ax y′ + by = 0
Try y = xm
Indicial equation: m(m−1) + am + b = 0
General linear: y″ + P(x)y′ + Q(x)y = R(x)
Use symbolic solving when no simple special form applies.

Example 1: y'' + y = 0, x, y, y(0)=0, y'(0)=1

Step 1 - Write the ODE.

In this problem: Start with the given second-order differential equation.

d²y
dx²
+ y = 0

Step 2 - Confirm linear form.

In this problem: Match the equation to a(x)y″ + b(x)y′ + c(x)y = r(x).

a(x) = 1
b(x) = 0
c(x) = 1
r(x) = 0

Step 3 - Identify constant coefficients.

In this problem: The coefficients do not depend on x, so use the characteristic equation.

Constant coefficients: a
d²y
dx²
+ b
dy
dx
+ cy = 0
Characteristic equation: ar² + br + c = 0
Distinct roots: y = C₁er₁x + C₂er₂x
Repeated root: y = (C₁ + C₂x)erx
Complex roots α±βi: y = eαx(C₁cos(βx)+C₂sin(βx))

Step 4 - Write the characteristic equation.

In this problem: Replace y by e^{rx}, which gives ar² + br + c = 0.

1 + r2 = 0

Step 5 - Solve for r.

In this problem: The roots determine the shape of the homogeneous solution.

r = −i, i

Step 6 - Write the general solution.

In this problem: Complex roots give sine and cosine terms.

y = C1cos(x) + C2sin(x)

Step 7 - Apply initial conditions.

In this problem: Use the given values to solve for C1 and C2.

y(0) = 0
y′(0) = 1

Step 8 - Final answer.

In this problem: This is the solution written in terms of the dependent variable.

y = sin(x)

Final answer: See final step

Example 2: y'' - 3y' + 2y = 0, x, y

Step 1 - Write the ODE.

In this problem: Start with the given second-order differential equation.

−3
dy
dx
+ 2y +
d²y
dx²
= 0

Step 2 - Confirm linear form.

In this problem: Match the equation to a(x)y″ + b(x)y′ + c(x)y = r(x).

a(x) = 1
b(x) = -3
c(x) = 2
r(x) = 0

Step 3 - Identify constant coefficients.

In this problem: The coefficients do not depend on x, so use the characteristic equation.

Constant coefficients: a
d²y
dx²
+ b
dy
dx
+ cy = 0
Characteristic equation: ar² + br + c = 0
Distinct roots: y = C₁er₁x + C₂er₂x
Repeated root: y = (C₁ + C₂x)erx
Complex roots α±βi: y = eαx(C₁cos(βx)+C₂sin(βx))

Step 4 - Write the characteristic equation.

In this problem: Replace y by e^{rx}, which gives ar² + br + c = 0.

2 + r2 − 3r = 0

Step 5 - Solve for r.

In this problem: The roots determine the shape of the homogeneous solution.

r = 1, 2

Step 6 - Write the general solution.

In this problem: Distinct real roots give two exponential terms.

y = (C1 + C2ex)ex

Step 7 - Final answer.

In this problem: This is the solution written in terms of the dependent variable.

y = (C1 + C2ex)ex

Final answer: See final step

Example 3: x^2y'' - xy' + y = 0, x, y

Step 1 - Write the ODE.

In this problem: Start with the given second-order differential equation.

x2
d²y
dx²
− x
dy
dx
+ y = 0

Step 2 - Confirm linear form.

In this problem: Match the equation to a(x)y″ + b(x)y′ + c(x)y = r(x).

a(x) = x2
b(x) = −x
c(x) = 1
r(x) = 0

Step 3 - Identify Euler-Cauchy form.

In this problem: The coefficients match x²y″ + ax y′ + by = 0 up to a constant factor.

Euler-Cauchy: x²y″ + ax y′ + by = 0
Try y = xm
Indicial equation: m(m−1) + am + b = 0

Step 4 - Write the indicial equation.

In this problem: Try y = x^m.

1 − m + m(−1 + m) = 0

Step 5 - Solve for m.

In this problem: The roots determine the Euler-Cauchy solution form.

m = 1

Step 6 - Write the general solution.

In this problem: A repeated root gives x^m(C1 + C2ln(x)).

y = x(C1 + C2ln(x))

Step 7 - Final answer.

In this problem: This is the solution written in terms of the dependent variable.

y = x(C1 + C2ln(x))

Final answer: See final step