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
HL Solve a separable differential equation and use an initial condition to find the particular solution
HL Solve a linear equation y' + P(x)y = Q(x) using an integrating factor
HL Use the substitution y = vx to solve a homogeneous equation
HL Use Euler's method to estimate a value, by hand or on the GDC
HL Set up a differential equation from a description, find its constants from data and make a prediction
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=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 x with respect to t" as dtdx.
Write "proportional to x" as kx, "inversely proportional to x" as xk, and "proportional to the square root of the height H" as kH.
A quantity that is falling gets a minus sign: either write −k with k>0, or let k 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 dtdm=5−0.08m.
Speed. A falling stone with air drag has acceleration dtdv=10−0.5v.
A rate that depends on the amount. If growth per individual is proportional to (1−LP), then dtdP=m(1−LP)P. That is LmP(L−P), the logistic form of section 7.
When the right-hand side holds only x (or t), you already know how to solve it: integrate.
Example: if dxdy=6x2−1 and y(1)=4, then y=2x3−x+c and 4=2−1+c gives c=3.
The rest handles the harder case where y 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=xsinx satisfies xdxdy=y+x2cosx.
dxdy=sinx+xcosxproduct rulexdxdy=xsinx+x2cosxy+x2cosx=xsinx+x2cosxthe two sides agree for all x
Check any initial condition too. A "verify" or "show that y=… 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 dxdy=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−1 for every constant C. The condition y(0)=1 picks out C=2.
Figure 1 · One differential equation, a whole family of solutions
For y=2ex−x−1: dxdy=2ex−1, and x+y=2ex−1. The sides match and y(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 dxdy=0. The points that satisfy this are where a solution has a horizontal tangent. Where dxdy>0 solutions rise. Where it is negative they fall. For dxdy=x+y, that is the line y=−x.
Isoclines. An isocline is the set of points where the gradient equals a fixed value c: solve f(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 x, replacing dxdy by its expression. Here dx2d2y=1+dxdy=1+x+y. At a point of zero gradient this is 1>0, so every stationary point of every solution is a local minimum. To show there is no point of inflexion, show dx2d2y is never zero along the solution.
For dxdy=x+y, the isocline is y=−x+c. So c=−1,0,1 give three parallel lines of gradient −1, with y-intercepts −1,0,1. Label each line with its gradient value and its intercept.
A second equation
Take dxdy=y2−2x. Zero gradient lies on the parabola x=21y2. The isocline for gradient c is x=21(y2−c), a parabola opening to the right with vertex at (−2c,0).
Differentiating by the chain rule gives dx2d2y=2ydxdy−2. At a stationary point dxdy=0, so the second derivative is −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 h 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), with xn+1=xn+h, for dxdy=f(x,y). In words: new y = old y + step × gradient at the old point.
Example 1. For dxdy=x+y with y(0)=1, use Euler's method with h=0.1 to estimate y(0.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 dxdy=6−2y, y(0)=0. Use h=0.25 to estimate y(0.5) and say whether the estimate is too big or too small.
y1=0+0.25(6−0)=1.5x_{1} = 0.25y2=1.5+0.25(6−3)=2.25x_{2} = 0.5dx2d2y=−2dxdy=−2(6−2y)differentiate the equation
Along this solution y stays below 3. The value y=3 makes dxdy=0, so it is a constant solution. As y climbs from 0 towards 3, its gradient 6−2y shrinks towards 0. So y approaches 3 but never passes it.
So 6−2y>0 and dx2d2y<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.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.400, and 1.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: dx2d2y=1+x+y>0 here. A full answer names the sign of dx2d2y, then the direction of the error.
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=1: h=0.25 gives 2.88, h=0.1 gives 3.19, and the true value is 2e−2≈3.44. Roughly, halving h halves the error.
On Paper 2, the GDC or a spreadsheet does the many steps. Define xn+1=xn+0.1 and yn+1=yn+0.1(xn+yn) as two linked sequences and read off the row you need.
4Separating the variables
An equation is separable when dxdy can be written as a function of x times a function of y: dxdy=g(x)h(y). Gather every y with dy on one side, every x with dx on the other, and integrate.
Separable:dxdy=g(x)h(y)→∫h(y)1dy=∫g(x)dx, with one constant, added on the x side.
Example 3. Solve dxdy=2xy2, given y(0)=1.
∫y−2dy=∫2xdx−y1=x2+cx=0,y=1⇒c=−1y=1−x21valid for -1 < x < 1, the interval containing x = 0
The answer blows up at x=±1. The solution exists only on the interval around the starting point where the formula behaves.
Dividing by y2 assumed y=0. The constant y=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 xdxdy=3(y−2) for x>0, given y(1)=5.
One constant is enough. Constants on both sides merge.
The exponential step. Students slip when turning ln∣y−2∣=⋯+c into y−2=Ax3. Write elnx3+c=ecx3 as a line of its own.
The constant solution.y=2 also solves the equation. It is the case A=0, so A can be any real number.
Example 5: an implicit answer
Solve dxdy=3y22x+1.
Then ∫3y2dy=∫(2x+1)dx gives y3=x2+x+c.
That is a complete answer. A relation between x and y is called an implicit solution. You need y=… only if the question says "give y in terms of x". If asked for the form f(x,y)=0, move everything to one side.
A neat case: dxdy=−yx gives x2+y2=k. These are circles about the origin, one for each k.
Exponential growth and decay
The simplest separable model is dtdN=kN: the rate is proportional to the amount present. Separating gives N=N0ekt. With k>0 it is growth. With k=−λ<0 it is decay.
Example: carbon-14 decays this way with a half-life of 5730 years, so e−5730λ=21 and λ=5730ln2≈1.21×10−4 per year. A bone that holds 30% of the carbon-14 it had in life satisfies e−λt=0.3, so t=λln(10/3)≈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 dtdv=10−0.5v, v(0)=0.
∫10−0.5v1dv=∫dt−2ln(10−0.5v)=t+c0 <= v < 20, so 10 - 0.5v > 010−0.5v=Ae−t/2,v(0)=0⇒A=10v=20(1−e−t/2)
As t→∞, v→20, the terminal speed. You can also read it from the equation by setting dtdv=0.
Newton's law of cooling
An object changes temperature at a rate proportional to the gap between its temperature T and its surroundings Ts: dtdT=−k(T−Ts), k>0.
It works for warming as well as cooling, because the sign of T−Ts does the work.
Example 6 (Paper 2). Tea at 90∘C is left in a room at 20∘C. After 5 minutes it is at 60∘C. Find when it reaches 40∘C.
dtdT=−k(T−20)∫T−201dT=∫−kdtln(T−20)=−kt+cT > 20 throughout, so no modulus neededT=20+Ae−ktt=0,T=90⇒A=70t=5,T=60⇒70e−5k=40,e−5k=74,k=51ln47≈0.112per minuteT=40⇒70e−kt=20,t=kln3.5≈11.2minutes
Figure 3 shows the curve: fast at first, when the gap is large, then slower as T nears 20∘C. The model never reaches 20∘C exactly; say so if asked about the long-term temperature.
Figure 3 · A cup of tea cooling: Newton's law of coolingFigure 4 · Carbon-14 decay: the fraction left halves every 5730 years
Example 7: warming
Milk at 4∘C is put in a kitchen at 24∘C and reaches 10∘C after 10 minutes.
Here T<24, so the same equation gives T=24+Ae−kt with A=−20. Then 24−20e−10k=10, so e−10k=0.7 and k=10ln(1/0.7)≈0.0357.
It reaches 18∘C when 20e−kt=6, that is t=kln(1/0.3)≈33.8 minutes. Keep k unrounded in the GDC: with 0.036 the answer shifts to about 33.4.
5Pattern for modelling questions
Most Paper 2 questions on this topic share a skeleton:
Write the equation from the description, often as a "show that".
Solve it, usually by separating.
Use two pieces of data to fix the two constants, one in the integration and one in the rate.
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,
dtdn=kn(a−n),a,k>0
makes growth proportional both to the population n and to the room left, a−n. While n is small it behaves like exponential growth. As n nears the carrying capacitya, growth stops. It is separable. The n-side integral needs partial fractions (1.11).
Example 8. A lake is stocked with 200 fish. The population N after t years is modelled by dtdN=0.0002N(2000−N). Find N in terms of t.
∫N(2000−N)1dN=∫0.0002dtN(2000−N)1=20001[N1+2000−N1]partial fractions20001[lnN−ln(2000−N)]=0.0002t+c0 < N < 2000, so no moduliln(2000−NN)=0.4t+c′multiply by 20002000−NN=Be0.4t;t=0,N=200⇒B=1800200=91N=1+9e−0.4t2000make N the subject, divide by e0.4t
What the equation says without solving:
Constant solutions.n=0 and n=a make the right-hand side zero. The population is stuck at zero or sitting at capacity.
Between them.dtdn>0, so the population climbs towards a.
Above capacity.dtdn<0, so it falls back towards a. Since a−n<0 there, keep the modulus ln∣a−n∣.
Either way n→a as t→∞.
Watch the sign: ∫2000−N1dN=−ln(2000−N), because the inside has derivative −1. That is why the answer has the form 1+Be−akta.
Figure 5 shows the S-shaped logistic curve. The population passes 1000, half the capacity, when 9e−0.4t=1, at t=0.4ln9≈5.49 years.
That is also where growth is fastest. 0.0002N(2000−N) is a quadratic in N with its maximum at N=1000, where the rate is 200 fish per year.
Figure 5 · Logistic growth levels off at the carrying capacity
7Homogeneous equations: the substitution y=vx
Some equations do not separate as they stand, but the right-hand side depends on x and y only through the ratio xy. Such an equation, dxdy=f(xy), is homogeneous.
Figure 6 shows the meaning. Along any straight line through the origin xy 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
The fix is to make the ratio the variable. Put v=xy, so y=vx. Differentiate by the product rule, remembering that v is itself a function of x:
Homogeneous: for dxdy=f(xy), put y=vx, so dxdy=v+xdxdv. The equation becomes v+xdxdv=f(v), which separates.
Example 9. Solve dxdy=2xyx2+3y2, for x>0, given y(1)=2.
To test for homogeneity, divide top and bottom by x2: the right-hand side is 2(y/x)1+3(y/x)2, a function of xy alone.
v+xdxdv=2v1+3v2xdxdv=2v1+3v2−v=2v1+v2∫1+v22vdv=∫x1dxnow separableln(1+v2)=lnx+c⇒1+v2=Axx2y2=Ax−1;x=1,y=2⇒A=5y2=5x3−x2,y=x5x−1positive root since y(1) > 0
The costliest slip comes in the first line: dxdy is notdxdv. It is v+xdxdv, and without that v the equation will not separate properly. Many "show that" questions award marks for exactly the line xdxdv=…, so always write it before integrating.
8Linear equations: the integrating factor
A linear first-order equation has the form
dxdy+P(x)y=Q(x)
with y and dxdy only to the first power.
The formula booklet gives the integrating factorI(x)=e∫P(x)dx. Multiply the whole equation by it. The left side becomes the derivative of a product, which integrates at once.
Why: I′=PI, so dxd(Iy)=Iy′+PIy=I(y′+Py).
Integrating factor: for y′+P(x)y=Q(x), multiply by I=e∫Pdx. Then dxd(Iy)=IQ, so Iy=∫IQdx. Add the constant before you divide by I.
Example 10. Solve dxdy+2xy=2xe−x2, given y(0)=3.
P=2x⇒I=e∫2xdx=ex2no constant needed in the integrating factorex2dxdy+2xex2y=2xdxd(yex2)=2xyex2=x2+Cy(0)=3⇒C=3,y=(x2+3)e−x2
Example 11: standard form first. Solve xdxdy−3y=x4 for x>0, given y(1)=0. The coefficient of dxdy must be 1, so divide by x before reading off P.
If a question says "show that I(x) is an integrating factor", do one of two things. Compute e∫Pdx and arrive at I. Or differentiate Iy by the product rule and show the result is I(dxdy+Py).
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 x grams of dye after t minutes, the dye entering is 1.5×5=7.5 g per minute. The dye leaving is 5×250x=0.02x g per minute. So dtdx=7.5−0.02x.
Then I=e0.02t, dtd(xe0.02t)=7.5e0.02t, xe0.02t=375e0.02t+C, and x(0)=20 gives C=−355. So x=375−355e−0.02t. In the long run x→375, which is 1.5g ÷ L in 250 L. (Separating the variables works equally well here.)
Back to Euler
The equation of Section 3, dxdy=x+y, is linear: dxdy−y=x, P=−1, I=e−x. Then dxd(ye−x)=xe−x.
Parts (5.16) gives ye−x=−xe−x−e−x+C, so y=Cex−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
If the question names the method ("use the substitution y=vx", "use an integrating factor"), use it. One equation can suit several methods: dxdy=xy (for x>0) is separable, linear and homogeneous at once, and every method gives y=Ax.
The booklet gives Euler's formula and the integrating factor. The separation and y=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.
Practice · 5.18 First-order differential equations