Differential Equation Calculator
The exact solution of a first-order linear equation with constant coefficients, with its equilibrium and time constant.
Results
What this tool does
One differential equation turns up more than all the others put together: something changing at a rate proportional to how far it is from where it wants to be. Cooling coffee, a charging capacitor, a drug leaving the bloodstream, a savings account with regular withdrawals — all the same shape, y′ + p·y = q. This page solves it exactly rather than numerically, gives the equilibrium the system is heading for, and reports the time constant and half-life that say how fast it gets there. The slope check at the bottom substitutes the answer back into the original equation.
Formula
y′ + p y = q ⟹ y = q ÷ p + (y₀ − q ÷ p) e^(−p x)
Variables
| Symbol | Meaning | Unit |
|---|---|---|
p | p, the coefficient of y | — |
q | q, the constant on the right | — |
y0 | y when x is zero | — |
at | Value it at x = | — |
SL | The solution | — |
VA | y at that x | — |
EQ | Where it settles | — |
KD | What it does over time | — |
TC | Time constant | — |
HL | Time to cover half the remaining gap | — |
SS | How fast it is changing at the start | — |
CK | The equation checked at that x | — |
Worked example
- p, the coefficient of y0.5
- q, the constant on the right0
- y when x is zero100
- Value it at x =2
- The solutiony = 100*exp(-0.5*x)
- y at that x36.7879441171
- Where it settles0.0000000000
- What it does over timeSettles towards the equilibrium
- Time constant2.00000000
- Time to cover half the remaining gap1.38629436
- How fast it is changing at the start-50.00000000
- The equation checked at that x-18.3939720586
Limitations
- The calculation runs entirely in your browser. The values you type are never sent to a server.
- The formula assumes ideal conditions: no friction losses, no air resistance and no efficiency losses unless you enter them.
Frequently asked questions
Which equations does this solve?
One family, exactly: y′ + p·y = q with p and q constant. That sounds narrow and is not, because it is the same equation as Newton's law of cooling, a capacitor charging through a resistor, a drug clearing from the bloodstream, a tank filling while it drains, and a population growing against a fixed harvest. All of them have the same shape — a quantity pulled towards an equilibrium at a rate proportional to how far away it is — and this page gives the exact closed-form answer, not a numerical approximation. Equations where p or q depend on x need a different method and are not handled here.
What is the time constant?
How long the system takes to cover about 63 per cent of the distance to its equilibrium — one divided by p. It is the natural clock of the process: after one time constant 37 per cent of the gap remains, after three about 5 per cent, and after five it is under one per cent, which is why engineers treat five time constants as "settled". The half-life shown alongside is the same idea measured differently: the time to cover exactly half the remaining gap, which is 0.693 times the time constant.