Differential equations

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Differential equations: solutions and equilibria

Warm-up

Three quick questions from earlier lessons.

Discover

A differential equation links a function with its derivatives. Is y=e2xy = e^{2x} a solution of y′=2yy' = 2y?

  1. Yes
  2. No

Key idea

A solution is a function, not a number.

A differential equation relates yy, its derivatives and the variable. A function is a solution if substituting it makes both sides equal for every xx. A constant solution y=cy = c (an equilibrium) has y′=0y' = 0.

Worked example

Find the equilibrium of dydt=3(y−5)\dfrac{dy}{dt} = 3(y - 5), and check y=5+2e3ty = 5 + 2e^{3t}.

3(y−5)=0⇒y=53(y - 5) = 0 \Rightarrow y = 5
Constant solution: y' = 0.
y′=6e3ty' = 6e^{3t}
Differentiate the proposed solution.
It is a solution
Right side: 3(2e^{3t}) = 6e^{3t}. Equal.

Your turn, guided

Your turn: the equilibrium of dydt=2(4−y)\dfrac{dy}{dt} = 2(4 - y).

y=4y = 4
Set 2(4 − y) = 0.

Practice ★

  1. Which function is a solution of dydx=5y\dfrac{dy}{dx} = 5y?
    1. y=3e5xy = 3e^{ 5x}
    2. y=e3xy = e^{3x}
    3. y=5xyy = 5xy
    4. y=ex+5y = e^{x} + 5
  2. Which function is a solution of dydx=6y\dfrac{dy}{dx} = 6y?
    1. y=3e6xy = 3e^{ 6x}
    2. y=e3xy = e^{3x}
    3. y=6xyy = 6xy
    4. y=ex+6y = e^{x} + 6
  1. dydt=5(y−3)\dfrac{dy}{dt} = 5(y - 3). Find the constant (equilibrium) solution y=cy = c.
  2. dydt=8(y−2)\dfrac{dy}{dt} = 8(y - 2). Find the constant (equilibrium) solution y=cy = c.

Watch out!

Practice ★★

  1. For which k>0k > 0 is y=ekxy = e^{kx} a solution of y′′−9y=0y'' - 9y = 0?
  2. For which k>0k > 0 is y=ekxy = e^{kx} a solution of y′′−36y=0y'' - 36y = 0?

Exit ticket

Three questions to check you have got it.

  1. dydt=5(y−3)\dfrac{dy}{dt} = 5(y - 3). Find the constant (equilibrium) solution y=cy = c.
  2. dydt=8(y−2)\dfrac{dy}{dt} = 8(y - 2). Find the constant (equilibrium) solution y=cy = c.
  3. dydt=8(y−1)\dfrac{dy}{dt} = 8(y - 1). Find the constant (equilibrium) solution y=cy = c.

Summary card

Differential equations

  • Check a solution: compute its derivatives, substitute, compare.
  • Equilibrium: set the rate equal to 0.

Watch out: equilibrium means y′=0y' = 0, not y=0y = 0.

2. Slope fields

Warm-up

Three quick questions from earlier lessons.

Discover

For dydx=x−y\dfrac{dy}{dx} = x - y, a slope field draws a short segment at each grid point with that slope. What is the slope at (3,1)(3, 1)?

  1. 2
  2. −2

Key idea

A slope field shows the shape of all solutions without solving.

At each point (x,y)(x, y) draw a segment of slope f(x,y)f(x, y). Solution curves follow the segments. If ff depends only on xx, segments are parallel along vertical lines; only on yy, along horizontal lines; where f=0f = 0, segments are horizontal.

Worked example

Describe the field of dydx=y−2\dfrac{dy}{dx} = y - 2.

Same slope along each horizontal line
Depends only on y.
Horizontal segments along y=2y = 2
y − 2 = 0.
Rising above y=2y = 2, falling below
Signs.

Your turn, guided

Your turn: dydx=xy\dfrac{dy}{dx} = xy at (2,−3)(2, -3).

slope −6-6
2 × (−3).

Practice ★

  1. In the slope field of dydx=x+3y\dfrac{dy}{dx} = x + 3y, what is the slope of the segment at (−3,1)(-3, 1)?
  2. In the slope field of dydx=x+2y\dfrac{dy}{dx} = x + 2y, what is the slope of the segment at (−1,3)(-1, 3)?
  3. In the slope field of dydx=x+2y\dfrac{dy}{dx} = x + 2y, what is the slope of the segment at (0,−1)(0, -1)?

Watch out!

Practice ★★

  1. In the slope field of dydx=9x2\dfrac{dy}{dx} = 9x^2, which segments are all parallel?
    1. Those along any vertical line x=cx = c
    2. Those along any horizontal line y=cy = c
    3. None: every segment has its own slope
  1. Slope field of dydx=y(3−y)\dfrac{dy}{dx} = y(3 - y). Tick all the true statements.
    1. Segments are horizontal along y=0y = 0 and y=3y = 3
    2. Slopes are positive for 0<y<30 < y < 3
    3. Slopes are negative for y>3y > 3
    4. Slopes are positive for y>3y > 3
    5. Segments are horizontal along x=3x = 3
  2. Slope field of dydx=y(5−y)\dfrac{dy}{dx} = y(5 - y). Tick all the true statements.
    1. Segments are horizontal along y=0y = 0 and y=5y = 5
    2. Slopes are positive for 0<y<50 < y < 5
    3. Slopes are negative for y>5y > 5
    4. Slopes are positive for y>5y > 5
    5. Segments are horizontal along x=5x = 5

Exit ticket

Three questions to check you have got it.

  1. In the slope field of dydx=x+3y\dfrac{dy}{dx} = x + 3y, what is the slope of the segment at (−3,1)(-3, 1)?
  2. In the slope field of dydx=x+2y\dfrac{dy}{dx} = x + 2y, what is the slope of the segment at (−1,3)(-1, 3)?
  3. In the slope field of dydx=x+2y\dfrac{dy}{dx} = x + 2y, what is the slope of the segment at (0,−1)(0, -1)?

Summary card

Slope fields

  • Slope at (x,y)(x, y): substitute into f(x,y)f(x, y).
  • Only xx: parallel along verticals. Only yy: along horizontals.
  • f=0f = 0: horizontal segments (equilibria if constant in yy).

Watch out: (x,y)(x, y) in that order.

3. Separation of variables and initial conditions

Warm-up

Three quick questions from earlier lessons.

Discover

To solve dydx=2xy\dfrac{dy}{dx} = 2xy, Ana integrates both sides with respect to xx and writes y=x2y+Cy = x^2 y + C. Why is that not a solution method?

  1. yy is not a constant: the variables must be separated first
  2. It is fine, it just needs a value for CC

Key idea

Gather each variable with its own differential.

Separable equation dydx=g(x)h(y)\dfrac{dy}{dx} = g(x)h(y): write dyh(y)=g(x) dx\dfrac{dy}{h(y)} = g(x)\,dx, integrate both sides (one constant CC), solve for yy, then use the initial condition to find CC.

Worked example

Solve dydx=2xy\dfrac{dy}{dx} = 2xy with y(0)=3y(0) = 3.

dyy=2x dx\dfrac{dy}{y} = 2x\,dx
Separate.
ln⁡∣y∣=x2+C\ln|y| = x^2 + C
Integrate.
y=3ex2y = 3e^{x^2}
Exponentiate: y = Ae^{x²}; y(0) = 3 gives A = 3.

Your turn, guided

Your turn: dydx=3y\dfrac{dy}{dx} = 3y, y(0)=2y(0) = 2.

y=2e3xy = 2e^{3x}
ln|y| = 3x + C, so y = Ae^{3x}.

Practice ★

  1. Solve dydx=4xy\dfrac{dy}{dx} = 4xy with y(0)=5y(0) = 5.
  2. Solve dydx=4xy\dfrac{dy}{dx} = 4xy with y(0)=9y(0) = 9.
  3. Solve dydx=4xy\dfrac{dy}{dx} = 4xy with y(0)=2y(0) = 2.

Watch out!

Practice ★★

  1. Solve dydx=xy\dfrac{dy}{dx} = \dfrac{x}{y} with y(0)=8y(0) = 8 (so y>0y > 0). Give yy in terms of xx.
  2. Solve dydx=xy\dfrac{dy}{dx} = \dfrac{x}{y} with y(0)=6y(0) = 6 (so y>0y > 0). Give yy in terms of xx.
  1. Solve dydx=y2\dfrac{dy}{dx} = y^2 with y(0)=13y(0) = \dfrac{1}{ 3 }.
  1. Boss problem. Solve dydx=1x2y\dfrac{dy}{dx} = 1x^2 y with y(0)=4y(0) = 4.

Exit ticket

Three questions to check you have got it.

  1. Solve dydx=4xy\dfrac{dy}{dx} = 4xy with y(0)=5y(0) = 5.
  2. Solve dydx=4xy\dfrac{dy}{dx} = 4xy with y(0)=9y(0) = 9.
  3. Solve dydx=4xy\dfrac{dy}{dx} = 4xy with y(0)=2y(0) = 2.

Summary card

Separation of variables

  1. dyh(y)=g(x) dx\dfrac{dy}{h(y)} = g(x)\,dx.
  2. Integrate both sides, one +C+C.
  3. Solve for yy; use the initial value.

Watch out: ex+C=Aexe^{x + C} = Ae^x, not ex+Ce^x + C.

4. Exponential growth and decay

Warm-up

Three quick questions from earlier lessons.

Discover

The blue curve is y=a ekty = a\,e^{kt}, a solution of y′=kyy' = ky with y(0)=ay(0) = a. Move kk through 0.

Solutions y = a e^(kt) of y' = ky. For k > 0 they grow faster and faster; for k < 0 they decay towards 0; k = 0 gives a constant.

For k<0k < 0, what happens to yy?

  1. It decays towards 0
  2. It falls in a straight line and crosses 0

Key idea

Rate proportional to amount means exponential.

dydt=ky\dfrac{dy}{dt} = ky with y(0)=y0y(0) = y_0 has the solution y=y0ekty = y_0 e^{kt}. k>0k > 0: growth, doubling time ln⁡2k\tfrac{\ln 2}{k}. k<0k < 0: decay, half-life ln⁡2∣k∣\tfrac{\ln 2}{|k|}.

Worked example

Bacteria double every 3 hours, starting from 500. How many after 12 hours?

500⋅24500 \cdot 2^4
12 hours = 4 doubling times.
=8000= 8000
Compute.
y=500e(ln⁡2/3)ty = 500e^{(\ln 2/3)t}
Equivalently k = ln 2 / 3.

Your turn, guided

Your turn: half-life 5 years, find kk.

k=−ln⁡25k = -\dfrac{\ln 2}{5}
e^{5k} = ½.

Practice ★

  1. A population grows with dPdt=kP\dfrac{dP}{dt} = kP. It starts at 104 and doubles every 9 years. What is it after 27 years?
  2. A population grows with dPdt=kP\dfrac{dP}{dt} = kP. It starts at 469 and doubles every 4 years. What is it after 12 years?
  1. Solve dydt=−2y\dfrac{dy}{dt} = -2y with y(0)=5y(0) = 5.
  2. Solve dydt=4y\dfrac{dy}{dt} = 4y with y(0)=8y(0) = 8.

Watch out!

Practice ★★

  1. A substance decays with dmdt=km\dfrac{dm}{dt} = km and has a half-life of 27 years. Find kk (exact).
  2. A substance decays with dmdt=km\dfrac{dm}{dt} = km and has a half-life of 25 years. Find kk (exact).

Exit ticket

Three questions to check you have got it.

  1. Solve dydt=−2y\dfrac{dy}{dt} = -2y with y(0)=5y(0) = 5.
  2. Solve dydt=4y\dfrac{dy}{dt} = 4y with y(0)=8y(0) = 8.
  3. Solve dydt=3y\dfrac{dy}{dt} = 3y with y(0)=4y(0) = 4.

Summary card

Exponential models

  • y′=kyy' = ky, y(0)=y0⇒y=y0ekty(0) = y_0 \Rightarrow y = y_0e^{kt}.
  • Decay: k<0k < 0; k=−ln⁡2/(half-life)k = -\ln 2 / (\text{half-life}).

Watch out: equal times multiply by equal factors.

5. Newton's law of cooling

Warm-up

Three quick questions from earlier lessons.

Discover

A cup at temperature bb °C cools in a 20 °C room. The violet line is the room temperature. Move bb and the cooling constant kk.

Newton's law of cooling: T = 20 + (b − 20)e^(−kt). Whatever the start, the temperature approaches the room's 20 °C, faster for larger k.

Which temperature does the cup approach?

  1. 20 °C
  2. 0 °C

Key idea

The difference with the surroundings decays exponentially.

Newton's law of cooling: dTdt=−k(T−A)\dfrac{dT}{dt} = -k(T - A), with AA the surrounding temperature and k>0k > 0. Solution: T=A+(T0−A)e−ktT = A + (T_0 - A)e^{-kt}.

Worked example

Tea at 90 °C in a 20 °C room, k=0.1k = 0.1 per minute.

T−20=70e−0.1tT - 20 = 70e^{-0.1t}
u = T − 20 satisfies u' = −0.1u.
T=20+70e−0.1tT = 20 + 70e^{-0.1t}
So:
It starts cooling at 7 °C per minute
At t = 0 the rate is −0.1 × 70.

Your turn, guided

Your turn: soup at 80 °C in a 25 °C room, k=0.2k = 0.2. The rate at t=0t = 0?

−11-11 °C/min
−0.2 × (80 − 25).

Practice ★

  1. Soup at 60 °C is left in a 17 °C kitchen and follows Newton's law of cooling. Which temperature does it approach in the long run?
  1. dTdt=−410(T−25)\dfrac{dT}{dt} = -\tfrac{ 4 }{10}(T - 25) and T(0)=74T(0) = 74. How fast is the temperature changing at t=0t = 0, in °C/min?
  2. dTdt=−410(T−22)\dfrac{dT}{dt} = -\tfrac{ 4 }{10}(T - 22) and T(0)=92T(0) = 92. How fast is the temperature changing at t=0t = 0, in °C/min?

Watch out!

Practice ★★

  1. A drink at 65 °C cools in a 18 °C room: dTdt=−310(T−18)\dfrac{dT}{dt} = -\tfrac{ 3 }{10}(T - 18). Find T(t)T(t).
  2. A drink at 89 °C cools in a 16 °C room: dTdt=−210(T−16)\dfrac{dT}{dt} = -\tfrac{ 2 }{10}(T - 16). Find T(t)T(t).

Exit ticket

Three questions to check you have got it.

  1. A drink at 65 °C cools in a 18 °C room: dTdt=−310(T−18)\dfrac{dT}{dt} = -\tfrac{ 3 }{10}(T - 18). Find T(t)T(t).
  2. A drink at 89 °C cools in a 16 °C room: dTdt=−210(T−16)\dfrac{dT}{dt} = -\tfrac{ 2 }{10}(T - 16). Find T(t)T(t).
  3. A drink at 79 °C cools in a 15 °C room: dTdt=−210(T−15)\dfrac{dT}{dt} = -\tfrac{ 2 }{10}(T - 15). Find T(t)T(t).

Summary card

Newton's law of cooling

  • T′=−k(T−A)T' = -k(T - A).
  • T=A+(T0−A)e−ktT = A + (T_0 - A)e^{-kt}, approaching AA.

Watch out: it is the difference T−AT - A that decays.