Philippines · Maths & Statistics
Differential Equation Calculator
Pick the form of your equation and enter its coefficients. The calculator gives the general solution, applies your initial conditions to get the particular solution, and names which of the three characteristic-root cases you are in.
How do you solve a second-order differential equation?
For a homogeneous equation with constant coefficients, substitute y = e^(rx) to turn it into the characteristic quadratic ar² + br + c = 0. Its discriminant decides the form: two real roots give a sum of exponentials, a repeated root brings a factor of x, and complex roots give an exponential envelope multiplying sine and cosine.
How to use this calculator
- Match your equation to one of the three formsRearrange first if needed. A second-order equation must have all terms on the left and zero on the right to be homogeneous.
- Enter the coefficients including signsFor y″ − 4y′ + 3y = 0 enter a = 1, b = −4, c = 3. Getting a sign wrong changes which case you land in.
- Give both initial conditions for second orderA second-order equation needs two conditions to pin down both constants — typically y(0) and y′(0).
- Read which case you are inThe discriminant decides everything. Knowing whether you are overdamped, critically damped or underdamped often matters more than the algebra.
Why substituting an exponential works
The characteristic equation method looks like a trick and is not. It follows from one property of the exponential function.
Differentiating e^(rx) gives r·e^(rx), and differentiating again gives r²·e^(rx). The function reproduces itself under differentiation, multiplied by a power of r each time.
So substituting y = e^(rx) into ay″ + by′ + cy = 0 gives ar²e^(rx) + bre^(rx) + ce^(rx) = 0. Every term carries the same e^(rx) factor, which is never zero, so it divides out entirely — leaving ar² + br + c = 0.
A differential equation has become a quadratic. That is the whole method, and it works only because the coefficients are constants and the equation is linear.
The discriminant then decides the shape of the answer.
Two distinct real roots give two independent solutions, e^(r₁x) and e^(r₂x), and any combination of them is also a solution. No oscillation occurs. In a physical system this is the overdamped case — the system returns to equilibrium without overshooting.
A repeated root gives only one exponential, which is not enough: a second-order equation needs two independent solutions. The second is x·e^(rx), which can be verified by substitution. This is critical damping, the fastest return to equilibrium without overshoot.
Complex roots α ± βi give exponentials with imaginary arguments. Euler's formula converts those into sine and cosine, and the real part α becomes an exponential envelope while β sets the oscillation frequency. This is the underdamped case — the system oscillates while decaying.
y = e^(rx) → ar² + br + c = 0Worked example: y″ + 5y′ + 6y = 0 with y(0) = 2, y′(0) = −5
Write the characteristic equation: r² + 5r + 6 = 0.
The discriminant is 25 − 24 = 1, which is positive, so there are two distinct real roots.
Factoring: (r + 2)(r + 3) = 0, giving r₁ = −2 and r₂ = −3.
General solution: y = C₁e^(−2x) + C₂e^(−3x).
Now apply the initial conditions. At x = 0 both exponentials equal 1, so y(0) = C₁ + C₂ = 2.
Differentiating: y′ = −2C₁e^(−2x) − 3C₂e^(−3x). At x = 0 that gives y′(0) = −2C₁ − 3C₂ = −5.
Solving the pair: from the first, C₂ = 2 − C₁. Substituting into the second: −2C₁ − 3(2 − C₁) = −5, so −2C₁ − 6 + 3C₁ = −5, giving C₁ = 1 and therefore C₂ = 1.
Particular solution: y = e^(−2x) + e^(−3x).
Check it. At x = 0, y = 1 + 1 = 2 ✓. And y′(0) = −2 − 3 = −5 ✓.
At x = 1, y = e^(−2) + e^(−3) = 0.1353 + 0.0498 = 0.1851.
Both roots are negative, so both exponentials decay and the solution tends to zero. The e^(−3x) term dies faster, so for larger x the behaviour is dominated by e^(−2x) — the root closest to zero always governs the long-run behaviour, which is why the slowest-decaying mode is the one engineers care about.
The three cases
| Discriminant | Roots | General solution | Physical behaviour |
|---|---|---|---|
| b² − 4ac > 0 | Two distinct real | C₁e^(r₁x) + C₂e^(r₂x) | Overdamped — no oscillation |
| b² − 4ac = 0 | One repeated | (C₁ + C₂x)e^(rx) | Critically damped — fastest without overshoot |
| b² − 4ac < 0 | Complex α ± βi | e^(αx)(C₁cos βx + C₂sin βx) | Underdamped — decaying oscillation |
Stability depends on the sign of the real part of every root. If all roots have negative real parts the solution decays to zero and the system is stable. A single root with a positive real part makes the solution grow without bound. Roots with zero real part give sustained oscillation that neither grows nor decays — marginal stability, which in engineering is usually treated as a failure rather than a success.
What lies outside this calculator
The three forms here cover a large share of introductory coursework, and several important cases sit outside them.
Non-homogeneous equations — where the right-hand side is not zero — need a particular integral added to the complementary function. The complementary function is exactly what this calculator produces; the particular integral depends on the forcing term and is found by undetermined coefficients or variation of parameters. The full solution is the sum of the two.
That structure is worth understanding even where the calculator stops: the complementary function describes how the system behaves on its own, and the particular integral describes how it responds to being driven. In a physical system the complementary function is the transient that dies away, and the particular integral is the steady-state response that remains.
Variable coefficients — where a, b or c depend on x — break the exponential substitution entirely, because e^(rx) no longer reduces the equation to a polynomial. Cauchy-Euler equations are the tractable special case, solved by substituting y = x^r instead.
Separable equations more general than dy/dx = ky are solved by separating and integrating, which works whenever the equation can be written as g(y)dy = f(x)dx. Exact equations, integrating factors for non-constant coefficients, and substitution methods for homogeneous and Bernoulli equations all extend the first-order toolkit.
Systems of coupled equations are handled with matrices, where the eigenvalues of the coefficient matrix play exactly the role the characteristic roots play here — the same idea in more variables.
And many equations have no closed-form solution at all, which is where numerical methods take over. Euler's method and the Runge-Kutta family step forward from an initial condition and are what most engineering software actually uses.
The Laplace transform is an alternative route to the same second-order answers, and it handles discontinuous forcing far more cleanly than these methods do.
Always verify a solution by substituting it back into the original equation. It is the only check that does not depend on trusting the method, and it catches sign errors that otherwise survive to the end.
Assumptions and limitations
- Homogeneous equations only — a non-zero right-hand side needs a particular integral added
- Constant coefficients only — variable coefficients break the exponential substitution
- Covers exponential, first-order linear and second-order homogeneous forms
- Initial conditions must be given at x = 0
- Does not handle systems of coupled equations
- Does not produce solutions in exact surd form — roots are shown as decimals
- Third order and higher are not covered, though the same characteristic method extends to them
Questions people ask about this in Philippines
How do you solve a second-order differential equation?
Substitute y = e^(rx), which turns it into the characteristic quadratic ar² + br + c = 0.
The discriminant then decides the form: real roots give exponentials, a repeated root brings a factor of x, and complex roots give oscillation.
Why does substituting e^(rx) work?
Because differentiating e^(rx) just multiplies it by r. Every term ends up carrying the same e^(rx) factor, which is never zero, so it divides out and leaves a quadratic.
It works only for linear equations with constant coefficients.
Why does a repeated root give xe^(rx)?
Because one exponential is not enough — a second-order equation needs two independent solutions.
Multiplying by x produces a second one, which can be verified by substituting it back in.
What do complex roots mean physically?
Oscillation. The real part α becomes an exponential envelope controlling growth or decay, and the imaginary part β sets the frequency.
This is the underdamped case — the system overshoots and rings before settling.
How many initial conditions do I need?
As many as the order of the equation. A first-order equation needs one; a second-order equation needs two, usually y(0) and y′(0).
Without them you get the general solution with unknown constants.
What if the right-hand side is not zero?
Then the equation is non-homogeneous and needs a particular integral added to what this calculator gives you.
The complementary function describes the transient; the particular integral describes the steady-state response to the forcing.
When is a solution stable?
When every root has a negative real part, so all the exponentials decay to zero.
A single root with a positive real part makes the solution grow without bound.
Related Philippines calculators
Tools people usually open in the same sitting.
Method, source and review date
- How it is worked out
- Characteristic equation with initial-condition fitting
- Formula used
ay'' + by' + cy = 0 → ar² + br + c = 0- Checked against
- Standard engineering mathematics
- Last reviewed
- Confidence
- High
Spotted a figure that has moved, or a formula you can show is wrong? Tell us — send a correction. Fixes to rates and formulas are treated as urgent.
Disclaimer
This calculator gives an estimate for guidance only. Check the figures against your own measurements or paperwork before you commit money to them.