Second-Order Differential Equation Solver
Solve linear differential equations with constant coefficients, and Cauchy–Euler equations, step by step: the auxiliary equation, complementary function and particular integral, each checked by substituting back.
About the Second-Order Differential Equation Solver
For a y″ + b y′ + c y = f(x), the complementary function (CF) solves the equation with f = 0. Trying y = e^(mx) gives the auxiliary equation a m² + b m + c = 0: two real roots give c₁e^(m₁x) + c₂e^(m₂x); a repeated root m gives (c₁ + c₂x)e^(mx); complex roots α ± iβ give e^(αx)(c₁ cos βx + c₂ sin βx). The general solution is CF + PI, where the particular integral (PI) is any one solution of the full equation.
For f made of polynomials, exponentials, sines and cosines, the PI has the same form with unknown coefficients, multiplied by x (or x²) when that form already appears in the CF. For other f, such as sec x or tan x, variation of parameters gives y_p = −y₁∫y₂f/W dx + y₂∫y₁f/W dx. A Cauchy–Euler equation x²y″ + bxy′ + cy = f becomes one with constant coefficients under x = eᶻ.
The formula
y = CF + PI; e^(mx) in a y″ + b y′ + c y = 0 ⇒ a m² + b m + c = 0
- W
- the Wronskian y₁y₂′ − y₁′y₂
- Cauchy–Euler
- x = eᶻ turns xy′ into Dy and x²y″ into D(D − 1)y, D = d/dz
Worked example
y″ − 3y′ + 2y = e^(3x)
- m² − 3m + 2 = 0 ⇒ m = 1, 2: CF = c₁eˣ + c₂e²ˣ
- Try y_p = Ae^(3x): (9 − 9 + 2)A = 1 ⇒ A = 1/2
- y = c₁eˣ + c₂e²ˣ + e^(3x)/2
Questions people ask
Why is my trial solution multiplied by x?
If e^(2x) is already in the CF, Ae^(2x) gives 0 when substituted, so the trial becomes Axe^(2x) (or Ax²e^(2x) for a double root).
Which equations are covered?
Linear equations with constant (fraction) coefficients up to order 6, and Cauchy–Euler equations. The auxiliary equation must factor into linear and quadratic factors with rational coefficients.