Differential equations – slope fields, particular solutions and Euler's method
MathematicsCalculusAges 17–18
Loading…
Sign in to playChoose dy/dx = f(x, y) (exponential growth or decay, y′ = ay + b, logistic growth, Newton's law of cooling, x + y, xy, −x/y, x) and see its slope field; click to draw the particular solution through that point, with the working by separation of variables. The Euler's method screen takes steps of size h and compares each value with the exact solution in an error table, also for h/2. The Coupled system screen applies Euler's method to dx/dt, dy/dt (predator–prey, centre, spiral, saddle).
Lesson: First-order differential equations: slope fields, separation of variables and Euler's method
What it shows
A first-order differential equation dy/dx = f(x, y) gives a gradient at every point; the slope field draws these as short segments, and every solution curve is tangent to them. Exact solutions come from formulas found by separating the variables (an integrating factor for dy/dx = x + y), so the particular solution through any initial point is drawn exactly. Euler's method follows the tangent for a step h: yₙ₊₁ = yₙ + h·f(xₙ, yₙ); its error is roughly proportional to h. For coupled systems the reference path is computed with RK4. The cooling model assumes a constant surrounding temperature.
How to use
On Slope field, choose an Equation and click or tap the graph to draw the solution through that point; tick Isocline dy/dx = 0 to see where the gradient is zero. On Euler's method, set h and n, then press Step ▶ to take one step at a time or ▶ Run to animate, and compare the table with the exact solution. On Coupled system, choose a System and click a starting point. Reset restores the starting values.
Parameters you can change
- Screen Slope field, Euler's method, Coupled system
- Differential equation dy/dx = ky (exponential growth or decay), dy/dx = ay + b, dy/dx = ky(1 − y/L) (logistic growth), dT/dt = −k(T − Tₐ) (Newton's law of cooling), dy/dx = x + y, dy/dx = xy, dy/dx = −x/y, dy/dx = x
- Coefficient k (a for y′ = ay + b) of the chosen equation -2–2
- Second constant: b, carrying capacity L or surrounding temperature Tₐ (°C) -5–40
- Initial condition: x₀ (t₀ for cooling) -5–40
- Initial condition: y₀ = y(x₀) (T₀ for cooling) -5–100
- Step size h (Euler's method screen) 0.05–10
- Number of steps n (Euler's method screen) 1–40
- Show the exact solution (Euler and system screens)
- Show the isocline dy/dx = 0 (Slope field screen)
- System (Coupled system screen) Predator–prey (Lotka–Volterra), x′ = y, y′ = −x (centre), x′ = y, y′ = −x − 0.5y (spiral), x′ = x + y, y′ = 4x + y (saddle)
- Step size h for the system 0.01–0.5
- Number of steps for the system 1–200
Questions to explore
- For dy/dx = x + y with y(0) = 1, why does Euler's method always underestimate the exact solution?
- How does the error of Euler's method at a fixed x change when the step size h is halved?
- For the system x′ = y, y′ = −x, why does the Euler path spiral outwards instead of closing?