From a Formula to a Picture
A first-order differential equation can specify a slope at each point in the plane. For example, the equation \(y'=x+y\) says that at a point with coordinates \((x,y)\), the slope is the value of \(x+y\). A slope field turns this rule into a picture: at selected points, we draw short segments with the slopes assigned by the equation.
The aim is not to draw a complete solution curve. Instead, each segment records local information about how a solution curve would be directed if it passed through that point. A carefully constructed field provides a visual summary of the differential equation itself.
How to Construct a Slope Field
Begin by choosing a region of the \(xy\)-plane and selecting grid points in it. At each grid point \((x,y)\), evaluate the right-hand side \(f(x,y)\). The result is a number \(m\), and it determines the slope of the segment centered at that point.
A positive slope means the segment rises as \(x\) increases; a negative slope means it falls. A zero slope gives a horizontal segment. The larger the absolute value of the slope, the steeper the segment. These descriptions tell you how to orient each segment, not how long it should be.
Mark a manageable set of \(x\)- and \(y\)-coordinates, and identify each grid point clearly.
Substitute the point's \(x\)- and \(y\)-coordinates into \(f(x,y)\). Keep track of signs and parentheses.
Center it at the grid point. Make positive, negative, and zero slopes visibly distinct, while keeping the segments short enough to avoid clutter.
Confirm that each segment is centered on its grid point and that its rise and run agree with the computed slope.
For a hand-drawn field, the segments need not have an exact prescribed length. One useful precise convention is to choose a fixed half-length \(a>0\). If the computed slope at \((x_0,y_0)\) is \(m\), endpoints for a segment of total length \(2a\) are
The change in \(x\) from the first endpoint to the second is \(2a/\sqrt{1+m^2}\), and the change in \(y\) is \(2am/\sqrt{1+m^2}\). Their ratio is \(m\), so the segment has the required slope. This convention gives all segments the same length; on an ordinary sketch, a consistent short length is usually enough.
Worked Example: The Equation \(y'=x+y\)
Construct the slope values on the grid with \(x=-1,0,1\) and \(y=-1,0,1\). At every point, use \(f(x,y)=x+y\). The table records each substitution so that the sign and value can be checked directly.
Worked Example: Evaluating \(x+y\) on a Grid
For \(y=-1\), the values at \(x=-1,0,1\) are \((-1)+(-1)=-2\), \(0+(-1)=-1\), and \(1+(-1)=0\).
For \(y=0\), they are \((-1)+0=-1\), \(0+0=0\), and \(1+0=1\).
For \(y=1\), they are \((-1)+1=0\), \(0+1=1\), and \(1+1=2\).
| \(y\) \(\backslash\) \(x\) | \(-1\) | \(0\) | \(1\) |
|---|---|---|---|
| \(-1\) | \(-2\) | \(-1\) | \(0\) |
| \(0\) | \(-1\) | \(0\) | \(1\) |
| \(1\) | \(0\) | \(1\) | \(2\) |
For example, the point \((1,0)\) receives a segment of slope \(1\), while \((-1,1)\) receives a horizontal segment because its slope is \(0\). The point \((-1,-1)\) receives a segment of slope \(-2\), which falls more steeply than a segment of slope \(-1\).
Check: Substitution into \(f(x,y)=x+y\) gives \(f(1,0)=1+0=1\), \(f(-1,1)=-1+1=0\), and \(f(-1,-1)=-1-1=-2\), matching the table.
Why the Segment Represents the Differential Equation
The construction follows directly from what a derivative means. Suppose a differentiable solution \(y=y(x)\) passes through \((x_0,y_0)\), so \(y(x_0)=y_0\), and satisfies \(y'=f(x,y)\). At that point its derivative is \(y'(x_0)=f(x_0,y_0)\).
The tangent line to the solution at \(x_0\) therefore has slope \(f(x_0,y_0)\). Its equation is
where \((X,Y)\) denotes a point on the tangent line. A short segment centered at \((x_0,y_0)\) and having this slope records the direction of that tangent line locally. Repeating the construction at grid points produces the slope field.
This explains both what the field shows and what it does not show. It shows the slope prescribed at each sampled point. It is not itself a solution, and it does not supply values between the grid points. The segment lengths and spacing are choices for making the information readable; the slopes come from the differential equation.
Worked Example: The Equation \(y'=x^2-y\)
Use the grid \(x=-1,0,1\) and \(y=-1,0,1\). This example illustrates that each value must be calculated from both coordinates, including the square on \(x\).
Worked Example: Evaluating \(x^2-y\) on a Grid
For \(y=-1\), the evaluations are \((-1)^2-(-1)=1+1=2\), \(0^2-(-1)=0+1=1\), and \(1^2-(-1)=1+1=2\).
For \(y=0\), they are \((-1)^2-0=1\), \(0^2-0=0\), and \(1^2-0=1\).
For \(y=1\), they are \((-1)^2-1=1-1=0\), \(0^2-1=0-1=-1\), and \(1^2-1=1-1=0\).
| \(y\) \(\backslash\) \(x\) | \(-1\) | \(0\) | \(1\) |
|---|---|---|---|
| \(-1\) | \(2\) | \(1\) | \(2\) |
| \(0\) | \(1\) | \(0\) | \(1\) |
| \(1\) | \(0\) | \(-1\) | \(0\) |
Draw the segments at the grid points using these slopes. For instance, at \((0,1)\), draw slope \(-1\); at \((0,0)\), draw slope \(0\); and at \((1,-1)\), draw slope \(2\).
Check: The selected values are \(f(0,1)=0^2-1=-1\), \(f(0,0)=0^2-0=0\), and \(f(1,-1)=1^2-(-1)=2\). Each agrees with its table entry.
Worked Example: The Equation \(y'=(x-2y)/3\)
A smaller grid can make a useful practice field when the formula includes fractions. Take the four points with \(x=0,3\) and \(y=0,1\). Evaluate the formula separately at each point before drawing.
Worked Example: Four Slopes with Fractional Values
At \((0,0)\), the slope is \((0-2(0))/3=0/3=0\).
At \((3,0)\), the slope is \((3-2(0))/3=3/3=1\).
At \((0,1)\), the slope is \((0-2(1))/3=-2/3\).
At \((3,1)\), the slope is \((3-2(1))/3=(3-2)/3=1/3\).
| Point | Substitution | Slope |
|---|---|---|
| \((0,0)\) | \((0-2(0))/3=0/3\) | \(0\) |
| \((3,0)\) | \((3-2(0))/3=3/3\) | \(1\) |
| \((0,1)\) | \((0-2(1))/3=-2/3\) | \(-2/3\) |
| \((3,1)\) | \((3-2(1))/3=1/3\) | \(1/3\) |
At \((0,0)\), draw a horizontal segment. At \((3,0)\), draw a segment rising one unit for each unit of horizontal run. At \((0,1)\), the negative slope means the segment descends as \(x\) increases; at \((3,1)\), the positive slope is gentler than the slope at \((3,0)\).
Check: Substituting the four points into \((x-2y)/3\) gives, in order, \(0\), \(1\), \(-2/3\), and \(1/3\), as recorded in the table.
Common Mistakes and Useful Checks
A frequent error is to mishandle a negative coordinate. For example, at \((2,-1)\), the formula \(f(x,y)=x-y\) gives
A wrong calculation might replace \(2-(-1)\) with \(2-1=1\). That would lead to a much shallower segment than the equation prescribes. Keep the parentheses around substituted negative values, and check the arithmetic before drawing.
Also distinguish the coordinates of a point from the slope calculated there. A grid point \((x,y)\) is where the segment is centered; \(f(x,y)\) is the segment's slope, not its \(y\)-coordinate. If the formula is undefined at a point, it assigns no finite slope there, so do not draw a segment at that point. For example, \(y'=1/x\) is undefined when \(x=0\); a slope field for that equation cannot include segments on that line.
When checking a hand-drawn field, select a few points and recompute their slopes from the original formula. Verify that a positive value rises to the right, a negative value falls to the right, and zero gives a horizontal segment. This catches many sign, substitution, and placement errors without requiring every segment to be redrawn.
Constructing a slope field is a systematic translation: choose points, evaluate the formula, and draw the corresponding short segments. The accuracy of the picture depends first on accurate pointwise calculations; the visual choices of grid spacing and segment length should then make those calculations easy to see.
Check Your Understanding
Use the definition and construction method to answer these questions.
- For \(y'=2x-y\), what slope belongs at the point \((1,1)\)?
- For \(y'=x+y\), what type of segment belongs at \((2,-2)\), and how do you verify it?
- Why should a segment with slope \(-2\) fall more steeply to the right than one with slope \(-1/2\)?
- What does a segment in a slope field record about a solution passing through its center?
- For \(y'=1/(x-1)\), why should no segment be drawn at points with \(x=1\)?