Slope field generator
Type a differential equation dy/dx = f(x, y) and see its slope field at once: a short segment at each grid point with the slope the equation prescribes. Click anywhere to draw the solution curve through that point.
How to use the slope field generator
- 1Type the equation with
dy/dx =on the left, for exampledy/dx = x - y. The field appears immediately. - 2Click the graph to add a solution curve through that point. Drag a curve’s starting dot to move it.
- 3Zoom and pan as with any graph: the segments are redrawn for the new window.
- 4For a system, write both equations on one line,
dx/dt = y, dy/dt = -x, to get a phase portrait. - 5Use letters such as k in the equation and accept the slider to see how the field changes.
What a slope field shows
A first-order differential equation dy/dx = f(x, y) doesn’t tell you y directly. It tells you the slope of the solution at every point. A slope field draws that information: at each point of a grid, a short segment is drawn with slope f(x, y).
A solution curve is a curve that is tangent to the segments everywhere it goes, so you can sketch one by following the segments like a current. Different starting points give different solutions, and the field shows all of them at once.
- Equilibria: if f(x, y) = 0 along a horizontal line y = c, that line is a constant solution. For dy/dx = y(1 − y), the lines y = 0 and y = 1 are equilibria.
- Isoclines: curves where f(x, y) is constant have segments that are all parallel. For dy/dx = x − y, each line y = x − c has slope c.
Matching an equation to its slope field
A common exam question shows a slope field and asks which equation produced it. These checks settle most of them:
- If the segments are the same along every vertical line, f depends only on x (for example dy/dx = x²).
- If they are the same along every horizontal line, f depends only on y (for example dy/dx = y − 1).
- Find where the segments are flat. Those points satisfy f(x, y) = 0.
- Check the sign in one quadrant. If segments rise in the first quadrant, f(x, y) > 0 there.
For a full walkthrough, including drawing one by hand, read how to draw a slope field.
How the solution curves are computed
Solutions are integrated with the Dormand–Prince Runge–Kutta method, a fifth-order scheme that estimates its own error at every step and shrinks the step where the solution changes quickly. Curves are followed by arc length rather than by x, so a solution that turns vertical, like the circles of dy/dx = −x/y, is traced around instead of stopping. Integration stops cleanly where the solution leaves the window or blows up.
Examples to try
dy/dx = -x/ydx/dt = y, dy/dt = -sin(x) - 0.25yFrequently asked questions
What is a slope field?
How do I draw a slope field by hand?
How do I match a differential equation to its slope field?
Can it draw phase portraits for systems of equations?
How accurate are the solution curves?
Related tools and guides
2D and 3D fields with divergence, curl and line integrals.
Surfaces, implicit and parametric 3D graphs, exportable for 3D printing.
Curves (x(t), y(t)) in 2D and 3D.
It opens instantly, with no account and nothing to install.