LeoMath

Introduction to differential equations

What is an ODE

Describing change through derivatives; existence and uniqueness of solutions.

about 8 min

Start from a problem

Problem

A cup of hot water cools on a table. We do not know the temperature function T(t)T(t); we only know the law of its change: it cools at a rate proportional to how far it is above room temperature.

Many laws of nature come this way: not the quantity itself, but a relation between its rate of change and its value. We need a mathematical object to express such laws, and a way to recover the function from the law.

Observe

A cup of hot water sits on a table. It does not cool at a constant rate: fast while hot, slowly as it nears room temperature. We do not know the temperature as a function of time, T(t)T(t), but we do know the law of its change:

T′(t)=−k (T(t)−Troom).T'(t)=-k\,\bigl(T(t)-T_{\text{room}}\bigr).

In the experiment below choose "Exponential growth", make kk negative and vary the initial value. What you see are solutions of this kind of equation.

Interactive experimentNumerical ODE explorer
Equation
y′=k yy' = k\,y
Time series
Method exactEuler error at end: 5.5336RK4 error at end: 0.0016
Conjecture

Many natural laws do not hand us the quantity itself but a relation between its rate of change and its value. Such a relation is an equation containing an unknown function and its derivatives. If we can recover the function from the equation, we can predict the future.

Definitions

Definition 1.1Ordinary differential equation

An ordinary differential equation (ODE) of order nn is an equation F(t, y, y′, y′′,…,y(n))=0F\bigl(t,\,y,\,y',\,y'',\dots,y^{(n)}\bigr)=0 for an unknown function y=y(t)y=y(t) of one variable. The order is the highest derivative that appears. If it can be solved for that derivative, y(n)=f(t,y,…,y(n−1))y^{(n)}=f(t,y,\dots,y^{(n-1)}), the equation is explicit.

Definition 1.2Solution and initial value problem

A function φ\varphi on an interval II is a solution if substituting y=φ(t)y=\varphi(t) makes the equation hold for every t∈It\in I. An initial value problem adds y(t0)=y0y(t_0)=y_0 (for order nn, the values of y,y′,…,y(n−1)y,y',\dots,y^{(n-1)} at t0t_0).

Definition 1.3Linear equation

If the equation can be written an(t)y(n)+⋯+a1(t)y′+a0(t)y=g(t)a_n(t)y^{(n)}+\cdots+a_1(t)y'+a_0(t)y=g(t), so that yy and its derivatives appear only to the first power and never multiplied together, it is linear; if g≡0g\equiv0 it is homogeneous.

y′′′+y y′=sin⁡ty'''+y\,y'=\sin t is third order and nonlinear (because of y y′y\,y'). Order and linearity are independent attributes.

Derivation: the simplest equation

Proposition 1.1

The solutions of y′=kyy'=ky are exactly y=Cekty=Ce^{kt}, C∈RC\in\mathbb R.

Proof

CektCe^{kt} is a solution by direct differentiation. Conversely let yy be any solution and set u(t)=y(t)e−ktu(t)=y(t)e^{-kt}. Then u′=y′e−kt−ky e−kt=(y′−ky)e−kt=0,u'=y'e^{-kt}-ky\,e^{-kt}=(y'-ky)e^{-kt}=0, so uu is a constant CC and y=Cekty=Ce^{kt}.

We used the central fact (ekt)′=kekt(e^{kt})'=ke^{kt} from The derivative, and that a function with zero derivative is constant (a corollary of the mean value theorem). The initial condition y(0)=y0y(0)=y_0 fixes C=y0C=y_0.

Back to the cooling cup: with u=T−Troomu=T-T_{\text{room}}, u′=−kuu'=-ku, so u=u0e−ktu=u_0e^{-kt} and T(t)=Troom+(T0−Troom)e−kt.T(t)=T_{\text{room}}+(T_0-T_{\text{room}})e^{-kt}.

Existence and uniqueness

An equation only states a law. Must it have a solution? Is the solution unique? These questions decide whether "predicting the future with a differential equation" is legitimate.

Theorem 1.2Picard–Lindelöf

Let f(t,y)f(t,y) be continuous on the rectangle R={∣t−t0∣≤a, ∣y−y0∣≤b}R=\{|t-t_0|\le a,\ |y-y_0|\le b\} and Lipschitz in yy: there is LL with ∣f(t,y1)−f(t,y2)∣≤L∣y1−y2∣|f(t,y_1)-f(t,y_2)|\le L|y_1-y_2|. Then the initial value problem y′=f(t,y), y(t0)=y0y'=f(t,y),\ y(t_0)=y_0 has a unique solution on some neighbourhood of t0t_0.

Proof

We prove uniqueness, which shows what the Lipschitz condition is for. Let φ,ψ\varphi,\psi be solutions and w(t)=∣φ(t)−ψ(t)∣w(t)=|\varphi(t)-\psi(t)|. Integrating the equation (see The integral) gives φ(t)=y0+∫t0tf(s,φ(s)) ds\varphi(t)=y_0+\int_{t_0}^tf(s,\varphi(s))\,ds and likewise for ψ\psi, so for t≥t0t\ge t_0 w(t)≤∫t0t∣f(s,φ)−f(s,ψ)∣ ds≤L∫t0tw(s) ds.w(t)\le\int_{t_0}^t|f(s,\varphi)-f(s,\psi)|\,ds\le L\int_{t_0}^tw(s)\,ds. Let W(t)=∫t0twW(t)=\int_{t_0}^tw. Then W′≤LWW'\le LW and W(t0)=0W(t_0)=0, so (We−Lt)′=(W′−LW)e−Lt≤0(We^{-Lt})'=(W'-LW)e^{-Lt}\le0: We−LtWe^{-Lt} is non-increasing, starts at 00 and is non-negative, hence W≡0W\equiv0 and w≡0w\equiv0.

Existence is obtained by Picard iteration φn+1(t)=y0+∫t0tf(s,φn(s)) ds\varphi_{n+1}(t)=y_0+\int_{t_0}^tf(s,\varphi_n(s))\,ds and a uniform convergence argument; this is one of the roots of Numerical solutions.

Example 1.1Uniqueness fails without Lipschitz

y′=2∣y∣, y(0)=0y'=2\sqrt{|y|},\ y(0)=0. Both y≡0y\equiv0 and y=t2y=t^2 (for t≥0t\ge0) are solutions. f(y)=2∣y∣f(y)=2\sqrt{|y|} is not Lipschitz near y=0y=0.

Common mistake

The general solution of y′=kyy'=ky is CektCe^{kt}, not ekt+Ce^{kt}+C. Where the constant goes is dictated by the derivation: here CC comes from "ye−ktye^{-kt} is constant". Also, the existence–uniqueness theorem guarantees only a local solution; the solution of y′=y2y'=y^2 blows up at t=1t=1.

Application

ApplicationSolutions need not live forever

y′=y2, y(0)=1y'=y^2,\ y(0)=1 satisfies the theorem and has the unique local solution y=11−ty=\dfrac1{1-t}, which blows up at t=1t=1. The theorem guarantees a local solution. This is the first exercise of First-order equations.

Remark

Three levels of working with differential equations: modelling (writing the law), solving (finding the function), analysis (knowing things without solving). Existence and uniqueness belongs to the third level: under broad conditions, the present state completely determines the future. This is the mathematical form of Newtonian determinism.

Exercises

01
Solve y′=2y, y(0)=3y'=2y,\ y(0)=3 and give y(1)y(1) to two decimals.
02
What is the order of y′′′+y y′=sin⁡ty'''+y\,y'=\sin t?