Skip to content
IB Diploma ProgrammeSL & HL

First order differential equations

Mathematics: Analysis and Approaches SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

First order differential equations notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full First order differential equations notes as text: skim, search, and jump between subtopics.

~15 min read

1. Euler's method

Euler's method gives a numerical solution of dy/dx = f(x,y) from a known starting point (x₀, y₀). Choose a constant step h. Each step follows the gradient at the current point.

The x values go up by the step: xn₊₁ = xn + h. The y values use the gradient at (xn, yn). Use the old values xn and yn in f, not the new ones.

Write down each intermediate value. The markscheme gives the first accuracy mark for at least two correct intermediate values to 3 significant figures. Keep the full values in the calculation.

xn₊₁ = xn + h

yn₊₁ = yn + h f(xn, yn)

Worked example 13 marks

Consider the differential equation dy/dx = 2x/(x² + y). The solution curve passes through the point (1, 0).

Use Euler's method with a step value of 0.25 to estimate the value of y when x = 2.

  1. 1

    attempt to use Euler's method with a step of 0.25: xn₊₁ = xn + 0.25 and yn₊₁ = yn + 0.25(2xn/(xn² + yn)), with x₀ = 1, y₀ = 0 (M1) [1]

  2. 2

    y₁ = 0 + 0.25 × 2/1 = 0.5, then y₂ = 0.803, y₃ = 1.05 at x = 1.25, 1.5, 1.75: at least two correct intermediate values (A1) [1]

  3. 3

    at x = 2: y = 1.26152… = 1.26 A1 [1]

2. Variables separable

A first order equation is variables separable when it can be written dy/dx = g(x) h(y). Move every y term to one side with dy and every x term to the other with dx.

Attempt to separate variables and form two integrals, then integrate each side.

Put in the constant of integration before you use the starting values. A markscheme withholds the method mark for the substitution if the constant is missing. Missing modulus signs in a logarithm are condoned until the final mark. By then they must be seen, or removed in a way that still gives a correct equation.

dy/dx = g(x) h(y) ⇒ int 1/(h(y)) dy = int g(x) dx

Worked example 16 marks

Find the solution of dy/dx = 2xy², given that y = 1 when x = 0. Give y in terms of x.

  1. 1

    attempt to separate variables: 1/y² dy = 2x dx (M1) [1]

  2. 2

    int y⁻² dy = -1/y (A1) [1]

  3. 3

    int 2x dx = x² + c, with the constant of integration (A1) [1]

  4. 4

    substitute x = 0, y = 1: -1 = 0 + c (M1) [1]

  5. 5

    c = -1, so -1/y = x² - 1 (A1) [1]

  6. 6

    y = 1/(1 - x²) (A1) [1]

3. Separable equations that need partial fractions

The logistic equation dn/dt = kn(a -n) is separable. After separating, the integrand 1/(n(a - n)) has a quadratic denominator. Recognise the need to use partial fractions to integrate it (AHL 1.11 and AHL 5.15).

Integrate each fraction as a logarithm. For a fraction with -n in its denominator, the sign flips: int 1/(3 - N) dN = -ln(3 - N).

Combine the logarithms, use the starting values with the constant present, and write the result in the form the question asks for. Condone missing modulus signs.

dn/dt = kn(a - n)

1/(n(a - n)) = 1/a(1/n + 1/(a - n))

Worked example 18 marks

He models N, the number (in thousands) of infected rabbits in the population, at time t days. Rowan models the spread of the infection by the differential equation dN/dt = k(-3 + 4N - N²), where t ≥ 0 and k ∈ R⁺. Initially, 1500 rabbits are infected.

From part (a), 1/(-3 + 4x - x²) = (1/2)/(x - 1) + (1/2)/(3 - x).

Hence, show that ln((N - 1)/(3 - N)) = 2kt - ln p, where p ∈ R⁺ is a constant to be determined.

  1. 1

    attempt to separate variables: int 1/(-3 + 4N - N²) dN = int k dt (M1) [1]

  2. 2

    recognise the need to use partial fractions: int (1/(2(N - 1)) + 1/(2(3 - N)))dN = int k dt (M1) [1]

  3. 3

    1/2ln(N - 1) A1 [1]

  4. 4

    -1/2ln(3 - N) A1 [1]

  5. 5

    right-hand side kt + c, with the constant of integration on either side A1 [1]

  6. 6

    multiply by 2: ln((N - 1)/(3 - N)) = 2kt + 2c A1 [1]

  7. 7

    substitute t = 0, N = 1.5 (thousands): ln0.5/1.5 = 2c. The constant must be present for this mark (M1) [1]

  8. 8

    ln1/3 = -ln 3, so ln((N - 1)/(3 - N)) = 2kt - ln 3 and p = 3 A1 [1]

4. Homogeneous equations and y = vx

A homogeneous differential equation has the form dy/dx = f(y/x). Use the substitution y = vx, where v is a function of x.

Then dy/dx = v + xdv/dx. Substitute, and the equation becomes separable in v and x. Attempt to separate variables and form two integrals.

If the integral in v is of the form derivative/function, the markscheme credits use of substitution or inspection to integrate. At the end, replace v by y/x.

y = vx ⇒ dy/dx = v + xdv/dx

xdv/dx = f(v) - v

Worked example 18 marks

Consider the homogeneous differential equation dy/dx = (x - y)/(x + y), where x > 0 and y ≠ -x. It is given that y = 0 when x = 2.

By using the substitution y = vx, show that the solution of the differential equation is x² - 2xy - y² = 4.

  1. 1

    dy/dx = v + xdv/dx, so xdv/dx + v = (x - vx)/(x + vx) = (1 - v)/(1 +v) (A1) [1]

  2. 2

    xdv/dx = (1 - v)/(1 +v) - v = (1 - 2v - v²)/(1 + v). Attempt to separate variables and form two integrals: int (1 + v)/(1 - 2v - v²) dv = int 1/x dx (M1) [1]

  3. 3

    int 1/x dx = ln x + c A1 [1]

  4. 4

    use of substitution or inspection to integrate: u = 1 - 2v - v² gives du/dv = -2(1 +v) (M1) [1]

  5. 5

    -1/2ln|1 - 2v - v²| = ln x + c A1 [1]

  6. 6

    replace v by y/x and remove the logarithms: x²(1 - 2y/x - y²/x²) = A, so x² - 2xy - y² = A A1 [1]

  7. 7

    attempt to substitute x = 2, y = 0 to find the constant: A = 4 (M1) [1]

  8. 8

    x²(1 - 2y/x - y²/x²) = 4 A1, so x² - 2xy - y² = 4 (AG) [1]

5. First order linear equations: the integrating factor

A first order linear equation has the form dy/dx + P(x) y = Q(x). The coefficient of dy/dx must be 1, so divide first if it is not.

Multiply every term by the integrating factor I(x) = e^(int P(x) dx). The left side becomes the derivative of the product I y.

Integrate both sides, include the constant of integration, then divide by I(x) so that every term of the answer, constant included, is divided.

I(x) = e^(int P(x) dx)

d/dx(I y) = I Q

Worked example 16 marks

Find the solution of xdy/dx + 2y = 4x, where x > 0, given that y = 3 when x = 1. Give y in terms of x.

  1. 1

    write in the form dy/dx + P(x) y = Q(x) by dividing by x: dy/dx + 2/x y = 4 (M1) [1]

  2. 2

    integrating factor I = e^(int 2/x dx) = e^(2lnx) = x² (A1) [1]

  3. 3

    multiply every term by I: x²dy/dx + 2xy = 4x², so d/dx(x²y) = 4x² (M1) [1]

  4. 4

    integrate both sides: x²y = 4/3x³ + c (A1) [1]

  5. 5

    substitute x = 1, y = 3: 3 = 4/3 + c, so c = 5/3 (M1) [1]

  6. 6

    y = 4/3x + 5/3x² (A1) [1]

Recap

  • Euler's method: xn₊₁ = xn + h and yn₊₁ = yn + h f(xn, yn). Use the old values in f. Write down intermediate values.
  • Separable: write dy/dx = g(x)h(y), so int 1/(h(y))dy = int g(x) dx. Add +c before using the starting values.
  • The logistic equation dn/dt = kn(a - n) needs partial fractions. Watch the sign of int 1/(a - n)dn.
  • Homogeneous: y = vx gives dy/dx = v + xdv/dx. The equation separates in v and x. Replace v by y/x at the end.
  • Linear: dy/dx + P y = Q has integrating factor e^(int P dx). Then d/dx(Iy) = IQ. Divide the constant by I too.
  • Paper 1 is non-calculator, so keep answers exact. Show every line: a bare answer may earn no marks.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State the formula that gives xn₊₁ in Euler's method with a constant step h.1 mark
    Answer
    1. xn₊₁ = xn + h (A1)

    Trap: The step h is added to x. The gradient f(xn, yn) is used only to find the new y.

  2. Do not use a calculator. Consider dy/dx = x + y, where y = 1 when x = 0. Use Euler's method with a step of 0.5 to estimate y when x = 1.3 marks
    Answer
    1. attempt to use Euler's method with h = 0.5 (M1)
    2. y₁ = 1 + 0.5(0 + 1) = 1.5 at x = 0.5 (A1)
    3. y₂ = 1.5 + 0.5(0.5 + 1.5) = 2.5, so y ≈ 2.5 (A1)

    Trap: Using the new x in the gradient gives y₁ = 1.75, not 1.5. Use xn and yn from the start of the step.

  3. Do not use a calculator. Solve dy/dx = 3y, where y > 0, given that y = 5 when x = 0. Give y in terms of x.4 marks
    Answer
    1. int 1/y dy = int 3 dx (M1)
    2. ln y = 3x + c (A1)
    3. substitute x = 0, y = 5: c = ln 5 (M1)
    4. y = 5e^(3x) (A1)

    Trap: y = e^(3x) + 5 adds the constant to y. The constant is added before the exponential, so it becomes a factor.

  4. Do not use a calculator. Solve dy/dx = y²/x, where x > 0, given that y = 1 when x = 1. Give y in terms of x.5 marks
    Answer
    1. attempt to separate variables: int 1/y² dy = int 1/x dx (M1)
    2. -1/y (A1)
    3. ln x + c (A1)
    4. substitute x = 1, y = 1: -1 = 0 + c (M1)
    5. -1/y = ln x - 1, so y = 1/(1 - ln x) (A1)

    Trap: int y⁻² dy = -1/y. Losing the minus sign gives y = 1/(1 + ln x).

  5. Do not use a calculator. Consider dy/dx = (x + y)/x, where x > 0 and y = 0 when x = 1. Use the substitution y = vx to find y in terms of x.5 marks
    Answer
    1. dy/dx = v + xdv/dx (A1)
    2. v + xdv/dx = 1 + v, so xdv/dx = 1 (A1)
    3. separate and integrate: int dv = int 1/x dx, so v = ln x + c (M1)
    4. substitute x = 1, v = 0: c = 0 (M1)
    5. y = xln x (A1)

    Trap: Taking dy/dx = v loses the xdv/dx term. The equation then never separates.

  6. Do not use a calculator. Use an integrating factor to solve dy/dx + 2y = 6, given that y = 0 when x = 0. Give y in terms of x.5 marks
    Answer
    1. integrating factor I = e^(int 2 dx) = e^(2x) (A1)
    2. d/dx(ye^(2x)) = 6e^(2x) (M1)
    3. ye^(2x) = 3e^(2x) + c (A1)
    4. substitute x = 0, y = 0: 0 = 3 + c, so c = -3 (M1)
    5. y = 3 - 3e^(-2x) (A1)

    Trap: Divide the constant by e^(2x) as well. The general solution is y = 3 + c e^(-2x), not y = 3 + c.

  7. Do not use a calculator. Consider dy/dx = (x² + y²)/2xy, where x > 0 and y > 0. It is given that y = 2 when x = 1. (a) Use the substitution y = vx to show that xdv/dx = (1 - v²)/2v. (b) Hence find y in terms of x.9 marks
    Answer
    1. (a)
    2. dy/dx = v + xdv/dx (A1)
    3. v + xdv/dx = (x² + v²x²)/(2x · vx) = (1 + v²)/2v (M1)
    4. xdv/dx = (1 + v²)/2v - v = (1 - v²)/2v (A1)(AG)
    5. (b)
    6. attempt to separate variables: int 2v/(1 - v²) dv = int 1/x dx (M1)
    7. -ln|1 - v²| (A1)
    8. ln x + c (A1)
    9. substitute x = 1, v = 2: -ln 3 = c (M1)
    10. ln|1 - v²| = ln3/x, so v² - 1 = 3/x (A1)
    11. y² = x² + 3x, so y = √(x² + 3x) (A1)

    Trap: At x = 1, 1 - v² = -3 is negative. Keep the modulus signs, or ln(1 - v²) does not exist.

  8. A cup of tea cools in a room at 20 °C. Its temperature T °C after t minutes satisfies dT/dt = -0.1(T - 20), where T = 80 when t = 0. (a) Use Euler's method with a step of 2 minutes to estimate T when t = 4. (b) Solve the differential equation to find T in terms of t.7 marks
    Answer
    1. (a)
    2. attempt to use Euler's method with h = 2 (M1)
    3. T₁ = 80 + 2 × (-0.1)(80 - 20) = 68 (A1)
    4. T₂ = 68 + 2 × (-0.1)(68 - 20) = 58.4, so T ≈ 58.4 °C (A1)
    5. (b)
    6. attempt to separate variables: int 1/(T - 20) dT = int -0.1 dt (M1)
    7. ln(T - 20) = -0.1t + c (A1)
    8. substitute t = 0, T = 80: c = ln 60 (M1)
    9. T = 20 + 60e^(-0.1t) (A1)

    Trap: The variable to integrate is T - 20, so int 1/(T - 20) dT = ln(T - 20), not ln T.

  9. Do not use a calculator. A rumour spreads through a school of 600 students. t hours after it starts, N hundred students have heard it, where dN/dt = 1/6N(6 - N) and 0 < N < 6. At t = 0, 100 students have heard the rumour. (a) Show that ln(N/(6 - N)) = t - ln 5. (b) Hence find an expression for N in terms of t. (c) Find the number of students who will have heard the rumour in the long term, according to the model.12 marks
    Answer
    1. (a)
    2. attempt to separate variables: int 1/(N(6 - N)) dN = int 1/6 dt (M1)
    3. recognise the need to use partial fractions: 1/(N(6 - N)) = 1/6N + 1/(6(6 - N)) (M1)
    4. 1/6ln N A1
    5. -1/6ln(6 - N) A1
    6. 1/6t + c A1
    7. multiply by 6 and substitute t = 0, N = 1 (not 100): ln(N/(6 - N)) = t + 6c, ln1/5 = 6c (M1)
    8. ln1/5 = -ln 5, so ln(N/(6 - N)) = t - ln 5 A1 (AG)
    9. (b)
    10. attempt to exponentiate: N/(6 - N) = (e^(t))/5 (M1)
    11. cross multiply and collect N: 5N + Ne^(t) = 6e^(t) (M1)
    12. N = (6e^(t))/(5 + e^(t)) = 6/(1 + 5e^(-t)) A1
    13. (c)
    14. as t → ∞, e^(-t) → 0, so N → 6 (M1)
    15. N is in hundreds: 600 students A1

    Trap: N counts hundreds: the start is N = 1, not 100, and the limit 6 means 600 students; the markscheme gives A0 for a limit left as 3 when it means 3000.

  10. Do not use a calculator. A tank holds 50 litres of pure water. Salt water flows in and the mixture flows out, so that after t minutes the tank holds 50 + t litres. The mass S grams of salt in the tank satisfies dS/dt = 6 - 2S/(50 + t), where S = 0 when t = 0. (a) Show that an integrating factor for the differential equation is (50 + t)². (b) Hence find S in terms of t. (c) Find the concentration of salt in the tank, in g L⁻¹, when t = 50.10 marks
    Answer
    1. (a)
    2. write in the form dS/dt + P(t) S = Q(t): dS/dt + 2/(50 + t) S = 6, so P(t) = 2/(50 + t) (M1)
    3. I = e^(int 2/(50 + t) dt) = e^(2ln(50 + t)) = (50 + t)² A1 (AG)
    4. (b)
    5. d/dt(S(50 + t)²) = 6(50 + t)² (M1)
    6. S(50 + t)² = 2(50 + t)³ + c, with the constant of integration A1
    7. substitute t = 0, S = 0: 0 = 2 × 125 000 + c (M1)
    8. c = -250 000 A1
    9. S = 2(50 + t) - (250 000)/((50 + t)²) A1
    10. (c)
    11. S = 2 × 100 - (250 000)/(10 000) = 200 - 25 = 175 g (M1)A1
    12. volume = 100 litres, so concentration = 175/100 = 1.75 g L⁻¹ A1

    Trap: Every term is divided by (50 + t)², constant included: dropping the constant gives S = 2(50 + t) and 200 g at t = 50, not 175 g.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
y = vx gives dy/dx = vdy/dx = v + xdv/dx, because v is a function of x
Substitute x and y to find c before the constant of integration is writtenThe constant of integration must be present before the substitution
int 1/(3 - N) dN = ln(3 - N)int 1/(3 - N) dN = -ln(3 - N), so the log term is -1/2ln(3 - N), with its minus sign
Update only y at each step of Euler's methodUpdate both: xn₊₁ = xn + h and yn₊₁ = yn + h f(xn, yn)

Frequently asked questions

How does Euler's method estimate a value from a differential equation?
Euler's method gives a numerical solution from a starting point (x₀, y₀) with a constant step h. Use xn₊₁ = xn + h and yn₊₁ = yn + h f(xn, yn), with the old values xn and yn in f. For dy/dx = x + y with y = 1 at x = 0 and h = 0.5, the steps give y = 1.5 at x = 0.5 and y ≈ 2.5 at x = 1.
How do you solve a separable differential equation?
Write the equation as dy/dx = g(x) h(y), then separate the variables so that int 1/(h(y)) dy = int g(x) dx. Put in the constant of integration before you use the starting values. For dy/dx = 2xy² with y = 1 at x = 0, the solution is y = 1/(1 - x²).
How do you solve a homogeneous differential equation using y = vx?
Use the substitution y = vx, so that dy/dx = v + xdv/dx. The equation then separates in v and x. At the end, replace v by y/x. For dy/dx = (x - y)/(x + y) with y = 0 when x = 2, the solution is x² - 2xy - y² = 4.
How do you use an integrating factor to solve a first order linear differential equation?
Write the equation as dy/dx + P(x) y = Q(x), then multiply every term by I(x) = e^(int P(x) dx), so the left side becomes d/dx(Iy). Integrate, include the constant, and divide every term by I. For xdy/dx + 2y = 4x with y = 3 at x = 1, the answer is y = 4/3x + 5/3x².
How do you integrate a logistic-type equation that needs partial fractions?
After separating the variables, the integrand 1/(n(a - n)) has a quadratic denominator, so use partial fractions and integrate each fraction as a logarithm. Keep the sign: int 1/(3 - N) dN = -ln(3 - N). Then use the starting values with the constant present. For the rabbit model this gives ln((N - 1)/(3 - N)) = 2kt - ln 3, so p = 3.
What mistakes do students make when solving differential equations with Euler's method or integration?
Euler's method has a trap: using the new x in the gradient. With h = 0.5 this gives y₁ = 1.75 instead of 1.5. Losing the minus sign when integrating y⁻² also gives the wrong answer: y = 1/(1 + ln x) instead of y = 1/(1 - ln x).

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters