hanegreefs.com/Math II
Chapter 11 · unit 11 of 12

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:

AxisOptionsHow to decide
Typeordinary (ODE) or partial (PDE)one independent variable (y′, y′′) or several (partial derivatives)
Order1, 2, ...the highest derivative that appears
Linearitylinear or non-linearlinear when y and its derivatives appear only to the first power, not multiplied together, not inside other functions
Homogeneityhomogeneous or heterogeneoushomogeneous 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
Worked example

Four classifications

Classify each equation.

1

y′′ + 3y′ − 4y = ex

ODE, order 2, linear, heterogeneous (the term ex)
2

y′ = y2 sin x

ODE, order 1, non-linear (y2), homogeneous
3

∂u/∂t = ∂2u/∂x2

PDE, order 2, linear, homogeneous
4

y′′′ + y y′ = 5

ODE, order 3, non-linear (the product y y′), heterogeneous
Answer

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:

Formula
∫ dyh(y) = ∫ g(x) dx + C
Worked example

Exponential growth with a twist

y′ = 2xy with y(0) = 3.

1

Separate

dy / y = 2x dx
2

Integrate

ln|y| = x2 + C, so y = K ex2
3

Initial condition

y(0) = K = 3
Answer

y = 3ex2. Dividing by h(y) loses the constant solutions with h(y) = 0 (here y = 0); check them separately.

Worked example

A second separable equation

y′ = x / y with y(0) = 2.

1

Separate

y dy = x dx
2

Integrate

y2/2 = x2/2 + C; y(0) = 2 gives C = 2
3

Solve for y

y2 = x2 + 4 and y > 0 near x = 0
Answer

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

Formula
y = 1μ(x) ( ∫ μ(x) b(x) dx + C )
Worked example

Constant coefficients

y′ + 2y = 6 with y(0) = 1.

1

Integrating factor

μ = e2x, and (y e2x)′ = 6e2x
2

Integrate

y e2x = 3e2x + C, so y = 3 + C e−2x
3

Initial condition

1 = 3 + C gives C = −2
Answer

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.

Worked example

A variable coefficient

y′ + y / x = x2 for x > 0.

1

Integrating factor

μ = eln x = x, so (xy)′ = x3
2

Integrate

xy = x4/4 + C
Answer

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.

Worked example

A logistic-type equation

y′ − y = −y2 with y(0) = 1/2.

1

Substitution

n = 2, so v = 1/y and v′ = −y′/y2
2

Linear equation for v

divide by −y2: v′ + v = 1
3

Solve

v = 1 + C e−x; v(0) = 2 gives C = 1
Answer

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 = 0General solution of the homogeneous equation
two distinct real roots r1, r2y = C1er1x + C2er2x
one repeated root ry = (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.

Worked example

Distinct roots with a constant right side

y′′ − y′ − 6y = 12 with y(0) = 0 and y′(0) = 5.

1

Characteristic equation

r2 − r − 6 = (r − 3)(r + 2) = 0, so yh = C1e3x + C2e−2x
2

Particular solution

try yp = A: −6A = 12, so A = −2
3

Initial conditions

C1 + C2 − 2 = 0 and 3C1 − 2C2 = 5
4

Solve

C1 = 9/5, C2 = 1/5
Answer

y = (9/5)e3x + (1/5)e−2x − 2.

Worked example

A repeated root

y′′ + 4y′ + 4y = 0 with y(0) = 1 and y′(0) = 0.

1

Characteristic equation

(r + 2)2 = 0: r = −2 twice
2

General solution

y = (C1 + C2x)e−2x
3

Fit

y(0) = C1 = 1; y′(0) = C2 − 2C1 = 0 gives C2 = 2
Answer

y = (1 + 2x)e−2x.

Worked example

Undetermined coefficients with an exponential

y′′ − 3y′ + 2y = 4e3x.

1

Homogeneous part

r2 − 3r + 2 = (r − 1)(r − 2): yh = C1ex + C2e2x
2

Try yp = Ae3x

9A − 9A + 2A = 4, so A = 2 (3 is not a root, no extra x needed)
Answer

y = C1ex + C2e2x + 2e3x.

Economic modelsImportant

SituationEquationSolution
continuous growth at rate rA′ = rAA = A0ert
fund with constant withdrawal w (or deposit −w)A′ = rA − wA = w/r + (A0 − w/r)ert
price adjusting to excess demandp′ = k(D(p) − S(p))p tends to the equilibrium price when k > 0
adoption with saturationy′ = ky(1 − y/M)logistic S-curve towards M
Worked example

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?

1

Equation

A′ = 0.04A − 12,000 with A(0) = 200,000
2

Equilibrium

w/r = 12,000 / 0.04 = 300,000, larger than the start, so the fund shrinks
3

Solution

A(t) = 300,000 − 100,000 e0.04t
4

Empty

e0.04t = 3, so t = ln 3 / 0.04 ≈ 27.5 years
Answer

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.

Loading cards
Question
Click, tap or press space to flip
Answer

True or false (5)

Statement 1 · Chapter 11 · true or false

y′′ + x2y = 0 is linear.

Why: x2 is only a coefficient; y appears to the first power.
Statement 2 · Chapter 11 · true or false

y′ + y2 = 0 is linear.

Why: y2 makes it non-linear.
Statement 3 · Chapter 11 · true or false

y′ = xy is separable.

Why: g(x) = x and h(y) = y.
Statement 4 · Chapter 11 · true or false

y′′ − 4y = 0 has general solution C1e2x + C2e−2x.

Why: r2 = 4 gives r = ±2.
Statement 5 · Chapter 11 · true or false

y′ + 3y = 7 is homogeneous.

Why: The constant 7 is a term without y.

Multiple choice (7)

Question 1 · Chapter 11

The order and linearity of y′′′ + (y′)2 = 0 are...

Why: Highest derivative y′′′; (y′)2 is non-linear.
Question 2 · Chapter 11

The solution of y′ = −3y, y(0) = 4 is...

Why: Exponential decay.
Question 3 · Chapter 11

The integrating factor of y′ + 2xy = x is...

Why: ∫2x dx = x2.
Question 4 · Chapter 11

The characteristic roots of y′′ + 2y′ − 8y = 0 are...

Why: r2 + 2r − 8 = (r − 2)(r + 4).
Question 5 · Chapter 11

A particular solution of y′′ + y′ − 2y = 6 is...

Why: −2A = 6.
Question 6 · Chapter 11

The equilibrium of A′ = 0.05A − 1000 is...

Why: A′ = 0 gives A = 1000 / 0.05.
Question 7 · Chapter 11

Which equation is a Bernoulli equation?

Why: A power yn with n = 3 on the right.

Exam-style open questions (3)

Open question · Chapter 11

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.
Open question · Chapter 11

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.
Open question · Chapter 11

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.