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?
For dy/dx = x the Euler value after reaching x = −1 is below the exact value by exactly h, so the error is proportional to h: −0.05 becomes −0.40, which is 8 times larger.
Check it in the model: Move the Euler step h slider from 0.05 to 0.40 and compare the Euler error readout (−0.05 then −0.4).
slope field Euler solution exact solution (dashed)
gradient at a point: dy/dx = f(x, y)
drag the white point, or use the x₀ and y₀ sliders
Try this
- 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?
- 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.
- 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.
More on 5: Chain and product rules · Second derivative and points of inflexion · Trapezoidal rule and Riemann sums · Displacement and distance travelled · Euler's method and differential equations · Implicit differentiation · Related rates of change · Area under a curve · Calculus of motion · Limits · Maclaurin series · Newton–Raphson method (enrichment) · Optimisation · Tangents and the derivative · Volume of revolution