Skip to content
MasterMath

Differential Equation Calculator

Solves the first-order linear differential equation y′ + a·y = b with its initial condition, and checks whether a function you write is a solution.

Solution

—

Solution—
Value at the requested time—
Equilibrium—
Time to cover half the way—
Distance to equilibrium at that time—
Is the function you wrote a solution?—

The solution over time

ty(t)Distance to equilibrium

How it was solved

    The formula

    y′ + a·y = b → y(t) = b/a + (y₀ − b/a)·e^(−a·t)

    Why it works

    The equation says that the rate of change of y depends on y itself: the further it is from the value b/a, the faster it moves towards it. That value is the equilibrium, where the derivative vanishes and the solution stays put. Everything else is the transient: the initial gap, y₀ − b/a, multiplied by an exponential that fades it away. It is the same equation as a coffee cooling, a capacitor charging, a tank with water flowing in and out or a drug being cleared by the body; with b = 0 it reduces to y′ = −a·y, plain exponential growth or decay. Checking whether a function is a solution needs no solving at all: differentiate it and see whether the equation holds, here by evaluating at several points.

    How to solve it by hand

    1. Divide b by a to get the equilibrium: the value the solution tends to
    2. Subtract that equilibrium from the initial value: that is the constant multiplying the exponential
    3. Write y(t) = b/a + (y₀ − b/a)·e^(−a·t) and substitute t to get the value at any time
    4. To check a solution, differentiate it and see whether y′ + a·y gives exactly b

    What is worth knowing

    The sign of a decides everything. With a positive, the transient fades and the solution ends at the equilibrium, which is stable: that is why coffee cools down to room temperature and no further. With a negative, the exponential grows and the solution runs away from the equilibrium for good, which is what happens to capital at compound interest or to a population with no limit. With a equal to zero there is neither equilibrium nor exponential: the equation is y′ = b and its solution a straight line. The time to cover half the way, ln 2 over a, is the analogue of a half-life and does not depend on where you start: from any point, in that time half of what remains is covered. A solution is checked at three points rather than one, because a wrong function can agree with the equation at a single point by chance.

    Frequently asked questions

    Which equations does this calculator solve?

    First-order linear equations with constant coefficients, y′ + a·y = b, which include exponential growth and decay when b is zero.

    What is the equilibrium?

    The value b/a where the derivative vanishes. If a is positive the solution tends to it; if negative, it moves away.

    How do I know whether a function is a solution?

    Differentiate it and substitute into the equation: if y′ + a·y gives b for every t, it is. The calculator checks it at three different points.

    Can I write the function with sin and exp?

    Yes: sin, cos, tan, ln, log, sqrt and exp are understood, and e^(…) too. Use t as the variable and a dot for decimals.