// Tools · Differential Equation Solver
Differential Equation Solver (ODE Solver): First and Second Order, With Every Step
Enter a, b and c, pick the forcing f(t), set the initial conditions and press Solve. The tool writes the characteristic equation, finds its roots, picks the form of the solution, finds the particular solution, applies the initial conditions and plots the result. Every answer is re-checked against a fourth-order Runge–Kutta integration before it is shown. It covers RC, RL and RLC circuits, springs and resonance.
Solver
How to use it
- Pick the order, or press a preset button to start from a ready-made problem.
- Enter a, b and c. Fractions and constants work:
1/2,pi,sqrt(2). - Choose f(t) and fill in A and ω (or k for an exponential).
- Enter y(0) and y′(0) and press Solve. The page URL updates with your inputs, so you can copy it and share the result.
How the solver works
- Homogeneous part: substitute to get the characteristic equation . Real, repeated or complex roots fix the form of .
- Particular solution: guess a form that matches f(t) (undetermined coefficients). If the guess duplicates a term of , multiply by t (resonance).
- Initial conditions: substitute y(0) and y′(0) into and solve for C₁ and C₂.
| Roots of | Form of | Physical behaviour |
|---|---|---|
| two real | overdamped, no oscillation | |
| repeated | critically damped, fastest without overshoot | |
| complex | underdamped, rings and decays |
The complex case comes from Euler's formula : with real coefficients, the real and imaginary parts are separate solutions.
| f(t) | Guess for | If it duplicates |
|---|---|---|
| constant K | multiply by t | |
| multiply by t, or t² if k is a repeated root | ||
| or | multiply by t (resonance) |
Worked example: an underdamped spring
, , is the default problem.
- , so .
- and .
- Combine into one wave with : , .
· ζ = 1/√5 ≈ 0.447, ωₙ = √5
Second example, the "RLC with a DC source" preset: from rest gives , roots −1 and −3, and , which settles at 1 without overshoot (overdamped, ζ ≈ 1.155).
Frequently asked questions
Which differential equations does this solver handle?
Constant-coefficient linear equations: first order ay′ + by = f(t) and second order ay″ + by′ + cy = f(t), where f(t) is zero, a constant, an exponential Ae^{kt}, or a sinusoid A cos ωt or A sin ωt, with initial conditions. That covers RC, RL and RLC circuits, mass–spring–damper problems and resonance.
How reliable are the answers?
Every time you solve, the tool integrates the same equation numerically with fourth-order Runge–Kutta and compares it with the closed form over the whole time window. If they disagree, the formula is withheld and only the numerical curve is shown. The open circles on the graph are the RK4 values.
Why do complex roots give cosines and sines?
A complex root α ± jβ gives e^{(α+jβ)t} = e^{αt}(cos βt + j sin βt) by Euler's formula. Because the coefficients are real, the real and imaginary parts are separate solutions, so y = e^{αt}(C₁ cos βt + C₂ sin βt).
What does resonance look like here?
If the forcing frequency equals the natural frequency and there is no damping (b = 0), the particular solution picks up a factor t and the amplitude grows linearly. Press the resonance preset to see it.
Can I share a result?
Yes. Each time you solve, the inputs are written into the page URL. Copy the address bar and send it; the link opens with the same equation and the same steps.