Ordinary Differential Equations¶
Why Differential Equations?¶
Many processes in nature evolve continuously over time. When we want to understand how something changes—whether it's the concentration of a protein in a cell, the number of individuals in a population, or the velocity of a falling object—we often find that the rate of change depends on the current state of the system. This leads us naturally to differential equations.
An ordinary differential equation (ODE) is simply an equation that relates a function to its derivatives. The word "ordinary" distinguishes these from partial differential equations, which involve derivatives with respect to multiple variables. In this primer, we focus exclusively on ODEs, which are sufficient for modeling systems that evolve in time alone.
First-Order ODEs: The Building Blocks¶
The simplest and most fundamental type of ODE is the first-order equation, which involves only the first derivative. We typically write this as:
$$\frac{dx}{dt} = f(x)$$
Here, $x(t)$ is the unknown function we want to find, and $f(x)$ is some expression that may depend on the current value of $x$. The derivative $dx/dt$ represents the instantaneous rate of change of $x$ with respect to time.
Consider a simple example from biology: a bacterial population growing in unlimited resources. If we let $N(t)$ represent the number of bacteria at time $t$, we might model the growth rate as proportional to the current population size. This gives us $dN/dt = rN$, where $r$ is the growth rate constant. This is one of the most famous ODEs in biology, and its solution is exponential growth: $N(t) = N_0 e^{rt}$, where $N_0$ is the initial population size.
Solving ODEs: When We Can and When We Can't¶
Linear first-order ODEs of the form $dx/dt = a x + b$ also have standard solution methods involving integrating factors. These appear frequently in applications because linear systems are both mathematically tractable and often good approximations to more complex nonlinear systems.
However, most ODEs arising in real applications are nonlinear and cannot be solved in closed form. This is not a failure of mathematics but rather a fundamental feature of complex systems. When exact solutions are unavailable, we turn to qualitative analysis and numerical methods.
Qualitative Analysis: Understanding Without Solving¶
Even when we cannot solve an ODE explicitly, we can often understand its solutions' behavior through qualitative analysis. For first-order equations $dx/dt = f(x)$, we can sketch the phase line—a diagram showing where $f(x)$ is positive (so $x$ increases), negative (so $x$ decreases), or zero (so $x$ remains constant).
Points where $f(x) = 0$ are called equilibrium points or fixed points. These represent states where the system does not change. The stability of an equilibrium is crucial: a stable equilibrium attracts nearby solutions, while an unstable equilibrium repels them. For first-order systems, stability is determined simply by the sign of $f'(x)$ at the equilibrium: if $f'(x) < 0$, the equilibrium is stable; if $f'(x) > 0$, it is unstable.
Consider a model of gene expression where $dx/dt = \beta - \gamma x$, representing protein production at rate $\beta$ and degradation at rate $\gamma x$. The equilibrium is at $x^* = \beta/\gamma$, and since $f'(x^*) = -\gamma < 0$, this equilibrium is stable. Any initial protein concentration will exponentially approach this steady-state value, giving us insight into the system's behavior without solving the equation explicitly.
Systems of ODEs: Coupled Dynamics¶
Real biological and physical systems rarely involve just one variable changing over time. More often, we have multiple interacting components, leading to systems of coupled ODEs. For two variables, this takes the form:
$$\frac{dx}{dt} = f(x, y)$$ $$\frac{dy}{dt} = g(x, y)$$
Such systems can exhibit far richer behavior than single equations. Equilibrium points are now points in the $(x, y)$ plane where both $dx/dt = 0$ and $dy/dt = 0$. The stability of these equilibria is determined by linearization: we approximate the nonlinear system near the equilibrium using its linear part, then analyze the eigenvalues of the resulting Jacobian matrix.
The classic predator-prey model illustrates this beautifully. If $x$ represents prey and $y$ represents predators, we might write:
$$\frac{dx}{dt} = ax - bxy$$ $$\frac{dy}{dt} = -cy + dxy$$
The prey grow exponentially in the absence of predators but are consumed at a rate proportional to predator-prey encounters. The predators die off without prey but grow through consumption. This system has a non-trivial equilibrium at $(c/d, a/b)$ around which populations oscillate periodically—a phenomenon that cannot occur in single first-order ODEs but emerges naturally in two-dimensional systems.
Linear Systems and Matrix Exponentials¶
Linear systems of ODEs deserve special attention because they are exactly solvable and provide the foundation for understanding nonlinear systems through linearization. A linear system has the form:
$$\frac{d\mathbf{x}}{dt} = A\mathbf{x}$$
where $\mathbf{x}$ is a vector and $A$ is a constant matrix. The solution is given by the matrix exponential: $\mathbf{x}(t) = e^{At}\mathbf{x}_0$.
The behavior of this system is entirely determined by the eigenvalues of $A$. If all eigenvalues have negative real parts, solutions decay to zero—the system is stable. If any eigenvalue has a positive real part, solutions grow without bound—the system is unstable. Complex eigenvalues lead to oscillatory behavior, with the real part determining whether the oscillations grow or decay.
This eigenvalue analysis extends to nonlinear systems through linearization. Near an equilibrium point, we approximate the nonlinear system by its linear part, and the eigenvalues of the Jacobian matrix determine local stability. This is why linear algebra is indispensable for understanding ODEs.
Higher-Order ODEs and Dimensionality¶
A second-order ODE involves the second derivative: $d^2x/dt^2 = f(x, dx/dt)$. Such equations arise naturally in mechanics, where Newton's second law gives acceleration (the second derivative of position) as a function of position and velocity. For instance, a simple harmonic oscillator satisfies $d^2x/dt^2 = -\omega^2 x$.
Any higher-order ODE can be converted into a system of first-order ODEs by introducing new variables for each derivative. The second-order equation above becomes a first-order system by setting $v = dx/dt$:
$$\frac{dx}{dt} = v$$ $$\frac{dv}{dt} = -\omega^2 x$$
This transformation is more than mathematical convenience—it reveals that second-order equations are fundamentally two-dimensional dynamical systems. The phase space for this oscillator is the $(x, v)$ plane, and solutions trace out circular or elliptical orbits representing periodic motion.
Numerical Methods: Computing Solutions¶
When analytical solutions are unavailable, numerical methods approximate solutions at discrete time points. The simplest method is Euler's method: starting from an initial condition $x_0$ at $t_0$, we approximate $x(t_0 + h) \approx x_0 + h \cdot f(x_0)$ for small time step $h$. This follows directly from the definition of the derivative.
While Euler's method is intuitive, more sophisticated methods like Runge-Kutta achieve better accuracy by evaluating the derivative at multiple points within each time step. The fourth-order Runge-Kutta method (RK4) is particularly popular, balancing accuracy and computational cost. Most modern ODE solvers use adaptive methods that automatically adjust the step size to maintain accuracy while minimizing computation.
Numerical solutions are essential for real applications, but they come with caveats. Stability of the numerical method is distinct from stability of the differential equation itself. Stiff equations—those with widely separated time scales—pose particular challenges, requiring specialized implicit methods that remain stable even with large time steps.
Applications in Biological Systems¶
ODEs are the primary mathematical tool for modeling dynamics in molecular and cell biology. The central dogma of molecular biology—DNA makes RNA makes protein—translates naturally into coupled differential equations. If we let $m(t)$ represent mRNA concentration and $p(t)$ represent protein concentration, we might write:
$$\frac{dm}{dt} = \beta_m - \gamma_m m$$ $$\frac{dp}{dt} = \beta_p m - \gamma_p p$$
Here, $\beta_m$ is the transcription rate, $\gamma_m$ is the mRNA degradation rate, $\beta_p$ is the translation rate per mRNA molecule, and $\gamma_p$ is the protein degradation rate. This simple model captures the time scales of gene expression and predicts steady-state protein levels.
More complex regulatory networks require systems of many coupled ODEs. The repressilator—three genes repressing each other in a cycle—demonstrates how simple regulatory motifs can generate oscillations. Models of cell cycle control, metabolic networks, and signal transduction pathways all employ ODEs to bridge molecular mechanisms and cellular behavior.
Beyond ODEs: What Comes Next¶
This primer focuses on deterministic ODEs, where the same initial condition always produces the same trajectory. Real biological systems involve randomness—molecules diffuse, reactions occur probabilistically, and populations fluctuate. Stochastic differential equations and the chemical master equation extend ODEs to capture this randomness.
ODEs assume well-mixed systems where spatial position is irrelevant. When spatial structure matters—during development, tissue formation, or epidemic spread—we need partial differential equations or agent-based models. Nevertheless, ODEs often provide an essential first approximation, capturing the essential temporal dynamics before adding spatial complexity.
For systems with discrete events—such as cell division, viral infection, or threshold-crossing—hybrid models combining ODEs with discrete switches may be more appropriate. The choice of modeling framework depends on the biological question and the available data.
Key Takeaways¶
Ordinary differential equations are the natural language for describing continuous change. They allow us to express mechanistic understanding—how rates of change depend on current state—and derive predictions about long-term behavior. While only special ODEs have closed-form solutions, qualitative analysis and numerical methods provide powerful tools for understanding any system.
For students of computational bioengineering, facility with ODEs is essential. They appear throughout systems biology, from gene regulation to population dynamics. The ability to formulate problems as ODEs, analyze their behavior, simulate them numerically, and connect them to data is fundamental to modern quantitative biology.
License: © 2025 Matthias Függer and Thomas Nowak. Licensed under CC BY-NC-SA 4.0.