Tutorials › AP Statistics › Building a Slope Field from a Grid

Slope Fields and Models · Tutorial 544 of 999

Building a Slope Field from a Grid

Evaluate the differential equation at selected grid points, then use each result to draw a short segment with the corresponding slope.

Beginner 8 min read

What You'll Learn

  • Identify the grid coordinates where slope-field segments belong.
  • Substitute each point into a differential equation of the form y′ = F(x, y).
  • Convert calculated slopes into short, correctly oriented line segments.
  • Organize repeated slope calculations in a table.
  • Check a sketch by comparing its segments with the equation’s values.

From a Rate Rule to a Grid of Segments

A differential equation such as \(y'=x+y\) gives a rule for the slope of a solution curve. A slope field turns that rule into a picture: at chosen points in the \(xy\)-plane, draw a short segment whose slope is the value prescribed by the equation at that point.

The goal here is to construct those segments accurately. You do not need to find a solution function or join the segments into curves. Begin with a grid, substitute the coordinates of each grid point into the equation, and use each result to set the segment’s direction.

Definition: For a differential equation \(y'=F(x,y)\), a slope field is a collection of short line segments placed at selected points \((x,y)\). The segment at \((x,y)\) has slope \(F(x,y)\).

What the Slope at a Grid Point Means

The independent variable \(x\) is plotted horizontally, and the dependent variable \(y\) is plotted vertically. At a grid point \((x_0,y_0)\), evaluate the right-hand side of the differential equation using \(x=x_0\) and \(y=y_0\). If the result is \(m\), draw a segment with slope \(m\) through that point.

Recall that slope is vertical change divided by horizontal change. Thus, a slope of \(2\) means that for each unit of horizontal movement to the right, the line rises \(2\) units. A slope of \(-1\) means that it falls \(1\) unit for each unit to the right. A slope of \(0\) gives a horizontal segment.

$$ m=F(x_0,y_0)=\left.\frac{dy}{dx}\right|_{(x_0,y_0)} $$

In a drawing, segments should be short and centered on their grid points. Their orientation communicates the slope; they are not intended to be extended across the whole graph. To make a hand sketch consistent, you can choose the same small horizontal half-width \(h\) for every segment. For a segment with slope \(m\), its endpoints are then \((x_0-h,y_0-mh)\) and \((x_0+h,y_0+mh)\).

$$ \frac{(y_0+mh)-(y_0-mh)}{(x_0+h)-(x_0-h)} = \frac{2mh}{2h} = m $$

This convention produces equal horizontal spans. The segments may have different total lengths when their slopes differ, but each remains short if \(h\) is small. The calculated slope, not the appearance of a curve nearby, determines the segment.

A Reliable Construction Process

For a manageable sketch, first choose the grid points required by the problem or a small rectangular grid of your own. Keep the points organized in rows and columns so that each point is evaluated exactly once.

1
Mark the grid points.
Label the horizontal coordinate \(x\) and vertical coordinate \(y\), and identify the coordinates of each selected point.
2
Evaluate the equation.
At each point \((x_0,y_0)\), substitute \(x_0\) for \(x\) and \(y_0\) for \(y\) into \(F(x,y)\).
3
Record the slope.
Write the result next to the point or place it in a table indexed by \(x\) and \(y\).
4
Draw a short segment.
Center it at the point, and give it the rise and run indicated by the calculated slope.
5
Check the drawing.
Compare every segment with its recorded value: horizontal for slope \(0\), rising for a positive slope, and falling for a negative slope.

Worked Examples

Worked Example: Constructing a Field for \(y'=x+y\)

Build the slope field at the nine points with \(x=-1,0,1\) and \(y=-1,0,1\). At each point, the slope is \(m=x+y\). The table shows each substitution and result:

\(y\backslash x\)\(x=-1\)\(x=0\)\(x=1\)
\(y=1\)\(-1+1=0\)\(0+1=1\)\(1+1=2\)
\(y=0\)\(-1+0=-1\)\(0+0=0\)\(1+0=1\)
\(y=-1\)\(-1+(-1)=-2\)\(0+(-1)=-1\)\(1+(-1)=0\)

For example, at \((-1,1)\), substitution gives \(m=-1+1=0\), so draw a horizontal segment through that point. At \((0,1)\), the slope is \(m=0+1=1\), so draw a rising segment. At \((1,-1)\), \(m=1+(-1)=0\), giving another horizontal segment.

To check the construction numerically, use \(h=0.1\) for the point \((0,1)\), where \(m=1\). The segment endpoints are \((0-0.1,1-1(0.1))=(-0.1,0.9)\) and \((0+0.1,1+1(0.1))=(0.1,1.1)\). Its slope is \((1.1-0.9)/(0.1-(-0.1))=0.2/0.2=1\), as required. Repeat this process with the table’s slope at every grid point.

Worked Example: Constructing a Field for \(y'=2-y\)

Use the grid \(x=0,1,2\) and \(y=0,1,2\). The equation does not contain \(x\), but still evaluate it at every grid point. The substitutions are:

\(y\backslash x\)\(x=0\)\(x=1\)\(x=2\)
\(y=2\)\(2-2=0\)\(2-2=0\)\(2-2=0\)
\(y=1\)\(2-1=1\)\(2-1=1\)\(2-1=1\)
\(y=0\)\(2-0=2\)\(2-0=2\)\(2-0=2\)

At each point in the row \(y=0\), draw a segment of slope \(2\). At each point in the row \(y=1\), draw a segment of slope \(1\). At each point in the row \(y=2\), draw a horizontal segment because the slope is \(0\). The same calculated slopes appear across each row because substituting a fixed \(y\)-value gives the same expression \(2-y\), regardless of \(x\).

For a numerical check, take the point \((1,0)\), where \(m=2-0=2\). With \(h=0.1\), the endpoints are \((1-0.1,0-2(0.1))=(0.9,-0.2)\) and \((1+0.1,0+2(0.1))=(1.1,0.2)\). The slope is \((0.2-(-0.2))/(1.1-0.9)=0.4/0.2=2\). At \((1,2)\), \(m=2-2=0\), so the endpoints are \((0.9,2)\) and \((1.1,2)\), whose slope is \((2-2)/(1.1-0.9)=0/0.2=0\).

Worked Example: Constructing a Field for \(y'=x-y\)

Use the six points with \(x=0,1,2\) and \(y=0,1\). Substitute each pair into \(m=x-y\):

\(y\backslash x\)\(x=0\)\(x=1\)\(x=2\)
\(y=1\)\(0-1=-1\)\(1-1=0\)\(2-1=1\)
\(y=0\)\(0-0=0\)\(1-0=1\)\(2-0=2\)

Draw a falling segment at \((0,1)\), a horizontal one at \((1,1)\), and a rising segment at \((2,1)\), using slopes \(-1,0,1\), respectively. In the row \(y=0\), the slopes at \((0,0),(1,0),(2,0)\) are \(0,1,2\), so the corresponding segments are horizontal, rising with slope \(1\), and rising more steeply with slope \(2\).

Check the segment at \((0,1)\), where \(m=0-1=-1\). Taking \(h=0.1\), its endpoints are \((0-0.1,1-(-1)(0.1))=(-0.1,1.1)\) and \((0+0.1,1+(-1)(0.1))=(0.1,0.9)\). The slope is \((0.9-1.1)/(0.1-(-0.1))=-0.2/0.2=-1\). The segment therefore falls as \(x\) increases, matching the computed value.

Why the Segments Represent the Differential Equation

The construction follows directly from what the derivative means. Suppose a differentiable function \(y(x)\) satisfies \(y'=F(x,y)\). At any point on its graph, \((x_0,y_0)\), its derivative is the slope of its tangent line. Since the function satisfies the differential equation, that derivative equals \(F(x_0,y_0)\).

$$ \text{slope of the tangent at }(x_0,y_0) = y'(x_0) = F(x_0,y_0) $$

Thus, every solution curve that passes through the point must have the direction specified by the segment there. A slope field records these local directions at many points. It does not, by itself, give a complete solution curve; it gives the slope information supplied by the differential equation at the sampled locations.

The segment calculation is also justified by the definition of slope. If the segment is centered at \((x_0,y_0)\) and its endpoints are \((x_0-h,y_0-mh)\) and \((x_0+h,y_0+mh)\), its rise is \(2mh\) and its run is \(2h\). For \(h\ne0\), the quotient is \(2mh/(2h)=m\). Therefore, the segment has exactly the prescribed slope.

A Common Substitution Error

When \(F(x,y)\) contains both variables, it is easy to substitute the coordinates incorrectly or reverse an operation. For \(y'=x-y\), at \((1,2)\), the correct calculation is \(m=1-2=-1\). A mistaken calculation might use \(1+2=3\), as if the equation were \(y'=x+y\), and produce a steep rising segment.

That segment would not match the stated differential equation. Correct the substitution first, then draw the segment: \(m=-1\), so its direction falls as \(x\) increases. With \(h=0.1\), its endpoints are \((1-0.1,2-(-1)(0.1))=(0.9,2.1)\) and \((1+0.1,2+(-1)(0.1))=(1.1,1.9)\). Checking gives \((1.9-2.1)/(1.1-0.9)=-0.2/0.2=-1\).

Construction check: Before drawing a segment, verify the substituted coordinates and the arithmetic. After drawing, make sure its rise divided by its run equals the recorded slope.

Check Your Understanding

For each question, focus on evaluating the equation at the stated grid points and describing the required short segments.

  1. For \(y'=x+2y\), what slope belongs at \((1,0)\), \((1,1)\), and \((0,-1)\)?
  2. For \(y'=3-x-y\), calculate the slopes at \((0,0)\), \((1,1)\), and \((2,0)\). Which segment is horizontal?
  3. For \(y'=y-x\), calculate the slope at \((2,1)\), then give the endpoints of a segment centered there using \(h=0.1\).
  4. If a point has calculated slope \(-2\), what does that slope say about the segment’s rise and run as \(x\) increases?
  5. For \(y'=4-y\), evaluate the slope at every point in the row \(y=3\) for \(x=0,1,2\). What should the three segments have in common?

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon