AP Calculus AB and BC
Slope Field Generator: Free, Download as PNG or SVG
A slope field draws a short segment at each grid point with the slope that dy/dx gives there, so one picture shows the shape of every solution. Type an equation, click to trace the solution through any point, and download the result as a PNG or SVG.
Latest curve passes through (0, 1), where the slope is 1.
Type the right-hand side of a differential equation and the tool draws its slope field: a grid of short segments, each one tilted at the slope the equation gives at that point. Click or tap anywhere on the field to draw the solution curve through that point. You can add up to 12 curves, switch on Euler's method to see the stepwise approximation with its table of values, then download the picture as a PNG or SVG, or copy a link that reopens the same equation, window, and curves.
What a slope field shows
A differential equation such as does not hand you a function. It hands you a rule for slope. Any solution that passes through must have slope there, and any solution through must have slope . A slope field applies that rule at many points at once and draws each answer as a short segment, so every segment is a small piece of a tangent line to whichever solution passes through its center.
A solution curve is a curve that agrees with the field everywhere along its length: at each point it passes through, its tangent has the slope the equation assigns to that point. For every preset on this page, exactly one solution passes through each point where the slope is defined, so choosing an initial condition such as picks out one curve from the whole family. That one curve is a particular solution. The family of all of them is the general solution, and the field lets you see its shape before you do any integration (Topics 7.3 and 7.4 of the AP Calculus course).
How to read it
The blue segments are the slope field. Each dark red curve is a solution, and the dot on it is the initial point you chose. The Density slider sets how many segments run across the window, from 7 to 41, and the four Window boxes set the smallest and largest and on screen. To use an exact initial condition, type it into Initial x and Initial y and press Draw curve. Every initial point is listed under those boxes as a small button that removes its curve, and Clear curves removes them all.
- Find the horizontal segments first. They mark where . For they lie along the line .
- Check what the slope depends on. If all the segments in a vertical column are parallel, the slope depends only on , as with or . If all the segments in a horizontal row are parallel, the slope depends only on , as with or . If neither is true, both variables matter.
- Read the sign by region. For the segments rise above the line , where , and fall below it.
A slope of looks like a 45 degree line only when one unit is the same length on both axes. The starting window, and , is chosen so the two scales are nearly equal. If you stretch the window in one direction, the segments look steeper or flatter on screen even though the slope values have not changed, exactly as they would on stretched graph paper.
Some equations have no slope at certain points. Where the formula divides a nonzero number by zero, as does along , the tool draws a vertical segment. Where the formula has no value at all, such as at the origin or the logarithm of a negative number, it leaves that grid point empty. A solution curve stops when it reaches a place like this, and for the latest curve the note under the graph gives the value where it stopped.
Three things to try
- Press the preset, press Clear curves, then type and into Initial x and Initial y and press Draw curve. The solution is a straight line, . Check it: its slope is everywhere, and on that line . Now click a few points above and below the line. Every other solution is with , so to the left the curves crowd toward the line and to the right they peel away from it, upward above the line and downward below it. Notice that the line of horizontal segments, , is not itself a solution; the straight solution sits one unit below it.
- Press the preset and draw the curve through . You get the top half of a circle of radius , and the note under the graph says it stops near and . Separating variables explains the shape: integrates to , and the point gives . The curve cannot continue past because the tangent is vertical there, and a solution has to be a function. Draw the curve through to get the bottom half of a smaller circle.
- Press the preset, the logistic equation with carrying capacity . The rows at and are flat: those are the two equilibrium solutions. Draw the curve through and you get the S-shaped logistic curve, steepest at where the slope is . Draw the curve through and it falls back toward as increases. Draw the curve through and it drops away from . Solutions approach and leave , which is what stable and unstable equilibrium mean.
What-if questions
- What if you halve the Euler step? Use with as the latest point, turn on Euler's method, and set with steps. The table ends at when , while the true solution has . Change to with steps and the last row reads about . The error shrinks from about to about . Both estimates are too low because the solution is concave up here, so each tangent step runs underneath the curve.
- What if the slope depends only on ? Try or . Every column of segments is parallel, and every solution curve is the same shape shifted up or down, because the solutions are antiderivatives that differ by a constant: for the first one.
- What if the starting point sits on an equilibrium? With , type the initial point . The curve is the horizontal line . Then click just above and just below it to see nearby solutions close in on the line as increases.
- What if you widen the window? Use , set from to and from to , and click several points. Every curve bends toward the line as increases, because the general solution is and the last term dies out. A wider window shows long-run behavior that a narrow one hides.
Where to go next
- Slope fields and Euler's method: how to sketch a field by hand, match one to its equation, and run Euler's method on paper.
- Separable differential equations: the algebra that turns a field like into the exact curves you see here.
- Differential equations cheat sheet: every Unit 7 method on one page.
- Euler's method practice: one Euler step at a time, with each answer checked.
- Unit 7: Differential Equations: the full topic list for the unit.
- Definitions: slope field, Euler's method, and separation of variables.
Put this on a class page
Copy the snippet. Paste it into Google Sites, Canvas, WordPress or anything that accepts HTML. The line under the frame is an optional credit you may keep, edit or remove.
Widget page with a live previewEvery widgetGoogle Sites steps
Common questions
How do you sketch a slope field by hand?
Use the grid of points the problem gives, usually the points with integer coordinates. At each one, substitute and into the differential equation to get a number, then draw a short segment with that slope through the point. For , the point gets slope and the point gets slope . Place the horizontal segments first, since the points where the slope is are the quickest to find.
How do you match a slope field to its differential equation?
Test the features that are easiest to see. Find where the segments are horizontal and check which equation equals zero there. Look at whether the slopes change only from left to right (the equation contains only ), only from bottom to top (only ), or both ways. Then check the sign of the slope in one quadrant. Two or three of these checks usually rule out every wrong choice.
What is Euler's method?
Euler's method approximates a solution by following tangent lines in short steps. From a known point, find the slope from the differential equation, move units in , change by times that slope, and repeat from the new point. For starting at with , two steps give and then at . It is Topic 7.5, a BC-only topic.
Why does a solution curve stop before the edge of the graph?
A solution is a function , so it cannot continue through a point where its tangent would be vertical or the slope is undefined. For the curve through is the top half of the circle , and it ends as it reaches at and . The tool also stops a curve that runs a full window height above or below the picture.
How do I download a slope field as an image?
Set the equation, the window, and any solution curves you want, then press Download PNG for an image you can paste into notes or slides, or Download SVG for a file that stays sharp at any size and can be edited in a vector drawing program. The saved file has a white background with the equation printed under the graph. Copy link gives a URL that reopens the same picture.