Differential Equations
First-Order ODEs
One equation, $dy/dt = ky$, explains the growth of COVID-19, the cooling of coffee, the decay of uranium-235, and compound interest. Newton wrote it down in 1671. Three hundred and fifty years later, a SpaceX Falcon 9 lands on a drone ship - its flight computer solving a system of 14 such equations in real time, 50 times per second. One equation. Infinite consequences.
- **SpaceX Falcon 9:** the landing control system is 14 coupled first-order ODEs at 50 Hz, with 10-cm touchdown accuracy. The 4th-order Runge-Kutta method runs in every control cycle
- **Epidemiology:** the SIR COVID-19 model starts with $dI/dt = \beta \cdot S \cdot I - \gamma \cdot I$ - a nonlinear ODE where separation of variables fails; numerical methods take over
- **Neural networks:** Neural ODE (NeurIPS 2018) replaces discrete layers with a continuous ODE $dh/dt = f(h, t)$. ResNets are the Euler method for this ODE
- **Pharmacology:** drug concentration $dC/dt = -kC + D(t)$ is a linear ODE solved by integrating factor. Every dosing schedule is built on this formula
Separable Equations
$dy/dt = ky$ - the equation describing COVID growth, radioactive decay, and compound interest simultaneously. The right-hand side factors: $k$ (a function of nothing) times $y$ (a function of $y$). Separate variables: $dy/y = k\,dt$, integrate both sides.
General case: $dy/dx = f(x) \cdot g(y)$. Separate: $dy/g(y) = f(x)\,dx$. Integrate. Example: $dy/dx = xy$. Separate: $dy/y = x\,dx$. Integrate: $\ln|y| = x^2/2 + C$. Solution: $y = Ae^{x^2/2}$, where $A = e^C$ is an arbitrary constant. This exact form underlies the Gaussian (normal) distribution curve in statistics.
| Equation | Separation | Solution |
|---|---|---|
| dy/dx = ky | dy/y = k dx | y = Ce^(kx) (exponential growth) |
| dy/dx = -y/x | dy/y = -dx/x | y = C/x (hyperbola) |
| dy/dx = y² | dy/y² = dx | y = -1/(x+C) (finite-time blow-up!) |
| dy/dx = x/y | y dy = x dx | y² = x² + C (circles) |
**Division-by-zero trap:** when separating dy/g(y) we divide by g(y). Points where g(y) = 0 are **equilibrium solutions** (y = const). These must be checked separately!
**Exponential growth** dy/dx = ky is a foundational model: population growth, radioactive decay, compound interest. One equation describes all of these.
Equation dy/dx = y², solution y(0) = 1. At what x does the solution blow up (go to infinity)?
First-Order Linear ODEs
**First-order linear ODE:** $y' + P(x)y = Q(x)$. The key word is 'linear': $y$ to the first power, no $y^2$, no $y \cdot y'$, etc. These equations can **always** be solved - there is an explicit formula. That is what makes them the main tool in physics and engineering.
Method: multiply both sides by the **integrating factor** $\mu(x) = e^{\int P(x)\,dx}$. The left-hand side magically becomes the derivative of a product: $(\mu \cdot y)' = \mu \cdot Q$. Integrate and divide by $\mu$. This is precisely how drug concentration in blood is computed $t$ hours after administration.
**General solution formula:** y(x) = (1/mu(x)) * [∫(mu(x)·Q(x)dx) + C], where mu(x) = exp(∫P(x)dx). This formula works for ANY first-order linear ODE.
| Equation | P(x) | Q(x) | mu(x) |
|---|---|---|---|
| y' + 2y = e^(-x) | 2 | e^(-x) | e^(2x) |
| y' - y = x | -1 | x | e^(-x) |
| y' + (1/x)y = sin(x) | 1/x | sin(x) | x |
| y' + tan(x)·y = cos(x) | tan(x) | cos(x) | 1/cos(x) |
RC circuit: $dV/dt + V/(RC) = E/(RC)$. Newton's cooling: $dT/dt = -k(T - T_{\text{env}})$. Drug concentration: $dC/dt = -kC + D(t)$. Three different physical systems - one mathematical structure. One method solves all three.
Equation y' + 3y = 0. What is the integrating factor mu(x)?
Exact Equations
The equation $M(x,y)\,dx + N(x,y)\,dy = 0$ is called **exact** if there exists $F(x,y)$ such that $dF = M\,dx + N\,dy$. Then $F(x,y) = C$ is the implicit solution. Physically: the field $(M, N)$ is conservative - it is the gradient of a potential $F$. Force fields in mechanics and electrostatics are found exactly this way.
**Exactness criterion:** $\partial M/\partial y = \partial N/\partial x$. This follows from equality of mixed partials $\partial^2 F/\partial x\partial y = \partial^2 F/\partial y\partial x$. One test - and it is immediately clear whether a potential exists.
**Solution algorithm:** 1) Check ∂M/∂y = ∂N/∂x. 2) Integrate F = ∫M dx + g(y). 3) Find g(y) from ∂F/∂y = N. 4) Write F(x,y) = C.
Geometrically: the field $(M, N)$ is the gradient of $F$. Solutions are level curves $F(x,y) = C$. Isobars on a weather map. Equipotentials of an electric field. The same mathematical object.
Euler and Exact Differentials (1739)
Leonhard Euler was the first to systematically study exact differential equations, formulating the criterion ∂M/∂y = ∂N/∂x. This criterion is a special case of a closed differential form, a concept that later evolved into de Rham cohomology.
Equation (y·cos(xy))dx + (x·cos(xy) + 2y)dy = 0. Is it exact?
Integrating Factor
Equation not exact? Multiply both sides by a function $\mu(x,y)$ to **make** it exact. Such a function is called an **integrating factor**. The idea of transforming by multiplication is the same as gauge invariance in quantum electrodynamics.
Finding $\mu$ in general is as hard as solving the original equation. But two special cases always work: if $(\partial M/\partial y - \partial N/\partial x)/N$ depends only on $x$ - then $\mu = \mu(x)$; if $(\partial N/\partial x - \partial M/\partial y)/M$ depends only on $y$ - then $\mu = \mu(y)$.
| Condition | Type of mu | Formula |
|---|---|---|
| (∂M/∂y - ∂N/∂x)/N depends only on x | mu(x) | exp(∫[(∂M/∂y - ∂N/∂x)/N] dx) |
| (∂N/∂x - ∂M/∂y)/M depends only on y | mu(y) | exp(∫[(∂N/∂x - ∂M/∂y)/M] dy) |
| Neither condition holds | mu(x,y) | No general method |
**Connection to linear ODEs:** for y' + P(x)y = Q(x) the integrating factor mu(x) = exp(∫P(x)dx) is exactly the same technique. The linear ODE is a special case.
Multiplying by the right function turns a hard problem into an easy one. Neural ODE (Chen et al., 2018) uses the same idea: scaling activations makes backpropagation through a continuous layer computable.
Four methods - four keys for different locks. Separation of variables: $dy/dt = ky$, exponential growth. Linear with integrating factor: RC circuits, pharmacokinetics. Exact: conservative fields. Integrating factor: everything else from the two special cases. Falcon 9 fits none - hence 4th-order Runge-Kutta.
All first-order ODEs can be solved analytically
The vast majority of ODEs have NO closed-form solution in elementary functions. Even the simple y' = e^(x²) cannot be expressed through standard functions.
The four methods (separation, linear, exact, integrating factor) cover only a tiny fraction of all possible ODEs. For the rest: numerical methods (Runge-Kutta), power series, special functions (Bessel, Airy), and qualitative analysis (phase portraits) are used.
Equation y dx - x dy = 0. Which integrating factor makes it exact?
Key Ideas
- **Separable:** $dy/dx = f(x)g(y)$ - separate and integrate (watch for equilibrium solutions where $g(y)=0$)
- **Linear:** $y' + P(x)y = Q(x)$ - integrating factor $e^{\int P\,dx}$ always works. RC circuits, pharmacokinetics, Newton's law of cooling
- **Exact:** $M\,dx + N\,dy = 0$ when $\partial M/\partial y = \partial N/\partial x$ - find the potential $F(x,y) = C$. Conservative fields in physics
- **Integrating factor:** turns a non-exact equation exact. Same idea as gauge invariance in quantum electrodynamics
- **Newton 1671 $\to$ Falcon 9 2024**: one equation $dy/dt = ky$, 350 years - from manuscript to a rocket landing on a ship at sea
Related Topics
First-order ODEs are the foundation for everything that follows:
- Second-Order ODEs — The next step: oscillations, waves, resonance - requires a second derivative. Car suspension, quantum harmonic oscillator
- Systems of ODEs — An $n$th-order ODE reduces to a system of $n$ first-order equations. Exactly the form Falcon 9 solves
Вопросы для размышления
- The equation $dy/dx = y^2$ blows up in finite time for $y(0) = 1$. Can the linear equation $y' = P(x)y$ blow up? What fundamentally changes with nonlinearity?
- Neural ODE (2018) replaces ResNet layers with a continuous ODE $dh/dt = f(h,t)$. Which of the four methods in this lesson is closest to what happens during backpropagation through such a network?
- Falcon 9 uses 4th-order Runge-Kutta instead of an analytical solution. Why? When is an analytical ODE solution more valuable than a numerical one?