Primer on Ordinary Differential Equations
Table of Contents
What is an ODE?
F(t,y,y′(t),y′′(t),…,y(n)(t))=0
Where:
- t is the independent variable (often time)
- y is the dependent variable (the function we want to solve for)
- y′(t) is the first derivative of y with respect to t
- y′′(t) is the second derivative of y with respect to t
- y(t)(n) is the n-th derivative of y with respect to t
- F is a function that relates these variables
The order is the highest derivative in the ODE. The degree is the exponent
of the highest-order derivative (after clearing fractions/roots, only defined for polynomial ODEs). It is linear if
the function and its derivatives appear to power 1, with no products. It is homogeneous
if RHS = 0; otherwise non-homogeneous. The initial conditions are function/derivative
values at a point for a unique solution.
Methods of Solving Analytically
Separation of Variables
For first-order ODEs of the form:
dtdy=g(t)h(y)
Rearranging gives:
h(y)1dy=g(t)dt
Integrating both sides:
∫h(y)1dy=∫g(t)dt
Example:
dtdy=ky
y1dy=kdt
ln∣y∣=kt+C
y=Cekt
Integrating Factors
For first-order linear ODEs of the form:
dtdy+P(t)y=Q(t)
Multiply by the integrating factor:
μ(t)=e∫P(t)dt
Then:
dtd(μ(t)y)=μ(t)Q(t)
Integrate both sides:
∫dtd(μ(t)y)dt=∫μ(t)Q(t)dt
μ(t)y=∫μ(t)Q(t)dt+C
y=μ(t)1(∫μ(t)Q(t)dt+C)
Characteristic Equation
For linear ODEs with constant coefficients, such as:
any(n)+an−1y(n−1)+…+a1y′+a0y=0
Assume a solution of the form:
y(t)=ert
Substituting into the ODE gives the characteristic equation:
anrn+an−1rn−1+…+a1r+a0=0
Solve for r to find the roots. The general solution depends on the nature of the roots:
y(t)=C1er1t+C2er2t+…+Cnernt
y(t)=(C1+C2t+…+Cntn−1)ert
y(t)=eαt(C1cos(βt)+C2sin(βt))
Where r=α+iβ are the complex roots.
Methods of Solving Numerically
Euler's Method
For first-order ODEs of the form:
dtdy=f(t,y)
- Choose a step size h and initial condition y(t0)=y0.
- Compute the next value:
y(t0+h)=y0+hf(t0,y0)
- Repeat for subsequent points:
y(tn+1)=yn+hf(tn,yn)
- Continue until the desired range is covered.
Workflow
First Order ODEs
- Check if separable:
- If yes → separate and integrate.
- If no → check if linear:
- If yes → use integrating factors.
- If no → check if exact:
- If yes → solve as exact.
- If no → check if homogeneous:
- If yes → try substitution.
- If no → use numerical methods.