A first-order differential equation dy/dx = f(x, y) gives a slope at every point of the plane. Draw those slopes and the solutions become visible before any algebra: they are the curves that follow the arrows.
Start with the direction field
At each point of a grid, draw a short segment with slope f(x, y). For dy/dx = x − y, the segments are flat along the line y = x and every solution bends towards y = x − 1, which is itself a solution. Ask the class to sketch a curve through a starting point before you reveal it: they usually get it right, and that is the point.
Euler's method, one step at a time
Euler's method turns the picture into arithmetic. From (x₀, y₀), move a step h along the slope:
y₁ = y₀ + h · f(x₀, y₀) x₁ = x₀ + h
For dy/dx = y with y(0) = 1 and h = 0.5, the steps give 1, 1.5, 2.25, 3.375, 5.06… while the exact solution eˣ gives 1, 1.65, 2.72, 4.48, 7.39. The method always lags here, because the slope keeps growing during each step and Euler uses the slope at its start.

Systems and the phase plane
A pendulum needs two equations: angle x and angular velocity y, with x′ = y and y′ = −sin x − c·y when there is friction. Plotting y against x gives the phase plane: the swings spiral into the resting position, and with enough energy the pendulum goes over the top instead.

Build it in Tracé
- Open Plot → Differential equation.
- Type
x - yafter dy/dx =, and a few starting points, onex, yper line. - Animate Solutions drawn so far from 0 to 1 on a click: the curves trace themselves along the field.
- For Euler, choose Euler’s method, step by step, set Euler step h and press Reveal one Euler step per click. Keep Show the exact solution, dashed on for the comparison.
- For a phase plane, switch Equation to the system form.
Questions
Which solver draws the curves?
A fourth-order Runge–Kutta method with a small step, accurate enough that the curves are what you would get exactly.
Can I show a second-order equation like y″ = −y?
Write it as a system: x′ = y, y′ = −x. The phase plane then shows circles, the trajectories of a harmonic oscillator.
More: Animated math slides for teachers · How to create math slides, step by step


