eleven9Silicon
Ordinary Differential Equations
A first-principles reconstruction — from slopes to systems
Chapter 01 — Foundation

What Is an ODE, Really?

Before any formula, ask the physical question: what does it mean to "describe how something changes"? That's the whole job of a differential equation. Not a formula for where something is — a rule for where it's going.

Core Intuition
An ODE is a local rule. At every instant, it tells you the slope of the unknown function. It does not tell you the function itself — that's what solving is for.

The most general first-order ODE looks like:

\[ \frac{dy}{dx} = F(x,\, y) \]

Read this as: "the slope of \(y\) at position \(x\), given current value \(y\), is exactly \(F(x, y)\)." Notice \(F\) can depend on both \(x\) and \(y\). That's what makes ODEs rich — the slope of the curve can depend on where the curve currently is.

The word ordinary just means there is only one independent variable (here, \(x\) or \(t\)). When you have multiple independent variables you get partial differential equations — a separate story.

The Slope Pipeline

Here's the conceptual assembly line that connects raw data to a solved function:

01
Data / Physics
Observations or laws that govern how things change.
02
Rate Rule
Express the slope as a function. This is the ODE.
03
Integrate
Recover the function from the slope rule + one anchor point.
04
Solution
A family of curves — pinned down by initial conditions.
Chapter 02 — Geometric Core

Slopes as Geometry

A derivative is just the slope of a tangent line at a point. When you write \(\frac{dy}{dx} = 2x\), you are painting a rule: at every point \((x, y)\), the tangent to the solution must have slope \(2x\).

Think of it like a vector field of arrows. Each arrow points in the direction the solution curve must travel when it passes through that location. The solution curve is the one that stays tangent to every arrow it touches.

Geometric Insight
Solving an ODE geometrically = drawing a curve that always follows the local arrows. That curve is an integral curve (also called a solution curve or trajectory).

The Tangent Line as a Local Approximation

The derivative gives us the best linear approximation of the function near any point. If at \(x_0\) the function value is \(y_0\), and the ODE says the slope is \(m = F(x_0, y_0)\), then locally:

\[ y \approx y_0 + m\,(x - x_0) \]

This is Euler's method in disguise — step forward a tiny bit using the local slope, re-evaluate the slope, step again. That's how computers numerically integrate ODEs. Each step says: "right now the slope is this, so let me walk a tiny bit in that direction."

Chapter 03 — Interactive Visualization

Slope Fields — The ODE Made Visible

A slope field (or direction field) is the geometric heart of any first-order ODE. At a grid of points \((x, y)\), we draw a short tick mark whose angle matches the slope \(F(x, y)\) dictated by the ODE. Solution curves must stay tangent to these marks everywhere they pass.

Slope Field Explorer
dy/dx = x

Click anywhere on the field to draw a solution curve through that point (Euler's method, 500 steps).

Notice something crucial: no matter what ODE you choose, you see a family of non-crossing curves. Each click seeds a different initial condition — the curve is uniquely determined once you pick a starting point. This is the Existence and Uniqueness theorem made visual.

Why Curves Never Cross
If two solution curves shared a point, the ODE would have to assign two different slopes at that point simultaneously — a contradiction. So (under mild smoothness conditions on \(F\)) solutions are unique and therefore never intersect.
Chapter 04 — The Reconstruction

Integration: Rebuilding the Function from Its Slopes

Differentiation destroys information — specifically, it destroys the constant in a function. Both \(t^2\) and \(t^2 + 7\) have derivative \(2t\). Integration reverses differentiation, but it can't recover what was destroyed without help. That help is the initial condition.

Why \(\int\) is the Inverse of \(\frac{d}{dt}\)

The Fundamental Theorem of Calculus says exactly this. If \(\frac{dr}{dt} = g(t)\), then:

\[ r(t) = r(t_0) + \int_{t_0}^{t} g(\tau)\, d\tau \]

This integral accumulates all the tiny slope \(\times\) time contributions from \(t_0\) to \(t\). Each infinitesimal \(g(\tau)\,d\tau\) is a tiny nudge — integration sums them all up to get the total displacement in \(r\).

Physical Reading
If \(g(\tau)\) is velocity, then \(\int g\,d\tau\) is displacement — area under the velocity curve equals distance traveled. The ODE \(\frac{dr}{dt} = g(t)\) is just saying "velocity is \(g(t)\)."

Step-by-step: Solving \(\frac{dr}{dt} = 2t\)

Step 1 — Separate variables. Move all \(r\)-stuff left, all \(t\)-stuff right:

\[ dr = 2t\, dt \]

Step 2 — Integrate both sides. The left side integrates trivially (the antiderivative of \(dr\) is just \(r\)):

\[ \int dr = \int 2t\, dt \] \[ r = t^2 + C \]

Step 3 — Apply initial condition. Suppose \(r(0) = 3\):

\[ 3 = 0^2 + C \quad \Rightarrow \quad C = 3 \] \[ \boxed{r(t) = t^2 + 3} \]

The \(+C\) encodes the entire family of solutions. The initial condition selects exactly one member of that family. Think of the family as a stack of identical curves shifted vertically — the initial condition pins down which level you live on.

Riemann Accumulation — Visualizing the Integral

Gold bars = Riemann sum approximation of \(\int_0^T g(t)\,dt\). As subdivisions → ∞, the sum → exact area → exact solution.

Chapter 05 — Pinning the Solution

Initial Conditions: Selecting One Curve from the Family

Every first-order ODE has infinitely many solutions — one for every value of the constant \(C\). An initial condition is a single data point that tells us which solution we're in.

For \(\frac{dy}{dx} = -y\), the general solution is:

\[ y(x) = C e^{-x} \]

Every choice of \(C\) gives a valid exponential decay. Specifying \(y(0) = 2\) forces \(C = 2\). The table below shows how the solution changes with the initial condition:

Initial Condition \(y(0)\)Constant \(C\)Solution
\(-3\)\(-3\)\(y = -3e^{-x}\)
\(0\)\(0\)\(y = 0\) (trivial/equilibrium)
\(1\)\(1\)\(y = e^{-x}\)
\(2\)\(2\)\(y = 2e^{-x}\)
\(5\)\(5\)\(y = 5e^{-x}\)
Deep Structural Point
For an \(n\)th-order ODE, you need exactly \(n\) initial conditions to pin the solution uniquely. A 1st-order ODE needs 1 condition (the starting value). A 2nd-order ODE needs 2 (starting value and starting velocity — think Newton's second law).
Solution Family for dy/dx = −y
Chapter 06 — Types and Structures

The ODE Zoo: Common Forms and Their Physics

Different structures of \(F(x, y)\) give very different behaviors. Here are the canonical first-order ODEs every engineer must recognize on sight:

1 — Separable: \(\frac{dy}{dx} = g(x)\cdot h(y)\)

Variables can be cleanly separated to opposite sides. The slope factors into a part that depends only on \(x\) and a part only on \(y\):

\[ \frac{dy}{h(y)} = g(x)\, dx \quad \Rightarrow \quad \int \frac{dy}{h(y)} = \int g(x)\, dx \]

Example: \(\frac{dy}{dx} = xy\) separates to \(\frac{dy}{y} = x\,dx \Rightarrow \ln|y| = \frac{x^2}{2} + C \Rightarrow y = Ae^{x^2/2}\). This governs Gaussian distributions.

2 — Linear: \(\frac{dy}{dx} + P(x)\,y = Q(x)\)

The unknown \(y\) appears to the first power only. Solved with an integrating factor \(\mu(x) = e^{\int P(x)\,dx}\), which transforms the left side into an exact derivative:

\[ \frac{d}{dx}\left[\mu(x)\, y\right] = \mu(x)\, Q(x) \]

RC circuit equation: \(\frac{dV}{dt} + \frac{1}{RC}V = \frac{V_s}{RC}\) is exactly this form. The integrating factor is \(e^{t/RC}\).

3 — Autonomous: \(\frac{dy}{dt} = F(y)\)

The slope depends only on the current value \(y\), not on time \(t\) explicitly. Population dynamics, radioactive decay, RC circuits with no driving signal — all autonomous. Equilibria exist where \(F(y^*) = 0\); stability depends on the sign of \(F'(y^*)\).

\[ F'(y^*) < 0 \Rightarrow \text{stable equilibrium} \qquad F'(y^*) > 0 \Rightarrow \text{unstable equilibrium} \]

4 — Exact: \(M\,dx + N\,dy = 0\) with \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\)

The ODE hides a potential function \(\Phi(x,y)\) such that \(d\Phi = 0\). The solution is simply \(\Phi(x,y) = C\) — a level curve. This connects ODEs to conservative vector fields from Physics 2.

Connection to E&M
When \(\vec{E} = -\nabla V\), the electric potential \(V\) satisfies an exact condition. Equipotential surfaces are exactly the level curves \(\Phi(x,y,z) = C\) from the exact-ODE framework, extended to 3D.
Chapter 07 — Autonomous Systems

Phase Line: Stability Without Solving

For an autonomous ODE \(\frac{dy}{dt} = F(y)\), you can understand the behavior of solutions without integrating at all, just by analyzing \(F(y)\).

Plot \(F(y)\) vs \(y\). Wherever \(F(y) > 0\), solutions move upward (increasing \(y\)). Wherever \(F(y) < 0\), solutions move downward. Wherever \(F(y) = 0\), solutions freeze — these are equilibria.

Stability Rule
At an equilibrium \(y^*\): if \(F\) crosses from positive to negative (downward crossing), it is stable — nearby solutions are attracted. If \(F\) crosses from negative to positive (upward crossing), it is unstable — nearby solutions flee.
Phase Line Analyzer — dy/dt = F(y)

Left panel: \(F(y)\) vs \(y\). Right panel: solution curves \(y(t)\) starting from different initial values. Green dots = stable equilibria. Red dots = unstable equilibria.

Chapter 08 — Euler's Method Lab

Euler's Method: Numerical ODE Solving from Scratch

Euler's method is the most direct translation of the ODE definition into an algorithm. If \(\frac{dy}{dx} = F(x, y)\) and we know \(y_0 = y(x_0)\), we step forward:

\[ y_{n+1} = y_n + F(x_n,\, y_n)\cdot \Delta x \]

At each step: evaluate the slope at the current point, walk a tiny distance \(\Delta x\) in that direction, repeat. This is just the tangent-line approximation applied over and over.

The error per step is \(\mathcal{O}(\Delta x^2)\), and the global error over a fixed interval is \(\mathcal{O}(\Delta x)\) — so halving the step size halves the error. Better methods (Runge-Kutta) get \(\mathcal{O}(\Delta x^4)\) error.

Euler's Method vs Exact Solution

Teal = Euler approximation. Gold = exact solution. Watch the error shrink as step count increases.