Differential Equation Calculator: Solve Equations Fast

First-Order Differential Equation Calculator

Solve the constant-coefficient initial-value problem y’ = ay + b with y(0) supplied, then evaluate y and its derivative at a chosen x. This is not an arbitrary symbolic equation parser.

Enter y' = ay + b

y(x)28.3834
y'(x)-1.3534
Equilibrium -b/a25
Solution formy = 25 + 25e^(-0.4x)

Valid only for y’ = ay + b with constant coefficients and initial value at x = 0.

Scope of the differential equation

The interface represents one family of first-order ordinary differential equations: the derivative of y with respect to x equals a constant a times y plus a constant b. The initial condition is fixed at x equals zero. This form models proportional change with a constant input or removal term and appears in simplified heating, mixing, charging, population and finance examples.

It does not accept typed expressions, variable coefficients, second derivatives, systems, discontinuous forcing or boundary conditions at two different points. Restricting the form makes the implemented solution inspectable. If your equation contains x multiplying y, a sine input, y squared or y double-prime, do not force its coefficients into these fields.

Deriving the general solution

When a is not zero, the equilibrium is the value that makes the derivative zero: ay plus b equals zero, so y star equals minus b divided by a. Subtracting that equilibrium from y leaves a quantity whose derivative is proportional to itself. The resulting solution is y(x) = y star + [y(0) – y star]e^(ax).

The calculator evaluates this expression numerically and also prints the fitted solution form. Substituting x = 0 makes the exponential equal one, returning the entered initial value. Differentiating the expression gives a[y(0) – y star]e^(ax), which matches ay + b because the equilibrium terms cancel. Those two substitutions are useful checks.

The special case a equals zero

If a is zero, division by a would be invalid and there is no finite equilibrium determined by minus b over a. The differential equation becomes y’ = b, a constant slope. Integrating gives y = y(0) + bx. The script detects a value extremely close to zero and uses this linear solution instead of the exponential formula.

This special case also shows why blind formula substitution can fail. A differential-equation method includes its parameter conditions. If a value is small but genuinely non-zero, the exponential solution is mathematically appropriate, although floating-point cancellation can affect very extreme inputs. Rescale variables or use specialised numerical software when parameter magnitudes are far outside ordinary ranges.

Growth, decay and stability

The sign of a determines stability around equilibrium. When a is negative, e^(ax) decays as x increases and the solution approaches minus b/a. When a is positive, deviations from equilibrium grow, so the equilibrium is unstable for forward x. The initial value decides which side of equilibrium the trajectory starts on.

A positive or negative derivative at one point describes the immediate direction, not the long-term behaviour by itself. Read it together with a, the equilibrium and the solution. For negative x, growth and decay descriptions reverse direction. If x represents time, the model normally applies only over the time interval where its constant coefficients remain credible.

Units and dimensional consistency

The exponential exponent ax must be dimensionless. If x is measured in hours, a has units per hour. Because ay and b are added, both must share the units of y per hour, so b has those derivative units. The equilibrium minus b/a then has the same units as y. A unit mismatch can invalidate a numerically neat answer.

State units beside the entered constants and output. Converting x from hours to minutes requires converting a and b consistently; changing only the x number changes the model. In a cooling example, b may combine an ambient term with the proportional coefficient, so derive a and b from the original physical equation before entering them.

Worked decay example

With a = -0.4, b = 10 and y(0) = 50, the equilibrium is 25. The initial deviation from equilibrium is 25, giving y = 25 + 25e^(-0.4x). At x = 5, the exponential is e^-2, so the value is a little above 28 and still moving downward toward 25.

The derivative can be obtained either from differentiating the solution or substituting the calculated y into ay + b. Those routes should agree apart from display rounding. If they do not in hand work, check the sign of the equilibrium and the coefficient y(0) – y star, two common sources of errors.

Interpreting an equilibrium

An equilibrium is not automatically a desirable target or a physically reachable state. It is the constant solution implied by the mathematical coefficients. Negative concentrations, temperatures below a model’s valid range or populations outside capacity can reveal that the simple linear model is inappropriate even when the algebra is correct.

For a negative a, the distance to equilibrium falls exponentially but does not reach exactly zero at a finite x in the ideal equation. Practical statements such as settled or effectively complete require a tolerance. Compare the remaining deviation with measurement precision or a domain-specific threshold rather than waiting for an exact equality the model never produces.

When a numerical solver is required

Variable coefficients, nonlinear terms and coupled systems may lack a simple closed form. Numerical methods then advance an approximate solution across small steps and require error control, step-size choices and stability checks. Initial conditions, discontinuities and stiff behaviour can strongly affect which algorithm is suitable.

Use this calculator to check the constant-coefficient case or to understand its structure. For assessed mathematics, show the integrating-factor or separation derivation required by the course. For engineering, scientific or safety-critical modelling, validate coefficients against data, state the domain and use software whose numerical method and tolerance can be documented.

Checking coefficients against observations

A closed-form solution can still describe the wrong system when a and b are poorly estimated. Compare predicted values with observations at several x positions, not only with the initial condition that the formula is forced to match. Plot residuals, check whether their pattern changes with time and investigate a structural break before extending the same coefficients.

If measurements contain noise, fitting a and b requires statistical methods and uncertainty reporting. A visually close curve does not prove causation or constant dynamics. Record the data range used for calibration and avoid extrapolating far beyond it, especially when the model informs cost, health, capacity or safety decisions. Preserve the unfitted observations for an independent check.

Questions that affect this result

Can I enter y'' or a second-order equation?

No. The implemented equation is first order: y’ = ay + b.

Why is the equilibrium shown as -b/a?

At equilibrium the derivative is zero, so ay + b = 0 and y = -b/a when a is non-zero.

What happens when a is zero?

The equation becomes y’ = b and the solution is the straight line y = y(0) + bx.

Does a negative a always mean y decreases?

No. It means deviations from equilibrium decay forward in x. A solution below equilibrium can increase toward it.

Can this replace a numerical differential-equation solver?

No. It covers one closed-form family and does not handle variable coefficients, nonlinear equations or systems.

References

Scroll to Top