b2KIT

Slope Field Visualizer

Draw slope fields for first-order ODEs dy/dx=f(x,y). Click to trace solution curves and compare with exact solutions.

Tested tool guide Tested browser tools Checked August 16, 2026

What Slope Field Visualizer does, with a checked example

A differential equation such as dy/dx = -y can be read before it is solved. At every point of a grid the tool draws a short segment whose slope equals f(x, y): the slope field. Solution curves run tangent to these segments, and clicking anywhere steps a numerical solution curve through the point you chose. Most users are surprised by two things: the traced curves are approximations, not exact solutions, and where f(x, y) is undefined - a division by zero, say - the field goes blank and curves can blow up or stop in ways the picture cannot show.

Worked example

A concrete input and expected output from the current implementation.

Input

dy/dx = x, then click the point (2, 3)

Expected output

Every segment in the column x = 2 has slope 2, and every segment in the column x = 1 has slope 1; along the y-axis the segments are horizontal. Clicking at (2, 3) traces the parabola y = x^2/2 + 1, which passes through (2, 3) since 4/2 + 1 = 3. Entering y = x^2/2 + 1 as an exact solution overlays the traced curve exactly.

For dy/dx = x the slope depends only on x, so the field repeats down each vertical column and the isoclines are the vertical lines x = k. Antidifferentiating gives the family y = x^2/2 + C; the curve through (2, 3) fixes C = 3 - 2 = 1.

How the result is produced

1

Reading the grid

The tool evaluates f(x, y) at each grid point and draws a short segment with that slope, centered on the point. Only the angle varies; length and density are fixed, so a field of steep segments means the derivative is large there. The curves where f(x, y) = k are isoclines - the field's constant-slope lines - and they help you sketch solutions by hand.

2

Tracing a curve

Clicking anywhere seeds a solution curve: the tool steps a numerical approximation through the field, using the local segment slope as the derivative at each step, and joins the steps into a curve. Where f is smooth, solution curves of dy/dx = f(x, y) cannot cross, so tracing several starting points shows a family of non-intersecting curves that fill the plane.

Good uses

  • Read an equation's behavior before solving it: for dy/dx = y(1 - y), click just above 0 and just below 1; both traced curves converge on y = 1, showing it is the stable equilibrium and 0 is not, with no algebra.
  • Check a candidate exact solution: enter dy/dx = -2xy, click at (0, 1), and compare the trace with the exact curve y = e^(-x^2); an overlay that matches confirms the antiderivative.
  • Practice or teach sketching: generate the field for an assigned equation such as dy/dx = x + y, sketch what you believe the curves do, then click to trace and grade your own sketch.

Limits and checks

  • Traced curves are approximations: the tool steps through the field with a finite step size, so error accumulates with distance from the click point, fastest where the field is steep or changes quickly. Curves that leave the viewing window are cut off rather than finished, and a curve traced from a slightly different point is a different solution, not a better version of the first.
  • Blank areas mark singular behavior, not empty space: the tool draws no segment where f(x, y) is undefined, and solutions need not exist or stay finite there. For dy/dx = 1/x the field is blank on x = 0 and every solution y = ln|x| + C tends to negative infinity as x approaches 0 from the right, so a curve traced near the gap legitimately ends.
  • Isoclines are not solutions: the constant-slope curves f(x, y) = k are sketching aids, and they solve f = k, not dy/dx = f, so tracing an isocline by eye can produce a curve no solution follows. A plain slope field also carries no arrowheads, so the picture alone does not say which way along a curve x increases.

Common questions

The traced curve and the exact solution I entered do not match. Which is wrong?

Probably neither: the trace is a numerical approximation built from finite steps, so it drifts from the true solution as it moves away from the click point, most where the field changes fast. First make sure the exact curve passes through the point you clicked - a solution is fixed by its initial condition, and curves with different constants never coincide. If they still diverge, the gap is approximation error, not a bug.

Why is the grid blank along a line, and why does my traced curve stop there?

The tool draws no segment where f(x, y) is undefined, and solutions often cannot be continued smoothly across such a line. For dy/dx = 1/x the field is empty at x = 0 and the solutions y = ln|x| + C go to negative infinity as x approaches 0 from the right: the gap is the singular point itself. Curves crowd the gap without crossing it.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools