Educerie

This whole subtopic is higher level. Nothing in it is on an SL paper.

Educerie · IB Diploma · Mathematics: analysis and approaches

IB Mathematics AA 5.18 · HL only

First-order differential equations

If you know only the rule for how fast something changes, how do you recover the thing itself, as an exact formula or as a numerical estimate?

What you will learn

  • HL Understand a first-order differential equation as a gradient rule, with a general solution and a particular solution fixed by an initial condition
  • HL Know how Euler's method steps along tangents, and when its estimate is too high or too low
  • HL Know how to solve separable equations, including the logistic equation with partial fractions
  • HL Know how to solve homogeneous equations with y = vx and linear equations with an integrating factor

You must be able to

  1. HL Solve a separable differential equation and use an initial condition to find the particular solution
  2. HL Solve a linear equation y' + P(x)y = Q(x) using an integrating factor
  3. HL Use the substitution y = vx to solve a homogeneous equation
  4. HL Use Euler's method to estimate a value, by hand or on the GDC
  5. HL Set up a differential equation from a description, find its constants from data and make a prediction
  6. HL Explain whether an Euler estimate is an overestimate or an underestimate from the sign of the second derivative

In the exam. Paper 1 (no calculator): solve by separating variables, by y=vxy = vx or with an integrating factor, often with an initial condition (6 to 9 marks); a short Euler table by hand (4 marks). Paper 2: Euler's method over many steps on the GDC, and modelling questions (cooling, growth, logistic populations) where the equation is first set up from a description and a constant is found from data (6 to 10 marks). Paper 3 builds long problems on a model, often asking what the equation says about its curves (isoclines, stationary points, concavity) before or after you solve it.

1Writing an equation, and checking a solution

Rates are easier to observe than totals. How fast a river flows past a bridge is easier to measure than how much water it holds. That is why models are written as differential equations. The skill is turning words into symbols.

  • Write "the rate of change of xx with respect to tt" as dxdt\frac{dx}{dt}.
  • Write "proportional to xx" as kxkx, "inversely proportional to xx" as kx\frac{k}{x}, and "proportional to the square root of the height HH" as kHk\sqrt{H}.
  • A quantity that is falling gets a minus sign: either write −k-k with k>0k > 0, or let kk be negative and say so.
  • Rate in minus rate out. A patient is given a drug by drip at a steady 5 mg per hour. The body clears 8% of whatever is present each hour. So dmdt=5−0.08m\frac{dm}{dt} = 5 - 0.08m.
  • Speed. A falling stone with air drag has acceleration dvdt=10−0.5v\frac{dv}{dt} = 10 - 0.5v.
  • A rate that depends on the amount. If growth per individual is proportional to (1−PL)\left(1 - \frac{P}{L}\right), then dPdt=m(1−PL)P\frac{dP}{dt} = m\left(1 - \frac{P}{L}\right)P. That is mLP(L−P)\frac{m}{L}P(L - P), the logistic form of section 7.

When the right-hand side holds only xx (or tt), you already know how to solve it: integrate.

Example: if dydx=6x2−1\frac{dy}{dx} = 6x^{2} - 1 and y(1)=4y(1) = 4, then y=2x3−x+cy = 2x^{3} - x + c and 4=2−1+c4 = 2 - 1 + c gives c=3c = 3.

The rest handles the harder case where yy appears on the right as well.

Checking a solution

  • To verify a given function, differentiate it and substitute into both sides.
  • Example: show that y=xsin⁡xy = x\sin x satisfies xdydx=y+x2cos⁡xx\frac{dy}{dx} = y + x^{2}\cos x.
dydx=sin⁡x+xcos⁡xproduct rule\frac{dy}{dx} = \sin x + x\cos x \qquad \textcolor{#838c91}{\text{product rule}}xdydx=xsin⁡x+x2cos⁡xx\frac{dy}{dx} = x\sin x + x^{2}\cos xy+x2cos⁡x=xsin⁡x+x2cos⁡xthe two sides agree for all xy + x^{2}\cos x = x\sin x + x^{2}\cos x \qquad \textcolor{#838c91}{\text{the two sides agree for all x}}
  • Check any initial condition too. A "verify" or "show that y=…y = \dots is a solution" question wants exactly these lines: the derivative, the substitution, and the statement that both sides match.

2Reading the curves without solving

  • Figure 1 draws the gradient rule dydx=x+y\frac{dy}{dx} = x + y as a field of short slope marks. Each mark has the gradient the equation demands at that point. Any curve that follows the marks is a solution.
  • There are infinitely many: y=Cex−x−1y = Ce^{x} - x - 1 for every constant CC. The condition y(0)=1y(0) = 1 picks out C=2C = 2.
Figure 1 · One differential equation, a whole family of solutions (0, 1) C = 2 C = 0 x y −2 −1 1 2 −2 −1 1 2 3 dy/dx = x + y fixes the slope at every point. Each curve y = Ceˣ − x − 1 follows the slopes; the initial condition y(0) = 1 picks out one of them, C = 2.
Figure 1 · One differential equation, a whole family of solutions
  • For y=2ex−x−1y = 2e^{x} - x - 1: dydx=2ex−1\frac{dy}{dx} = 2e^{x} - 1, and x+y=2ex−1x + y = 2e^{x} - 1. The sides match and y(0)=1y(0) = 1, so the curve is verified.

The equation already holds the gradient, so some questions ask what solution curves do and never ask for a formula. Three tools:

  • Zero gradient. Set dydx=0\frac{dy}{dx} = 0. The points that satisfy this are where a solution has a horizontal tangent. Where dydx>0\frac{dy}{dx} > 0 solutions rise. Where it is negative they fall. For dydx=x+y\frac{dy}{dx} = x + y, that is the line y=−xy = -x.
  • Isoclines. An isocline is the set of points where the gradient equals a fixed value cc: solve f(x,y)=cf(x, y) = c. Every slope mark along it is parallel. A solution curve crosses an isocline at exactly that gradient, which is how you sketch a solution by hand.
  • Concavity. Differentiate the equation again with respect to xx, replacing dydx\frac{dy}{dx} by its expression. Here d2ydx2=1+dydx=1+x+y\frac{d^{2}y}{dx^{2}} = 1 + \frac{dy}{dx} = 1 + x + y. At a point of zero gradient this is 1>01 > 0, so every stationary point of every solution is a local minimum. To show there is no point of inflexion, show d2ydx2\frac{d^{2}y}{dx^{2}} is never zero along the solution.

For dydx=x+y\frac{dy}{dx} = x + y, the isocline is y=−x+cy = -x + c. So c=−1,0,1c = -1, 0, 1 give three parallel lines of gradient −1-1, with yy-intercepts −1,0,1-1, 0, 1. Label each line with its gradient value and its intercept.

A second equation

  • Take dydx=y2−2x\frac{dy}{dx} = y^{2} - 2x. Zero gradient lies on the parabola x=12y2x = \frac{1}{2}y^{2}. The isocline for gradient cc is x=12(y2−c)x = \frac{1}{2}(y^{2} - c), a parabola opening to the right with vertex at (−c2,0)\left(-\frac{c}{2}, 0\right).
  • Differentiating by the chain rule gives d2ydx2=2ydydx−2\frac{d^{2}y}{dx^{2}} = 2y\frac{dy}{dx} - 2. At a stationary point dydx=0\frac{dy}{dx} = 0, so the second derivative is −2<0-2 < 0. Every stationary point is a local maximum, even though no method in this unit can solve this equation.

3Euler's method

When no exact method works, you can still walk along the slope field.

  • Start at the known point. The equation gives the gradient there.
  • Move a small distance hh along that tangent to a new point.
  • Find the new gradient, and repeat.

The formula booklet writes each step as

Euler's method: yn+1=yn+h×f(xn,yn)y_{n+1} = y_{n} + h \times f(x_{n}, y_{n}), with xn+1=xn+hx_{n+1} = x_{n} + h, for dydx=f(x,y)\frac{dy}{dx} = f(x, y). In words: new yy = old yy + step ×\times gradient at the old point.

Example 1. For dydx=x+y\frac{dy}{dx} = x + y with y(0)=1y(0) = 1, use Euler's method with h=0.1h = 0.1 to estimate y(0.3)y(0.3).

n=0:x0=0, y0=1f=0+1=1y1=1+0.1(1)=1.1n = 0:\quad x_{0} = 0,\ y_{0} = 1 \qquad f = 0 + 1 = 1 \qquad y_{1} = 1 + 0.1(1) = 1.1n=1:x1=0.1, y1=1.1f=0.1+1.1=1.2y2=1.1+0.1(1.2)=1.22n = 1:\quad x_{1} = 0.1,\ y_{1} = 1.1 \qquad f = 0.1 + 1.1 = 1.2 \qquad y_{2} = 1.1 + 0.1(1.2) = 1.22n=2:x2=0.2, y2=1.22f=0.2+1.22=1.42y3=1.22+0.1(1.42)=1.362n = 2:\quad x_{2} = 0.2,\ y_{2} = 1.22 \qquad f = 0.2 + 1.22 = 1.42 \qquad y_{3} = 1.22 + 0.1(1.42) = 1.362y(0.3)≈1.362y(0.3) \approx 1.362
  • Count the steps first: 0.3−00.1=3\frac{0.3 - 0}{0.1} = 3.
  • Set the working out as a table, one row per step, so one slip costs one mark, not four.

Example 2: over or under? Take dydx=6−2y\frac{dy}{dx} = 6 - 2y, y(0)=0y(0) = 0. Use h=0.25h = 0.25 to estimate y(0.5)y(0.5) and say whether the estimate is too big or too small.

y1=0+0.25(6−0)=1.5x_{1} = 0.25y_{1} = 0 + 0.25(6 - 0) = 1.5 \qquad \textcolor{#838c91}{\text{x\_\{1\} = 0.25}}y2=1.5+0.25(6−3)=2.25x_{2} = 0.5y_{2} = 1.5 + 0.25(6 - 3) = 2.25 \qquad \textcolor{#838c91}{\text{x\_\{2\} = 0.5}}d2ydx2=−2dydx=−2(6−2y)differentiate the equation\frac{d^{2}y}{dx^{2}} = -2\frac{dy}{dx} = -2(6 - 2y) \qquad \textcolor{#838c91}{\text{differentiate the equation}}
  • Along this solution yy stays below 33. The value y=3y = 3 makes dydx=0\frac{dy}{dx} = 0, so it is a constant solution. As yy climbs from 0 towards 3, its gradient 6−2y6 - 2y shrinks towards 0. So yy approaches 3 but never passes it.
  • So 6−2y>06 - 2y > 0 and d2ydx2<0\frac{d^{2}y}{dx^{2}} < 0. The curve is concave down, so each tangent lies above it, and 2.25 is an overestimate (the exact value is 3(1−e−1)≈1.903(1 - e^{-1}) \approx 1.90).

Is the estimate too big or too small?

  • A concave-up solution lies above its tangents, so Euler underestimates. A concave-down solution lies below them, so Euler overestimates.
  • In Example 1 the exact value is y(0.3)=2e0.3−1.3≈1.400y(0.3) = 2e^{0.3} - 1.3 \approx 1.400, and 1.3621.362 is low. Figure 2 shows why: the curve bends upwards, so every tangent step falls below it.
  • The equation gives the concavity without the exact solution: d2ydx2=1+x+y>0\frac{d^{2}y}{dx^{2}} = 1 + x + y > 0 here. A full answer names the sign of d2ydx2\frac{d^{2}y}{dx^{2}}, then the direction of the error.
Figure 2 · Euler's method walks along tangent lines 3.44 true 3.19 (h = 0.1) 2.88 (h = 0.25) y = 2eˣ − x − 1 x y 0.25 0.5 0.75 1 1 1.5 2 2.5 3 3.5 Each step follows the slope at its start. The curve bends upwards, so the steps fall below it; smaller steps fall less far. At x = 1: h = 0.25 gives 2.88, h = 0.1 gives 3.19, the true value is 3.44.
Figure 2 · Euler's method walks along tangent lines

Making it better

  • A smaller step keeps each tangent closer to the curve. Figure 2 compares two step sizes out to x=1x = 1: h=0.25h = 0.25 gives 2.882.88, h=0.1h = 0.1 gives 3.193.19, and the true value is 2e−2≈3.442e - 2 \approx 3.44. Roughly, halving hh halves the error.
  • On Paper 2, the GDC or a spreadsheet does the many steps. Define xn+1=xn+0.1x_{n+1} = x_{n} + 0.1 and yn+1=yn+0.1(xn+yn)y_{n+1} = y_{n} + 0.1(x_{n} + y_{n}) as two linked sequences and read off the row you need.

4Separating the variables

An equation is separable when dydx\frac{dy}{dx} can be written as a function of xx times a function of yy: dydx=g(x)h(y)\frac{dy}{dx} = g(x)h(y). Gather every yy with dydy on one side, every xx with dxdx on the other, and integrate.

Separable: dydx=g(x) h(y)\dfrac{dy}{dx} = g(x)\,h(y) →\to ∫1h(y) dy=∫g(x) dx\displaystyle\int \frac{1}{h(y)}\,dy = \int g(x)\,dx, with one constant, added on the xx side.

Example 3. Solve dydx=2xy2\dfrac{dy}{dx} = 2xy^{2}, given y(0)=1y(0) = 1.

∫y−2 dy=∫2x dx\int y^{-2}\,dy = \int 2x\,dx−1y=x2+c-\frac{1}{y} = x^{2} + cx=0, y=1  ⇒  c=−1x = 0,\ y = 1 \;\Rightarrow\; c = -1y=11−x2valid for -1 < x < 1, the interval containing x = 0y = \frac{1}{1 - x^{2}} \qquad \textcolor{#838c91}{\text{valid for -1 < x < 1, the interval containing x = 0}}
  • The answer blows up at x=±1x = \pm 1. The solution exists only on the interval around the starting point where the formula behaves.
  • Dividing by y2y^{2} assumed y≠0y \neq 0. The constant y=0y = 0 also satisfies the equation but does not pass through the given point, so it is not needed here.

Example 4: logarithms and a modulus. Solve xdydx=3(y−2)x\dfrac{dy}{dx} = 3(y - 2) for x>0x > 0, given y(1)=5y(1) = 5.

∫1y−2 dy=∫3x dx\int \frac{1}{y - 2}\,dy = \int \frac{3}{x}\,dxln⁡∣y−2∣=3ln⁡x+c=ln⁡x3+c\ln\lvert y - 2\rvert = 3\ln x + c = \ln x^{3} + c∣y−2∣=ecx3  ⇒  y−2=Ax3A=±ec\lvert y - 2\rvert = e^{c}x^{3} \;\Rightarrow\; y - 2 = Ax^{3} \qquad \textcolor{#838c91}{A = \pm e^{c}}x=1, y=5  ⇒  A=3,y=2+3x3x = 1,\ y = 5 \;\Rightarrow\; A = 3, \quad y = 2 + 3x^{3}

Three points of technique:

  • One constant is enough. Constants on both sides merge.
  • The exponential step. Students slip when turning ln⁡∣y−2∣=⋯+c\ln\lvert y - 2\rvert = \dots + c into y−2=Ax3y - 2 = Ax^{3}. Write eln⁡x3+c=ec x3e^{\ln x^{3} + c} = e^{c}\,x^{3} as a line of its own.
  • The constant solution. y=2y = 2 also solves the equation. It is the case A=0A = 0, so AA can be any real number.

Example 5: an implicit answer

  • Solve dydx=2x+13y2\dfrac{dy}{dx} = \dfrac{2x + 1}{3y^{2}}.
  • Then ∫3y2 dy=∫(2x+1) dx\int 3y^{2}\,dy = \int (2x + 1)\,dx gives y3=x2+x+cy^{3} = x^{2} + x + c.
  • That is a complete answer. A relation between xx and yy is called an implicit solution. You need y=…y = \dots only if the question says "give yy in terms of xx". If asked for the form f(x,y)=0f(x, y) = 0, move everything to one side.
  • A neat case: dydx=−xy\frac{dy}{dx} = -\frac{x}{y} gives x2+y2=kx^{2} + y^{2} = k. These are circles about the origin, one for each kk.

Exponential growth and decay

  • The simplest separable model is dNdt=kN\frac{dN}{dt} = kN: the rate is proportional to the amount present. Separating gives N=N0ektN = N_{0}e^{kt}. With k>0k > 0 it is growth. With k=−λ<0k = -\lambda < 0 it is decay.
  • Example: carbon-14 decays this way with a half-life of 5730 years, so e−5730λ=12e^{-5730\lambda} = \tfrac{1}{2} and λ=ln⁡25730≈1.21×10−4\lambda = \dfrac{\ln 2}{5730} \approx 1.21 \times 10^{-4} per year. A bone that holds 30% of the carbon-14 it had in life satisfies e−λt=0.3e^{-\lambda t} = 0.3, so t=ln⁡(10/3)λ≈9950t = \dfrac{\ln(10/3)}{\lambda} \approx 9950 years (Figure 4).
  • The same equation covers radioactive decay in physics and first-order reactions in chemistry.

With a limit: falling against drag. Solve dvdt=10−0.5v\frac{dv}{dt} = 10 - 0.5v, v(0)=0v(0) = 0.

∫110−0.5v dv=∫dt\int \frac{1}{10 - 0.5v}\,dv = \int dt−2ln⁡(10−0.5v)=t+c0 <= v < 20, so 10 - 0.5v > 0-2\ln(10 - 0.5v) = t + c \qquad \textcolor{#838c91}{\text{0 <= v < 20, so 10 - 0.5v > 0}}10−0.5v=Ae−t/2, v(0)=0  ⇒  A=1010 - 0.5v = Ae^{-t/2},\ v(0) = 0 \;\Rightarrow\; A = 10v=20(1−e−t/2)v = 20\left(1 - e^{-t/2}\right)

As t→∞t \to \infty, v→20v \to 20, the terminal speed. You can also read it from the equation by setting dvdt=0\frac{dv}{dt} = 0.

Newton's law of cooling

  • An object changes temperature at a rate proportional to the gap between its temperature TT and its surroundings TsT_{s}: dTdt=−k(T−Ts)\dfrac{dT}{dt} = -k(T - T_{s}), k>0k > 0.
  • It works for warming as well as cooling, because the sign of T−TsT - T_{s} does the work.

Example 6 (Paper 2). Tea at 90 ∘C90\ ^{\circ}\mathrm{C} is left in a room at 20 ∘C20\ ^{\circ}\mathrm{C}. After 5 minutes it is at 60 ∘C60\ ^{\circ}\mathrm{C}. Find when it reaches 40 ∘C40\ ^{\circ}\mathrm{C}.

dTdt=−k(T−20)\frac{dT}{dt} = -k(T - 20)∫1T−20 dT=∫−k dt\int \frac{1}{T - 20}\,dT = \int -k\,dtln⁡(T−20)=−kt+cT > 20 throughout, so no modulus needed\ln(T - 20) = -kt + c \qquad \textcolor{#838c91}{\text{T > 20 throughout, so no modulus needed}}T=20+Ae−ktT = 20 + Ae^{-kt}t=0, T=90  ⇒  A=70t = 0,\ T = 90 \;\Rightarrow\; A = 70t=5, T=60  ⇒  70e−5k=40,e−5k=47,k=15ln⁡74≈0.112 per minutet = 5,\ T = 60 \;\Rightarrow\; 70e^{-5k} = 40, \quad e^{-5k} = \frac{4}{7}, \quad k = \frac{1}{5}\ln\frac{7}{4} \approx 0.112 \ \text{per minute}T=40  ⇒  70e−kt=20,t=ln⁡3.5k≈11.2 minutesT = 40 \;\Rightarrow\; 70e^{-kt} = 20, \quad t = \frac{\ln 3.5}{k} \approx 11.2 \ \text{minutes}

Figure 3 shows the curve: fast at first, when the gap is large, then slower as TT nears 20 ∘C20\ ^{\circ}\mathrm{C}. The model never reaches 20 ∘C20\ ^{\circ}\mathrm{C} exactly; say so if asked about the long-term temperature.

Figure 3 · A cup of tea cooling: Newton's law of cooling room temperature 20 °C 90 °C at the start (5, 60) 40 °C after 11.2 min t (min) T (°C) 5 10 15 20 30 40 20 40 60 80 100 The rate of cooling is proportional to the gap between the tea and the room, so the gap shrinks exponentially and T approaches 20 °C without reaching it.
Figure 3 · A cup of tea cooling: Newton's law of cooling
Figure 4 · Carbon-14 decay: the fraction left halves every 5730 years 30% left: t ≈ 9950 years N/N₀ = e−λt t (years) N/N₀ 5730 11 460 17 190 0.25 0.5 1 Here λ = ln 2 ÷ 5730. A sample with 30% of its carbon-14 left is about 9950 years old.
Figure 4 · Carbon-14 decay: the fraction left halves every 5730 years

Example 7: warming

  • Milk at 4 ∘C4\ ^{\circ}\mathrm{C} is put in a kitchen at 24 ∘C24\ ^{\circ}\mathrm{C} and reaches 10 ∘C10\ ^{\circ}\mathrm{C} after 10 minutes.
  • Here T<24T < 24, so the same equation gives T=24+Ae−ktT = 24 + Ae^{-kt} with A=−20A = -20. Then 24−20e−10k=1024 - 20e^{-10k} = 10, so e−10k=0.7e^{-10k} = 0.7 and k=ln⁡(1/0.7)10≈0.0357k = \frac{\ln(1/0.7)}{10} \approx 0.0357.
  • It reaches 18 ∘C18\ ^{\circ}\mathrm{C} when 20e−kt=620e^{-kt} = 6, that is t=ln⁡(1/0.3)k≈33.8t = \frac{\ln(1/0.3)}{k} \approx 33.8 minutes. Keep kk unrounded in the GDC: with 0.0360.036 the answer shifts to about 33.4.

5Pattern for modelling questions

Most Paper 2 questions on this topic share a skeleton:

  1. Write the equation from the description, often as a "show that".
  2. Solve it, usually by separating.
  3. Use two pieces of data to fix the two constants, one in the integration and one in the rate.
  4. Answer a prediction or "when" question in context, with units.

Part 1 is often a short "show that" worth only a mark or two. Every later part depends on it, so practise it on its own.

6The logistic equation

Exponential growth goes on for ever, but populations run out of food or room. The logistic equation, named in the guide,

dndt=kn(a−n),a,k>0 \frac{dn}{dt} = kn(a - n), \qquad a, k > 0

makes growth proportional both to the population nn and to the room left, a−na - n. While nn is small it behaves like exponential growth. As nn nears the carrying capacity aa, growth stops. It is separable. The nn-side integral needs partial fractions (1.11).

Example 8. A lake is stocked with 200 fish. The population NN after tt years is modelled by dNdt=0.0002N(2000−N)\frac{dN}{dt} = 0.0002N(2000 - N). Find NN in terms of tt.

∫1N(2000−N) dN=∫0.0002 dt\int \frac{1}{N(2000 - N)}\,dN = \int 0.0002\,dt1N(2000−N)=12000[1N+12000−N]partial fractions\frac{1}{N(2000 - N)} = \frac{1}{2000}\left[\frac{1}{N} + \frac{1}{2000 - N}\right] \qquad \textcolor{#838c91}{\text{partial fractions}}12000[ln⁡N−ln⁡(2000−N)]=0.0002t+c0 < N < 2000, so no moduli\frac{1}{2000}\left[\ln N - \ln(2000 - N)\right] = 0.0002t + c \qquad \textcolor{#838c91}{\text{0 < N < 2000, so no moduli}}ln⁡(N2000−N)=0.4t+c′multiply by 2000\ln\left(\frac{N}{2000 - N}\right) = 0.4t + c' \qquad \textcolor{#838c91}{\text{multiply by 2000}}N2000−N=Be0.4t;t=0, N=200  ⇒  B=2001800=19\frac{N}{2000 - N} = Be^{0.4t}; \quad t = 0,\ N = 200 \;\Rightarrow\; B = \frac{200}{1800} = \frac{1}{9}N=20001+9e−0.4tmake N the subject, divide by e0.4tN = \frac{2000}{1 + 9e^{-0.4t}} \qquad \textcolor{#838c91}{\text{make }N\text{ the subject, divide by }e^{0.4t}}

What the equation says without solving:

  • Constant solutions. n=0n = 0 and n=an = a make the right-hand side zero. The population is stuck at zero or sitting at capacity.
  • Between them. dndt>0\frac{dn}{dt} > 0, so the population climbs towards aa.
  • Above capacity. dndt<0\frac{dn}{dt} < 0, so it falls back towards aa. Since a−n<0a - n < 0 there, keep the modulus ln⁡∣a−n∣\ln\lvert a - n\rvert.

Either way n→an \to a as t→∞t \to \infty.

  • Watch the sign: ∫12000−N dN=−ln⁡(2000−N)\int \frac{1}{2000 - N}\,dN = -\ln(2000 - N), because the inside has derivative −1-1. That is why the answer has the form a1+Be−akt\frac{a}{1 + Be^{-akt}}.
  • Figure 5 shows the S-shaped logistic curve. The population passes 10001000, half the capacity, when 9e−0.4t=19e^{-0.4t} = 1, at t=ln⁡90.4≈5.49t = \dfrac{\ln 9}{0.4} \approx 5.49 years.
    • That is also where growth is fastest. 0.0002N(2000−N)0.0002N(2000 - N) is a quadratic in NN with its maximum at N=1000N = 1000, where the rate is 200 fish per year.
Figure 5 · Logistic growth levels off at the carrying capacity carrying capacity a = 2000 steepest here: (5.49, 1000) N(0) = 200 t (years) N 5 10 15 20 500 1000 1500 2000 dN/dt = 0.0002N(2000 − N). Growth is fastest at N = 1000, half the carrying capacity, which the fish reach after 5.49 years. N never exceeds 2000.
Figure 5 · Logistic growth levels off at the carrying capacity

7Homogeneous equations: the substitution y=vxy = vx

  • Some equations do not separate as they stand, but the right-hand side depends on xx and yy only through the ratio yx\frac{y}{x}. Such an equation, dydx=f(yx)\frac{dy}{dx} = f\left(\frac{y}{x}\right), is homogeneous.
  • Figure 6 shows the meaning. Along any straight line through the origin yx\frac{y}{x} is constant, so the gradient is the same all the way along it.
Figure 6 · Homogeneous: the slope is constant along each line through O y = ½x y = x y = 2x y = 3x (1, 2) x y 1 2 3 1 2 3 4 5 6 dy/dx = (x² + y²)/(xy) depends only on v = y/x, so on each ray y = vx every slope mark is parallel. The solution through (1, 2) is y = x√(2 ln x + 4).
Figure 6 · Homogeneous: the slope is constant along each line through O
  • The fix is to make the ratio the variable. Put v=yxv = \frac{y}{x}, so y=vxy = vx. Differentiate by the product rule, remembering that vv is itself a function of xx:

Homogeneous: for dydx=f(yx)\dfrac{dy}{dx} = f\left(\dfrac{y}{x}\right), put y=vxy = vx, so dydx=v+xdvdx\dfrac{dy}{dx} = v + x\dfrac{dv}{dx}. The equation becomes v+xdvdx=f(v)v + x\dfrac{dv}{dx} = f(v), which separates.

Example 9. Solve dydx=x2+3y22xy\dfrac{dy}{dx} = \dfrac{x^{2} + 3y^{2}}{2xy}, for x>0x > 0, given y(1)=2y(1) = 2.

To test for homogeneity, divide top and bottom by x2x^{2}: the right-hand side is 1+3(y/x)22(y/x)\dfrac{1 + 3(y/x)^{2}}{2(y/x)}, a function of yx\frac{y}{x} alone.

v+xdvdx=1+3v22vv + x\frac{dv}{dx} = \frac{1 + 3v^{2}}{2v}xdvdx=1+3v22v−v=1+v22vx\frac{dv}{dx} = \frac{1 + 3v^{2}}{2v} - v = \frac{1 + v^{2}}{2v}∫2v1+v2 dv=∫1x dxnow separable\int \frac{2v}{1 + v^{2}}\,dv = \int \frac{1}{x}\,dx \qquad \textcolor{#838c91}{\text{now separable}}ln⁡(1+v2)=ln⁡x+c  ⇒  1+v2=Ax\ln(1 + v^{2}) = \ln x + c \;\Rightarrow\; 1 + v^{2} = Axy2x2=Ax−1;x=1, y=2  ⇒  A=5\frac{y^{2}}{x^{2}} = Ax - 1;\quad x = 1,\ y = 2 \;\Rightarrow\; A = 5y2=5x3−x2,y=x5x−1positive root since y(1) > 0y^{2} = 5x^{3} - x^{2}, \quad y = x\sqrt{5x - 1} \qquad \textcolor{#838c91}{\text{positive root since y(1) > 0}}

The costliest slip comes in the first line: dydx\frac{dy}{dx} is not dvdx\frac{dv}{dx}. It is v+xdvdxv + x\frac{dv}{dx}, and without that vv the equation will not separate properly. Many "show that" questions award marks for exactly the line xdvdx=…x\frac{dv}{dx} = \dots, so always write it before integrating.

8Linear equations: the integrating factor

A linear first-order equation has the form

dydx+P(x)y=Q(x) \frac{dy}{dx} + P(x)y = Q(x)

with yy and dydx\frac{dy}{dx} only to the first power.

  • The formula booklet gives the integrating factor I(x)=e∫P(x) dxI(x) = e^{\int P(x)\,dx}. Multiply the whole equation by it. The left side becomes the derivative of a product, which integrates at once.
  • Why: I′=PII' = PI, so ddx(Iy)=Iy′+PIy=I(y′+Py)\frac{d}{dx}(Iy) = Iy' + PIy = I(y' + Py).

Integrating factor: for y′+P(x)y=Q(x)y' + P(x)y = Q(x), multiply by I=e∫P dxI = e^{\int P\,dx}. Then ddx(Iy)=IQ\dfrac{d}{dx}(Iy) = IQ, so Iy=∫IQ dxIy = \displaystyle\int IQ\,dx. Add the constant before you divide by II.

Example 10. Solve dydx+2xy=2xe−x2\dfrac{dy}{dx} + 2xy = 2xe^{-x^{2}}, given y(0)=3y(0) = 3.

P=2x  ⇒  I=e∫2x dx=ex2no constant needed in the integrating factorP = 2x \;\Rightarrow\; I = e^{\int 2x\,dx} = e^{x^{2}} \qquad \textcolor{#838c91}{\text{no constant needed in the integrating factor}}ex2dydx+2xex2y=2xe^{x^{2}}\frac{dy}{dx} + 2xe^{x^{2}}y = 2xddx(yex2)=2x\frac{d}{dx}\left(ye^{x^{2}}\right) = 2xyex2=x2+Cye^{x^{2}} = x^{2} + Cy(0)=3  ⇒  C=3,y=(x2+3)e−x2y(0) = 3 \;\Rightarrow\; C = 3, \quad y = (x^{2} + 3)e^{-x^{2}}

Example 11: standard form first. Solve xdydx−3y=x4x\dfrac{dy}{dx} - 3y = x^{4} for x>0x > 0, given y(1)=0y(1) = 0. The coefficient of dydx\frac{dy}{dx} must be 1, so divide by xx before reading off PP.

dydx−3xy=x3P=−3x, Q=x3\frac{dy}{dx} - \frac{3}{x}y = x^{3} \qquad \textcolor{#838c91}{P = -\frac{3}{x}\text{, }Q = x^{3}}I=e−3ln⁡x=x−3I = e^{-3\ln x} = x^{-3}ddx(x−3y)=x−3x3=1\frac{d}{dx}\left(x^{-3}y\right) = x^{-3}x^{3} = 1x−3y=x+C;y(1)=0  ⇒  C=−1x^{-3}y = x + C;\quad y(1) = 0 \;\Rightarrow\; C = -1y=x4−x3y = x^{4} - x^{3}
  • Simplify ekln⁡xe^{k\ln x} to xkx^{k} every time.
  • If a question says "show that I(x)I(x) is an integrating factor", do one of two things. Compute e∫P dxe^{\int P\,dx} and arrive at II. Or differentiate IyIy by the product rule and show the result is I(dydx+Py)I\left(\frac{dy}{dx} + Py\right).

Example 12: a rate in, a rate out

  • A vat holds 250 litres of liquid with 20 g of dissolved dye. Liquid carrying 1.5 g of dye per litre flows in at 5 litres per minute. The well-mixed contents leave at 5 litres per minute.
  • With xx grams of dye after tt minutes, the dye entering is 1.5×5=7.51.5 \times 5 = 7.5 g per minute. The dye leaving is 5×x250=0.02x5 \times \frac{x}{250} = 0.02x g per minute. So dxdt=7.5−0.02x\frac{dx}{dt} = 7.5 - 0.02x.
  • Then I=e0.02tI = e^{0.02t}, ddt(xe0.02t)=7.5e0.02t\frac{d}{dt}(xe^{0.02t}) = 7.5e^{0.02t}, xe0.02t=375e0.02t+Cxe^{0.02t} = 375e^{0.02t} + C, and x(0)=20x(0) = 20 gives C=−355C = -355. So x=375−355e−0.02tx = 375 - 355e^{-0.02t}. In the long run x→375x \to 375, which is 1.51.5 g ÷ L in 250250 L. (Separating the variables works equally well here.)

Back to Euler

  • The equation of Section 3, dydx=x+y\frac{dy}{dx} = x + y, is linear: dydx−y=x\frac{dy}{dx} - y = x, P=−1P = -1, I=e−xI = e^{-x}. Then ddx(ye−x)=xe−x\frac{d}{dx}(ye^{-x}) = xe^{-x}.
  • Parts (5.16) gives ye−x=−xe−x−e−x+Cye^{-x} = -xe^{-x} - e^{-x} + C, so y=Cex−x−1y = Ce^{x} - x - 1. That is the exact solution drawn in Figures 1 and 2. It is why we could measure Euler's error.

9Which method?

Figure 7 turns the choice into four questions. Try them in order: separation is quickest when it applies, and Euler is the fallback, or the method a question names.

Figure 7 · Which method? Ask these questions in order Can you write it as dy/dx = g(x) h(y)? yes Separate the variables ∫ dy/h(y) = ∫ g(x) dx no Is it dy/dx = f(y/x)? yes Substitute y = vx then it separates in v and x no Is it y′ + P(x)y = Q(x)? yes Integrating factor no None of these, or asked for a value? yes Euler's method yₙ₊₁ = yₙ + h f(xₙ, yₙ) I(x) = e∫P(x) dx Only Euler works on every equation, but it gives numbers, not a formula.
Figure 7 · Which method? Ask these questions in order

If the question names the method ("use the substitution y=vxy = vx", "use an integrating factor"), use it. One equation can suit several methods: dydx=yx\frac{dy}{dx} = \frac{y}{x} (for x>0x > 0) is separable, linear and homogeneous at once, and every method gives y=Axy = Ax.

The booklet gives Euler's formula and the integrating factor. The separation and y=vxy = vx techniques must be in your head.

Practice questions

47 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.