Skip to content

Slope field generator

Type dy/dx in terms of x and y and the direction field is drawn as you type. Add starting points to trace the solution curves through it.

  • Free, no sign-up
  • Runs in your browser
  • PNG and SVG export

Differential equation

Use x and y, such as x - y, y(1 - y) or sin(x) + y/2. Write t instead of x if your equation is dy/dt.

Window

Draw as
Segment color

Solution curves

One initial condition per line, as x, y. For y(0) = 2 type 0, 2. Leave empty for the field alone.

Style

Background

Preview

How to

How to make a slope field

A slope field shows what a differential equation does before you solve it. Type the right side of dy/dx, choose the window, and every segment is drawn at the slope the equation gives at that point. Add starting points to trace exact solution curves through the field, then download the picture as PNG or SVG for notes, slides or a worksheet.

  1. Type the equation. Enter the right side, such as x - y. Products can be written as xy or x*y, powers as x^2. Or start from one of the examples.
  2. Set the window. Choose the x and y ranges. The grid of segments adapts to the shape of the image, and the slider sets how many segments go across.
  3. Add initial conditions. Each line under Solution curves, like 0, 2, draws the particular solution through that point.
  4. Export. Download a PNG for slides and documents or an SVG to edit in Illustrator, Inkscape or Figma. Copy link saves the equation and settings in the address.

Reading a slope field

Flat segments mark where dy/dx = 0: solutions have a peak, a dip or a level stretch there. If a whole row is flat, like y = 0 for dy/dx = y, that row is an equilibrium solution. Segments that point toward an equilibrium from both sides show a stable one; segments pointing away show an unstable one. Choose By slope to color rising segments blue and falling ones orange, which makes those regions easy to see.

How the solution curves are drawn

From each starting point the curve is integrated forward and backward with the fourth order Runge Kutta method in 600 steps across the window, and stops where the slope is undefined or the curve leaves the picture far above or below. That is precise enough to show how solutions behave, but it is a numerical sketch, not a formula. For the formula itself, solve the equation by separation of variables or an integrating factor.

For worksheets

Clear the starting points and choose a light gray field color. Students can then sketch their own solution curves on the printout. A square image with the same range on both axes keeps the angles true.

Related tools

To graph y as a function of x, with roots, sliders and tables, use the graphing calculator. For a blank grid to plot by hand, the XY graph maker and the graph paper maker print to scale.

Questions people ask

What is a slope field?

A slope field, also called a direction field, is a picture of a first order differential equation dy/dx = f(x, y). At each point of a grid, a short line segment is drawn with the slope the equation gives there. Together the segments show the shape of every solution without solving the equation: a solution curve follows the segments like a stream.

Is a slope field the same as a vector field?

Not quite. A slope field is a special kind of vector field. A vector field gives a direction and a size at every point, for any pair of equations dx/dt and dy/dt. A slope field only shows direction, with segments of equal length, for one equation dy/dx = f(x, y). Turn on arrows here to see it drawn as unit vectors pointing to the right.

How do you draw a slope field?

Pick a grid of points, for example every whole number from -3 to 3. At each point, put x and y into the equation to get the slope, then draw a short segment with that slope through the point: flat for 0, rising for positive values, falling for negative ones. Points with the same slope lie on curves called isoclines, which speeds up drawing by hand.

Are slope fields hard?

Usually not. Drawing one by hand is repetitive rather than difficult: you only evaluate the equation at grid points. The harder part on calculus tests, such as AP Calculus AB and BC, is reading them: matching a field to its equation, or sketching the solution through a given point. A generator helps you check your sketches and build intuition quickly.

How do I draw a solution curve through a point?

Type the starting point under Solution curves, as an x and a y separated by a comma, such as 0, 2. The curve is traced forward and backward from that point with the fourth order Runge Kutta method, so it follows the field closely. Add up to twelve points, one per line, to compare solutions with different initial conditions.

Gallery

Made with graphsmith

Real SVG exports from the template sets. Open one and it lands in the tool with its data filled in, ready to edit.