This whole subtopic is higher level. Nothing in it is on an SL paper.
Educerie · IB Diploma · Mathematics: analysis and approaches
Topic 5 Calculus · 5.18 First-order differential equations
What you must be able to do
| You must be able to | Level | What it looks like in the exam |
|---|---|---|
| Say what a first-order differential equation and its general and particular solutions are | HL only | "Verify that y = … satisfies the differential equation" (2 to 3 marks) |
| Use Euler's method, xn+1 = xn + h, to estimate a value of y | HL only | "Use Euler's method with h = 0.1 to find an approximation for y(0.3)" (4 marks), or many steps on the GDC |
| Say whether an Euler estimate is too high or too low, and how to improve it | HL only | "Explain why …"; reason from the concavity, or reduce h (1 to 2 marks) |
| Solve a separable equation, including the logistic equation dn/dt = kn(a − n) with partial fractions | HL only | "Solve the differential equation, given that y = 2 when x = 0" (6 to 8 marks) |
| Solve a homogeneous equation dy/dx = f(y/x) with the substitution y = vx | HL only | "Use the substitution y = vx to show that …, hence solve" (7 to 9 marks) |
| Solve y′ + P(x)y = Q(x) with an integrating factor | HL only | "Find the integrating factor, hence find y in terms of x" (6 to 7 marks) |
| Set up and use models: Newton's law of cooling, growth and decay (carbon dating), logistic growth | HL only | Paper 2: find the constants from data, then predict (6 to 10 marks) |
Before you start
You need the integration of 5.10 and 5.15 (especially ∫ 1/y dy = ln|y|), the substitution and parts of 5.16, partial fractions from 1.11, and exponential and logarithm rules from 1.7 and 2.9. The formula booklet gives Euler's method and the integrating factor e∫P(x) dx; it does not give the three methods of solving, so those you learn here.
1The idea in one paragraph
A differential equation is an equation that contains a derivative. A first-order one contains dy/dx and no higher derivative, and it tells you the gradient of the unknown curve at every point: dy/dx = x + y says that at (1, 2) the curve is climbing with gradient 3. Solving it means finding the curve, y as a function of x. Because many curves can obey the same gradient rule, the answer at first contains an arbitrary constant: that is the general solution, a whole family of curves. An initial condition such as y(0) = 1 picks out one member, the particular solution. This page gives you three exact methods, each for a particular shape of equation (separable, homogeneous, linear), and one numerical method, Euler's, which works on any equation but gives numbers, not a formula.
2What a solution looks like
Figure 1 draws the gradient rule dy/dx = x + y as a field of short slope marks: at each point, a mark with the gradient the equation demands there. Any curve that follows the marks is a solution. There are infinitely many, y = Ceˣ − x − 1 for every constant C, and the condition y(0) = 1 picks out C = 2.
You can always check a claimed solution by substituting it. For y = 2eˣ − x − 1: dy/dx = 2eˣ − 1, and x + y = x + 2eˣ − x − 1 = 2eˣ − 1. The two sides match for every x, and y(0) = 2 − 0 − 1 = 1. That is a complete verification, and a "verify" or "show that y = … is a solution" question wants exactly those lines.
3Euler's method
When no exact method works, you can still walk along the slope field. Start at the known point. The equation tells you the gradient there. Take a small step of width h along the tangent line, arrive at a new point, work out the new gradient, step again. The formula booklet writes each step as
Euler's method: yn+1 = yn + h × f(xn, yn), with xn+1 = xn + h, for dy/dx = f(x, y). New y = old y + step × gradient at the old point.
Example 1 (Paper 1). For dy/dx = x + y with y(0) = 1, use Euler's method with h = 0.1 to estimate y(0.3).
Three steps reach x = 0.3, because 0.3 ÷ 0.1 = 3. Lay the working out as a table like this, one row per step; a mistake in one row then costs one mark, not all of them.
Is the estimate too big or too small? The true value, from the exact solution in Figure 1, is y(0.3) = 2e0.3 − 1.3 ≈ 1.400. Euler's estimate is too low. Figure 2 shows why: each step follows the tangent at the start of the step, and this curve is concave up (it bends upwards), so the tangent always lies below it. For a concave-down curve the steps overshoot instead. That is the reasoning an "explain" question wants.
Making it better. A smaller step keeps each tangent line 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 you run many steps with the GDC's sequence mode or a spreadsheet: set x and y as two recursive sequences, xn+1 = xn + 0.1 and yn+1 = yn + 0.1(xn + yn), and read off the row you need.
4Separating the variables
An equation is separable when dy/dx can be written as a function of x times a function of y: dy/dx = g(x)h(y). Move all the y to the left with the dy, all the x to the right with the dx, and integrate both sides.
Separable: dy/dx = g(x) h(y) → ∫ 1/h(y) dy = ∫ g(x) dx, with one constant, added on the x side.
Example 2. Solve dy/dx = 3x²y, given that y = 2 when x = 0.
Two points of technique. One constant is enough: a constant on each side combines into one. And turning ln|y| = x³ + c into y = Aex³ is where many students slip; write ex³ + c = ec × ex³ as a line.
Exponential growth and decay, and carbon dating. The simplest separable model is dN/dt = kN: the rate of change is proportional to the amount present. Separating gives N = N₀ekt. With k > 0 it is growth; with k = −λ < 0 it is decay. Carbon-14 decays this way with a half-life of 5730 years, so e−5730λ = ½ and λ = ln 2 ÷ 5730 ≈ 1.21 × 10⁻⁴ per year. A bone that has 30% of the carbon-14 it had when alive satisfies e−λt = 0.3, so t = ln(10/3) ÷ λ ≈ 9950 years (Figure 4). The same equation describes decay curves in physics and first-order reactions in chemistry.
Newton's law of cooling. An object cools at a rate proportional to the difference between its temperature T and the surrounding temperature. In symbols, dT/dt = −k(T − Ts), with k > 0.
Example 3 (Paper 2). Tea at 90 °C is left in a room at 20 °C. After 5 minutes it is at 60 °C. Assuming Newton's law of cooling, find when it reaches 40 °C.
Figure 3 shows the curve: fast cooling at first, when the gap is large, then slower and slower as T approaches 20 °C. The model never reaches 20 °C exactly; say so if asked about the long-term temperature.
5The logistic equation
Exponential growth goes on for ever. Real populations run out of food or space. The logistic equation, named in the guide,
says that growth is proportional both to the population n and to the room left, a − n. When n is small it behaves like exponential growth; as n approaches the carrying capacity a, growth stops. It is separable, and the integral on the n side needs partial fractions (1.11).
Example 4. A lake is stocked with 200 fish. The population N after t years is modelled by dN/dt = 0.0002N(2000 − N). Find N in terms of t.
Watch the sign in the partial fractions: the integral of 1/(2000 − N) is −ln(2000 − N), because the inside has derivative −1. Figure 5 shows the S-shaped logistic curve. The population passes 1000, half the carrying capacity, when 9e−0.4t = 1, at t = ln 9 ÷ 0.4 ≈ 5.49 years. That is also where it grows fastest: the rate 0.0002N(2000 − N) is a quadratic in N with its maximum at N = 1000, where it is 200 fish per year.
6Homogeneous equations: the substitution y = vx
Some equations cannot be separated as they stand, but the right-hand side depends on x and y only through the ratio y/x. Such an equation, dy/dx = f(y/x), is called homogeneous. Figure 6 shows what that means: on every straight line through the origin, y/x is constant, so the gradient is the same all along the line.
The fix is to make that ratio the new variable. Put v = y/x, so y = vx. Differentiate with the product rule, remembering that v is a function of x:
Homogeneous: for dy/dx = f(y/x), put y = vx, so dy/dx = v + x dv/dx. The equation becomes v + x dv/dx = f(v), which separates.
Example 5. Solve dy/dx = (x² + y²)/(xy), for x > 0, given that y = 2 when x = 1.
Check it is homogeneous: dividing top and bottom by x² gives (1 + (y/x)²)/(y/x), a function of y/x.
The step that loses the most marks is the second line of the working: dy/dx is not dv/dx. It is v + x dv/dx, from the product rule, and without the extra v the equation will not separate properly.
7Linear equations: the integrating factor
A linear first-order equation can be written
with y and dy/dx appearing only to the first power. Multiply the whole equation by the integrating factor I(x) = e∫P(x) dx, from the formula booklet. The left-hand side then becomes the derivative of a product, I(x) × y, which you can integrate directly. It works because I′ = P × I, so by the product rule d/dx(Iy) = Iy′ + PIy = I(y′ + Py).
Integrating factor: for y′ + P(x)y = Q(x), multiply by I = e∫P dx. Then d/dx(I y) = I Q, so I y = ∫ I Q dx. Add the constant before you divide by I.
Example 6. Solve dy/dx + 2y = e−x, given y(0) = 3.
Example 7: get it into the standard form first. Solve x dy/dx + 2y = x² for x > 0, given y(1) = 1. The coefficient of dy/dx must be 1, so divide by x before finding P.
Simplify e2 ln x to x² every time; it is where the integrating factor usually comes out neat.
Back to Euler. The equation of section 3, dy/dx = x + y, is linear: dy/dx − y = x, with P = −1 and I = e−x. Then d/dx(ye−x) = xe−x, and integration by parts (5.16) gives ye−x = −xe−x − e−x + C, so y = Ceˣ − x − 1, with C = 2 from y(0) = 1. That is the exact solution drawn in Figures 1 and 2, and the reason we could measure Euler's error.
8Which method?
Figure 7 turns the choice into four questions. Try them in order: separation is the quickest when it applies, and Euler is the fallback, or the method a question names.
A question often names the method ("use the substitution y = vx", "use an integrating factor"); then use it. The same equation can suit more than one method: dy/dx = −2y is separable, linear and homogeneous at once, and every method gives y = Ae−2x.
9Where marks are lost
Writing dy/dx = dv/dx after y = vx. The product rule gives dy/dx = v + x dv/dx. Missing the v makes the rest worthless.
Adding the constant too late. In ln|y| = x³ + c the constant goes in at the integration step. Adding it after exponentiating, as y = ex³ + c, is a different, wrong family of curves. With an integrating factor, add C before dividing by I.
Separating by adding instead of multiplying. dy/dx = x + y does not separate into ∫ dy = ∫ x dx + ∫ y dx. Separation needs a product g(x)h(y).
Losing the minus sign in ∫ 1/(a − n) dn. It is −ln|a − n|, which is why the logistic solution has the form a/(1 + Be−akt).
Not dividing through before the integrating factor. For x y′ + 2y = x², P is 2/x, not 2.
Wrong number of Euler steps, or the gradient at the wrong point. From x = 0 to 0.3 with h = 0.1 is three steps, and each step uses f at the start of the step, not the end.
Using the unrounded constant too late on Paper 2. Store k from the data in the GDC and use the stored value. Rounding k to 0.11 before predicting moves the answer.
10Work it right
- Identify the type (separable, homogeneous, linear) before writing, or use the method the question names.
- Separable: rearrange so each side has one variable, integrate both sides, one constant, then use the initial condition.
- Homogeneous: write y = vx and dy/dx = v + x dv/dx as two lines, substitute, simplify to x dv/dx = …, separate.
- Linear: divide so dy/dx has coefficient 1, name P(x), find I = e∫P dx and simplify it, write d/dx(Iy) = IQ, integrate with + C, then divide.
- Euler: a table with columns n, xn, yn, f(xn, yn), yn+1; count the steps first.
- Models: write the differential equation from the words ("proportional to" means = k × …), solve it, find the constants from the data, then answer in context with units.
- Check a solution by substituting it into the equation, or on Paper 2 compare with an Euler run.
11Try it
Marks in brackets. Q1 to Q4 are Paper 1 style, no calculator. Q5 is Paper 2 style, with a GDC.
Q1. The curve y = f(x) satisfies dy/dx = y − x², with y = 1 when x = 0. Use Euler's method with a step length of 0.2 to find an approximate value for y when x = 0.4. 4 marks
Q2. Solve the differential equation dy/dx = (1 + y²) cos x, given that y = 1 when x = 0. Give y in terms of x. 6 marks
Q3. Consider dy/dx = (y² + 2xy)/x², for 0 < x < 2, with y = 1 when x = 1.
(a) Use the substitution y = vx to show that x dv/dx = v² + v. 3 marks
(b) Hence, using partial fractions, show that y = x²/(2 − x). 6 marks
Q4. Solve dy/dx + y tan x = sec x, for −π/2 < x < π/2, given that y = 2 when x = 0. 6 marks
Q5. The number of users N, in thousands, of a new app t weeks after its launch is modelled by dN/dt = kN(50 − N), where k is a positive constant. At launch N = 2, and after 3 weeks N = 20.
(a) Show that N = 50/(1 + 24e−50kt). 5 marks
(b) Find the value of k. 2 marks
(c) Find the number of users predicted after 5 weeks. 2 marks
(d) Find the time at which the number of users is increasing most rapidly. 2 marks
12In one breath
A first-order differential equation gives dy/dx as a rule, and solving it finds y: the general solution is a family of curves with one constant, and an initial condition picks the particular one. Euler's method walks along tangent lines, yn+1 = yn + h f(xn, yn), a table row per step; it undershoots a curve that bends up and overshoots one that bends down, and a smaller h does better. For exact solutions, separate dy/dx = g(x)h(y) into ∫ dy/h(y) = ∫ g(x) dx with one constant; that handles growth and decay (carbon dating), Newton's cooling dT/dt = −k(T − Ts), and the logistic dn/dt = kn(a − n) with partial fractions. A homogeneous equation dy/dx = f(y/x) separates after y = vx, with dy/dx = v + x dv/dx. A linear equation y′ + P(x)y = Q(x) is solved by multiplying by e∫P dx, so that the left side becomes (Iy)′. Find constants from data, keep them unrounded, and answer in context.
Answers
Q1. f(x, y) = y − x². Step 1: y₁ = 1 + 0.2(1 − 0) = 1.2 at x₁ = 0.2. Step 2: y₂ = 1.2 + 0.2(1.2 − 0.04) = 1.2 + 0.232 = 1.432 at x₂ = 0.4. So y(0.4) ≈ 1.43. M1 for a correct first step using f(0, 1), A1 for 1.2, M1 for a second step using f(0.2, their y₁), A1 for 1.432 or 1.43.
Q2. Separate: ∫ 1/(1 + y²) dy = ∫ cos x dx, so arctan y = sin x + C. At x = 0, y = 1: arctan 1 = π/4 = 0 + C. So arctan y = sin x + π/4, and y = tan(sin x + π/4). M1 for separating the variables, A1 for arctan y, A1 for sin x, M1 for using the initial condition, A1 for C = π/4, A1 for y in terms of x.
Q3. (a) y = vx gives dy/dx = v + x dv/dx. The right side is (v²x² + 2vx²)/x² = v² + 2v. So v + x dv/dx = v² + 2v, and x dv/dx = v² + v. A1 for v + x dv/dx, M1 for substituting y = vx into the right side, A1 for the given result, AG. (b) ∫ 1/(v(v + 1)) dv = ∫ 1/x dx. Partial fractions: 1/(v(v + 1)) = 1/v − 1/(v + 1). So ln v − ln(v + 1) = ln x + c, that is v/(v + 1) = Ax. At x = 1, y = 1, so v = 1 and A = ½. Then 2v = x(v + 1), v(2 − x) = x, v = x/(2 − x), and y = vx = x²/(2 − x). M1 for separating, A1 for the partial fractions, A1 for ln v − ln(v + 1) = ln x + c, M1 for using the condition to find the constant, M1 for rearranging for v, A1 for the given answer, AG.
Q4. P = tan x, so ∫ tan x dx = −ln(cos x) = ln(sec x), valid as cos x > 0 here, and I = sec x. Then d/dx(y sec x) = sec²x, so y sec x = tan x + C, and y = sin x + C cos x. With y(0) = 2: 2 = 0 + C, so y = sin x + 2 cos x. M1 for the integrating factor as e∫tan x dx, A1 for sec x, M1 for d/dx(y sec x) = sec x × sec x, A1 for tan x + C, M1 for using y(0) = 2, A1 for the answer.
Q5. (a) Separate and use partial fractions: 1/(N(50 − N)) = (1/50)(1/N + 1/(50 − N)). So (1/50)(ln N − ln(50 − N)) = kt + c, giving N/(50 − N) = Be50kt. At t = 0, N = 2: B = 2/48 = 1/24. Then 24N = (50 − N)e50kt, so N(24 + e50kt) = 50e50kt, and dividing by e50kt gives N = 50/(1 + 24e−50kt). M1 for separating, M1 for partial fractions, A1 for the log equation, M1 for using N(0) = 2, A1 for rearranging to the given form, AG. (b) 20 = 50/(1 + 24e−150k), so 1 + 24e−150k = 2.5, e−150k = 1/16, and k = ln 16 ÷ 150 = 0.0185 (3 s.f.). M1 for substituting t = 3, N = 20, A1 for 0.0185. (c) N(5) = 50/(1 + 24e−250k) = 40.4 thousand users (3 s.f.), about 40 400. M1 for substituting t = 5 with their k, A1 for 40.4. Using k = 0.018 gives 39.5, which loses the A1. (d) The rate kN(50 − N) is greatest when N = 25. Then 24e−50kt = 1, so t = ln 24 ÷ (50k) = 3.44 weeks (3 s.f.). M1 for N = 25, half the carrying capacity, or for maximising dN/dt, A1 for 3.44.
Educerie · written from the published IB Diploma Programme Mathematics: analysis and approaches guide, first assessment 2021, section AHL 5.18 First-order differential equations. Original text, examples and questions. Diagrams drawn by Educerie. Last reviewed 25 September 2026.