Ordinary differential equations
Classifying differential equations, separable and first-order linear equations with an integrating factor, Bernoulli equations, second-order linear equations with constant coefficients, initial conditions and economic models.
Course notes: Course lectures on differential equations · Exercise sessions: Lecture exercises, exam problems · About 60 minutes
Classifying a differential equationImportant
A differential equation links an unknown function with its derivatives. Exams ask to classify along four axes, and even to invent an equation of a given type:
| Axis | Options | How to decide |
|---|---|---|
| Type | ordinary (ODE) or partial (PDE) | one independent variable (y′, y′′) or several (partial derivatives) |
| Order | 1, 2, ... | the highest derivative that appears |
| Linearity | linear or non-linear | linear when y and its derivatives appear only to the first power, not multiplied together, not inside other functions |
| Homogeneity | homogeneous or heterogeneous | homogeneous when every term contains y or a derivative of y (so y = 0 is a solution); a term with only x or a constant makes it heterogeneous |
Four classifications
Classify each equation.
y′′ + 3y′ − 4y = ex
y′ = y2 sin x
∂u/∂t = ∂2u/∂x2
y′′′ + y y′ = 5
An invented example of a second-order, heterogeneous, non-linear ODE: y′′ + y2 = x.
A general solution contains as many free constants as the order; initial conditions (y(0), y′(0), ...) or boundary conditions fix them and give a particular solution.
Separable equationsImportant
A first-order equation is separable when it can be written dy/dx = g(x) h(y). Move all y to one side and all x to the other and integrate:
Exponential growth with a twist
y′ = 2xy with y(0) = 3.
Separate
Integrate
Initial condition
y = 3ex2. Dividing by h(y) loses the constant solutions with h(y) = 0 (here y = 0); check them separately.
A second separable equation
y′ = x / y with y(0) = 2.
Separate
Integrate
Solve for y
y = √(x2 + 4).
First-order linear equationsImportant
A first-order linear equation has the standard form y′ + a(x) y = b(x). Multiply by the integrating factor μ(x) = e∫a(x) dx: the left side becomes (μ y)′, so
Constant coefficients
y′ + 2y = 6 with y(0) = 1.
Integrating factor
Integrate
Initial condition
y = 3 − 2e−2x, which tends to the equilibrium y = 3. Here yh = Ce−2x solves the homogeneous equation and yp = 3 is a particular solution.
A variable coefficient
y′ + y / x = x2 for x > 0.
Integrating factor
Integrate
y = x3/4 + C/x.
Bernoulli equationsNeutral
A Bernoulli equation y′ + p(x) y = q(x) yn (n ≠ 0, 1) is non-linear, but the substitution v = y1−n turns it into a linear equation for v: v′ + (1 − n) p v = (1 − n) q.
A logistic-type equation
y′ − y = −y2 with y(0) = 1/2.
Substitution
Linear equation for v
Solve
y = 1 / (1 + e−x): an S-curve that grows from 1/2 towards the saturation level 1.
Second-order linear equations with constant coefficientsImportant
For a y′′ + b y′ + c y = 0 try y = erx: this works when r solves the characteristic equation a r2 + b r + c = 0.
| Roots of a r2 + b r + c = 0 | General solution of the homogeneous equation |
|---|---|
| two distinct real roots r1, r2 | y = C1er1x + C2er2x |
| one repeated root r | y = (C1 + C2x) erx |
| complex roots α ± βi (background) | y = eαx(C1 cos βx + C2 sin βx) |
For a heterogeneous equation a y′′ + b y′ + c y = f(x), the solution is y = yh + yp. Find yp by undetermined coefficients: for a constant try a constant, for a polynomial a polynomial of the same degree, for kemx try Aemx (multiply by x if m is a characteristic root). Fit the constants C1, C2 to the initial conditions only after adding yp.
Distinct roots with a constant right side
y′′ − y′ − 6y = 12 with y(0) = 0 and y′(0) = 5.
Characteristic equation
Particular solution
Initial conditions
Solve
y = (9/5)e3x + (1/5)e−2x − 2.
A repeated root
y′′ + 4y′ + 4y = 0 with y(0) = 1 and y′(0) = 0.
Characteristic equation
General solution
Fit
y = (1 + 2x)e−2x.
Undetermined coefficients with an exponential
y′′ − 3y′ + 2y = 4e3x.
Homogeneous part
Try yp = Ae3x
y = C1ex + C2e2x + 2e3x.
Economic modelsImportant
| Situation | Equation | Solution |
|---|---|---|
| continuous growth at rate r | A′ = rA | A = A0ert |
| fund with constant withdrawal w (or deposit −w) | A′ = rA − w | A = w/r + (A0 − w/r)ert |
| price adjusting to excess demand | p′ = k(D(p) − S(p)) | p tends to the equilibrium price when k > 0 |
| adoption with saturation | y′ = ky(1 − y/M) | logistic S-curve towards M |
Retirement fund with withdrawals
A fund of 200,000 earns 4% per year (continuous) and pays out 12,000 per year. When is it empty?
Equation
Equilibrium
Solution
Empty
The fund lasts about 27.5 years. With a start above 300,000 it would grow forever; exactly 300,000 keeps it constant.
Key takeaways
- Classify by type (ODE or PDE), order, linearity and homogeneity.
- Separable: separate and integrate; do not forget constant solutions.
- Linear first order: integrating factor μ = e∫a.
- Bernoulli: v = y1−n makes it linear.
- Constant coefficients: roots of the characteristic equation; repeated root gives (C1 + C2x)erx.
- Heterogeneous: y = yh + yp, then fit the initial conditions.
True or false (5)
y′′ + x2y = 0 is linear.
y′ + y2 = 0 is linear.
y′ = xy is separable.
y′′ − 4y = 0 has general solution C1e2x + C2e−2x.
y′ + 3y = 7 is homogeneous.
Multiple choice (7)
The order and linearity of y′′′ + (y′)2 = 0 are...
The solution of y′ = −3y, y(0) = 4 is...
The integrating factor of y′ + 2xy = x is...
The characteristic roots of y′′ + 2y′ − 8y = 0 are...
A particular solution of y′′ + y′ − 2y = 6 is...
The equilibrium of A′ = 0.05A − 1000 is...
Which equation is a Bernoulli equation?
Exam-style open questions (3)
Classify and solve
Consider y′′ + 2y′ − 3y = 9. Classify it, give the general solution and fit y(0) = 0, y′(0) = 4.
Show a model answer outline
- ODE, order 2, linear, heterogeneous.
- r2 + 2r − 3 = (r − 1)(r + 3): yh = C1ex + C2e−3x; yp = −3.
- C1 + C2 = 3 and C1 − 3C2 = 4: C2 = −1/4, C1 = 13/4.
- y = (13/4)ex − (1/4)e−3x − 3.
Integrating factor
Solve y′ − y = e2x with y(0) = 3.
Show a model answer outline
- μ = e−x: (y e−x)′ = ex.
- y e−x = ex + C, so y = e2x + Cex.
- y(0) = 1 + C = 3: y = e2x + 2ex.
Invent equations
Write down (a) a first-order, separable, non-linear ODE and (b) a second-order, linear, homogeneous ODE with a repeated characteristic root, and solve (b).
Show a model answer outline
- (a) For example y′ = x y2.
- (b) For example y′′ − 6y′ + 9y = 0: r2 − 6r + 9 = (r − 3)2.
- Solution of (b): y = (C1 + C2x)e3x.
LabFirst-order models lab
Change the start value of the fund around w/r and watch the verdict switch.
LabSecond-order lab
Try p = 4, q = 4 for a repeated root.
LabNumerical solver (Runge-Kutta)
Type your own solution in the comparison box to check it.
LabClassify the equation
Read every term: powers, products and functions of y make it non-linear.