Free access until 31 December 2026 · Physics and Maths questions and notes, updated continuously · Build a test

5 · IB Maths

Slope fields

A differential equation gives the gradient at every point of the plane. Drag a starting point, follow the solution curve through the field with Euler’s method and compare it with the exact solution.

Predict first

Start from the default settings (dy/dx = x, start at (−3, 1), h = 0.05, exact solution shown). Raise the Euler step h to 0.40. How does the Euler error at x = −1 change?

slope field Euler solution exact solution (dashed)

Euler: y(n+1) = yₙ + h f(xₙ, yₙ), x(n+1) = xₙ + h
gradient at a point: dy/dx = f(x, y)
drag the white point, or use the x₀ and y₀ sliders

Try this

  1. Choose dy/dx = −x ÷ y and drag the starting point around. What shape do the solution curves have, and what does the exact curve confirm?
  2. Choose dy/dx = x with the start at (−3, 1). Raise h from 0.05 to 0.40 and watch the Euler error readout grow.
  3. Choose the logistic equation and start at y₀ = 0.2, then at y₀ = 1.5. Which value does every curve approach?

Common error: Euler’s method steps along the tangent, so a large h drifts away from the true curve; halving h roughly halves the error, which is why a smaller step is needed for a better estimate.