Differential Equation Calculator

Solve y′ + a·y = b and a·y″ + b·y′ + c·y = 0 with constant coefficients step by step, with optional initial conditions, or integrate y′ = a·y + b·t + c numerically.

General solution
—
Solution with the initial conditions
—
Steps
—
Refined y(t₁), 2N steps
—
Refined time step
—
Step-doubling error indicator
—

Calculation and assumptions

y′ + a·y = b: y = b/a + C·e^(−a·x); a = 0: y = b·x + C. a·y″ + b·y′ + c·y = 0: a·r² + b·r + c = 0, D = b² − 4ac; D > 0: y = C₁·e^(r₁x) + C₂·e^(r₂x); D = 0: y = (C₁ + C₂·x)·e^(rx); D < 0: y = e^(αx)·(C₁·cos βx + C₂·sin βx). RK4: k₁…k₄, yₙ₊₁ = yₙ + h(k₁ + 2k₂ + 2k₃ + k₄)/6, E ≈ |y₂ₙ − yₙ|/15.

Coefficients are constants: decimals up to ±1000000 with a dot or comma. The second-order equation is homogeneous; for an initial value problem enter both y(x₀) and y′(x₀). The sign of the discriminant is decided exactly from the entered decimals, so a double root is not missed by rounding; displayed numbers have 6 significant digits. RK4 mode integrates the different equation y′ = a·y + b·t + c over N and 2N steps; its error indicator is an estimate, not a bound.

Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

Frequently asked questions

How is the result calculated?

y′ + a·y = b: y = b/a + C·e^(−a·x); a = 0: y = b·x + C. a·y″ + b·y′ + c·y = 0: a·r² + b·r + c = 0, D = b² − 4ac; D > 0: y = C₁·e^(r₁x) + C₂·e^(r₂x); D = 0: y = (C₁ + C₂·x)·e^(rx); D < 0: y = e^(αx)·(C₁·cos βx + C₂·sin βx). RK4: k₁…k₄, yₙ₊₁ = yₙ + h(k₁ + 2k₂ + 2k₃ + k₄)/6, E ≈ |y₂ₙ − yₙ|/15.

What assumptions apply?

Coefficients are constants: decimals up to ±1000000 with a dot or comma. The second-order equation is homogeneous; for an initial value problem enter both y(x₀) and y′(x₀). The sign of the discriminant is decided exactly from the entered decimals, so a double root is not missed by rounding; displayed numbers have 6 significant digits. RK4 mode integrates the different equation y′ = a·y + b·t + c over N and 2N steps; its error indicator is an estimate, not a bound.

How do the constants C₁ and C₂ follow from the initial conditions?

Substitute x₀ into the general solution and its derivative: y(x₀) and y′(x₀) give two linear equations in C₁ and C₂, which the calculator solves for each of the three root cases.

How precise are the results?

Results show up to ten significant digits. Display precision does not improve the accuracy of the measurements or model. Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

Also try:

Back to category →