Skip to content
IB Diploma ProgrammeSL & HL

Slope fields

Mathematics: Applications and Interpretation SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Slope fields notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Slope fields notes as text: skim, search, and jump between subtopics.

~13 min read

1. What a slope field is

A differential equation dy/dx = f(x,y) gives the gradient of a solution curve at every point (x, y). A slope field draws a short line segment at each point of a grid, with that gradient.

To find a segment's gradient, substitute the x- and y-coordinates of the point into the right-hand side. A positive value gives a segment that rises. A negative value gives one that falls. A value of 0 gives a horizontal segment.

A segment is not a solution. It only says which way a solution curve is heading as it passes through that point.

dy/dx = f(x, y)

gradient at (a, b) = f(a, b)

Worked example 13 marks

A slope field is drawn for the differential equation dy/dx = x² - y.

(a) Calculate the gradient of the segment at the point (2, 1). [1]

(b) Calculate the gradient of the segment at the point (0, 2). [1]

(c) State a point where the segment is horizontal. [1]

  1. 1

    (a) Substitute x = 2, y = 1: dy/dx = 2² - 1 = 3 (A1) [1]

  2. 2

    (b) Substitute x = 0, y = 2: dy/dx = 0² - 2 = -2 (A1) [1]

  3. 3

    (c) The gradient is zero when x² = y, for example (1, 1) gives 1 - 1 = 0, so the segment there is horizontal (A1) [1]

2. Reading the pattern of segments

Look at what the right-hand side depends on. If f contains only x, every segment on one vertical line has the same gradient. If f contains only y, every segment on one horizontal line has the same gradient.

Segments with the same gradient lie along a curve f(x,y) = k. The curve where f(x,y) = 0 is where all segments are horizontal, so any solution has zero gradient there.

For dy/dx = ycos x, the gradient is zero on y = 0 and wherever cos x = 0. On the exam's axes, -2 ≤ x ≤ 4, that is x = -π/2 and x = π/2.

f(x, y) = k ⇒ all segments on the curve have gradient k

f(x, y) = 0 ⇒ segments are horizontal

Worked example 14 marks

A slope field is drawn for dy/dx = y - 1.

(a) State the value of y at which every segment is horizontal. [1]

(b) Explain why the segments along a horizontal line all have the same gradient. [1]

(c) Calculate the gradient of the segment at y = 3 and at y = 0. [2]

  1. 1

    (a) y - 1 = 0, so y = 1 (A1) [1]

  2. 2

    (b) The right-hand side contains only y, so the gradient depends on y and not on x (R1) [1]

  3. 3

    (c) At y = 3: 3 - 1 = 2 (A1) [1]

  4. 4

    At y = 0: 0 - 1 = -1 (A1) [1]

3. Sketching a solution curve

To sketch the solution through a given point, start at that point. Follow the direction of the nearest segments, so the curve is tangent to each segment it passes. Draw a smooth curve both ways from the start: to the right and to the left.

A curve is steepest where the segments are steepest and flattens where they are horizontal.

For dy/dx = ycos x the gradient is zero at x = π/2, so the curve through (0, 1.5) has a maximum there. At x = -π/2 the gradient is zero again, and to the left of (0, 1.5) the curve falls to a minimum there. The figure below shows the field for x ≥ 0. An exam figure shows negative x too, and the curve must continue there.

Worked example 12 marks

For the differential equation dy/dx = ycos x, a slope field is printed on axes with -2 ≤ x ≤ 4 and 0 ≤ y ≤ 5.

Sketch the solution curve that passes through the point (0, 1.5).

  1. 1

    The curve goes through the point (0, 1.5) A1 [1]

  2. 2

    Approximately correct shape with a maximum at x = π/2 ≈ 1.5, between y = 3.5 and y = 4.5 A1 [1]

  3. 3

    Note from the markscheme: a curve with only positive x-values earns at most A1A0, so extend it to negative x.

4. Finding the curve of zero gradient

Where solutions have zero gradient, dy/dx = 0. To find the curve those points lie on, put dy/dx = 0 and use the form you are told. If the curve is y = ax², substitute y = ax² into the differential equation.

Then solve for the constant. Factor out the common power of x, or spot a perfect square. The answer for a is a number, not an expression in x.

dy/dx = 0 and y = ax² ⇒ solve for a

Worked example 13 marks

The differential equation is dy/dx = x⁴ + 4x²y + 4y².

Some of the solutions to the differential equation have a point at which the gradient is zero. The curve on which all these points lie is given by the equation y = ax², where a is a constant to be found.

Use the differential equation to find the value of a.

  1. 1

    Substituting y = ax² into the differential equation with dy/dx = 0: 0 = x⁴ + 4x²(ax²) + 4(ax²)² (M1) [1]

  2. 2

    Choose an appropriate method to solve for a: 0 = x⁴(1 + 4a + 4a²) (M1) [1]

  3. 3

    a = -1/2 A1 [1]

  4. 4

    Alternative: x⁴ + 4x²y + 4y² = (x² + 2y)² (M1), so x² + 2y = 0 (M1), giving y = -1/2x² A1

5. Solving to find the solution curve

A slope field can be checked against an exact solution. When dy/dx is a product of a function of x and a function of y, separate the variables. Put all the y terms with dy and all the x terms with dx, then integrate both sides.

The constant of integration appears after integrating. Use the given point to find it. Write ln|y| = … in exponential form to get y explicitly.

dy/dx = g(x) h(y) ⇒ int 1/(h(y)) dy = int g(x) dx

ln|y| = F(x) + c ⇒ y = Ae^(F(x))

Worked example 15 marks

The differential equation is dy/dx = ycos x.

By solving the differential equation, find the equation of the solution that passes through the point (0, 1.5).

  1. 1

    Attempt to separate variables: 1/y dy = cos x dx (M1) [1]

  2. 2

    int 1/y dy = int cos x dx, so ln|y| on the left (A1) [1]

  3. 3

    sin x + c on the right: ln|y| = sin x + c (A1) [1]

  4. 4

    y = Ae^(sinx) (A1) [1]

  5. 5

    At (0, 1.5): A = 1.5, so y = 1.5e^(sinx) A1 [1]

Recap

  • A slope field draws, at each point, a segment with gradient f(x, y) from dy/dx = f(x, y). Substitute the point to find it.
  • Segments are horizontal where f(x, y) = 0. If f has only x, columns match. If it has only y, rows match.
  • A solution curve is tangent to every segment it crosses. Draw it both ways from the given point, into negative x as well.
  • For a zero-gradient curve such as y = ax², substitute it into the equation with dy/dx = 0 and solve for a.
  • To solve exactly, separate variables, integrate both sides, then use the given point to find the constant.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. A slope field is drawn for dy/dx = 2x - y. State the gradient of the segment at the point (3, 2).1 mark
    Answer
    1. 2(3) - 2 = 4

    Trap: The first coordinate is x and the second is y. Swapping them gives 2(2) - 3 = 1.

  2. A slope field is drawn for dy/dx = xy. (a) Calculate the gradient of the segment at (2, -3). [1] (b) Calculate the gradient of the segment at (-2, -3). [1] (c) State whether each of these segments rises or falls. [1]3 marks
    Answer
    1. (a)
    2. 2 × (-3) = -6
    3. (b)
    4. (-2) × (-3) = 6
    5. (c)
    6. The segment at (2, -3) falls and the segment at (-2, -3) rises.

    Trap: Two negative values multiply to a positive gradient, so the second segment rises.

  3. A slope field is drawn for dy/dx = 3 - y. (a) Determine all points where the segment is horizontal. [2] (b) Calculate the gradient of the segment at (1, 5). [1]3 marks
    Answer
    1. (a)
    2. Horizontal when 3 - y = 0.
    3. y = 3, for every value of x: the line y = 3.
    4. (b)
    5. 3 - 5 = -2

    Trap: Set the gradient, not y, equal to zero: the segments are horizontal on the line y = 3, not on the x-axis.

  4. A slope field is drawn for dy/dx = x² - 4. (a) Calculate the gradient of every segment on the line x = 1. [1] (b) Determine the values of x at which the segments are horizontal. [2]3 marks
    Answer
    1. (a)
    2. 1² - 4 = -3, whatever the value of y.
    3. (b)
    4. x² - 4 = 0, so x² = 4.
    5. x = 2 or x = -2

    Trap: Taking the square root gives two values, x = ± 2. Stopping at x = 2 loses a mark.

  5. A slope field is drawn for dy/dx = x + y. (a) Find the equation of the line on which every segment is horizontal. [1] (b) Find the equation of the line on which every segment has gradient 3. [2]3 marks
    Answer
    1. (a)
    2. x + y = 0, so y = -x.
    3. (b)
    4. x + y = 3.
    5. y = 3 - x

    Trap: The line y = 3 - x has gradient -1. The segments along it have gradient 3. Do not mix the two gradients.

  6. The differential equation is dy/dx = 4x⁴ - 4x²y + y². Some solutions have a point where the gradient is zero. These points lie on the curve y = ax². Use the differential equation to find the value of a.3 marks
    Answer
    1. Substitute y = ax² and dy/dx = 0: 0 = 4x⁴ - 4ax⁴ + a²x⁴.
    2. 0 = x⁴(a² - 4a + 4) = x⁴(a - 2)².
    3. a = 2

    Trap: The answer is a number: spot the perfect square (a - 2)², and do not leave a in terms of x.

  7. The differential equation is dy/dx = 2xy, with y > 0. Find the equation of the solution that passes through the point (0, 3).5 marks
    Answer
    1. Separate variables: 1/y dy = 2x dx.
    2. Integrate: ln y = x² + c.
    3. Exponentiate: y = Ae^(x²), where A = e^(c).
    4. At (0, 3): 3 = Ae⁰, so A = 3.
    5. y = 3e^(x²)

    Trap: The constant multiplies after exponentiating: y = 3e^(x²), not y = e^(x²) + 3.

  8. The differential equation is dy/dx = x/2y, with y > 0. (a) Calculate the gradient of the segment at (2, 3). [1] (b) Find the equation of the solution that passes through (2, 3), giving y in terms of x. [5]6 marks
    Answer
    1. (a)
    2. Substitute x = 2 and y = 3.
    3. 2/(2 × 3) = 1/3
    4. (b)
    5. Separate variables: 2y dy = x dx.
    6. Integrate: y² = x²/2 + c.
    7. At (2, 3): 9 = 2 + c, so c = 7.
    8. y² = x²/2 + 7.
    9. As y > 0: y = √(x²/2 + 7)

    Trap: Find c before taking the square root, and take the positive root because y(2) = 3 > 0.

  9. The population of an insect colony is P thousand, t months after it is first observed. It is modelled by dP/dt = 0.4Pcos(0.5t), with P = 2 when t = 0. A slope field is drawn for this equation for 0 ≤ t ≤ 10 and P > 0. (a) Determine the values of t at which every segment is horizontal. [2] (b) Find P in terms of t. [4] (c) Calculate the population when t = 4, giving your answer to three significant figures. [2]8 marks
    Answer
    1. (a)
    2. P > 0, so the segments are horizontal when cos(0.5t) = 0.
    3. 0.5t = π/2 or 3π/2, so t = π or t = 3π (t = 3.14 or t = 9.42).
    4. (b)
    5. Separate: 1/P dP = 0.4cos(0.5t) dt.
    6. Integrate: ln P = 0.8sin(0.5t) + c.
    7. P = Ae^(0.8sin(0.5t)). At t = 0: A = 2.
    8. P = 2e^(0.8sin(0.5t))
    9. (c)
    10. In radians: P = 2e^(0.8sin 2) = 4.1395…
    11. 4.14 thousand insects

    Trap: With the GDC in degrees, sin 2 gives P = 2.06, the degrees slip the markscheme for that paper marks down, and stopping at t = π loses the second horizontal line at t = 3π.

  10. A slope field is drawn for dy/dx = xy². (a) Calculate the gradient of the segment at (1, 2) and at (-1, 2). [2] (b) Hence explain why the solution curve through (0, 1) must be sketched on both sides of the y-axis as mirror images. [1] (c) Find the equation of the solution that passes through (0, 1), giving y in terms of x. [5] (d) Determine the values of x at which this solution is not defined. [2]10 marks
    Answer
    1. (a)
    2. 1 × 2² = 4 and (-1) × 2² = -4
    3. (b)
    4. Replacing x by -x changes only the sign of the gradient, so the field to the left of the y-axis is the reflection of the field to the right. The curve through (0, 1), on the axis, is therefore symmetrical about the y-axis.
    5. (c)
    6. Separate: 1/y² dy = x dx.
    7. Integrate: -1/y = x²/2 + c.
    8. At (0, 1): -1 = c.
    9. -1/y = (x² - 2)/2
    10. y = 2/(2 - x²)
    11. (d)
    12. The denominator is zero when x² = 2.
    13. x = √2 or x = -√2 (± 1.41)

    Trap: The markscheme gives at most A1A0 for a curve drawn only for positive x; the same one-sided slip here misses x = -√2, and int 1/y² dy is -1/y, not ln|y|.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
A curve drawn only for x > 0A smooth curve through (0, 1.5) that is also drawn for negative x
a = -1/2 written with no workingSubstituting y = ax² into the differential equation, then solving for a
int ycos x dx = ysin xAttempt to separate variables: 1/y dy = cos x dx
y = Ae^(sin x), with A left unknowny = 1.5e^(sin x), with the point used to find A

Frequently asked questions

What is a slope field and how do you find the gradient of one segment?
A slope field draws a short line segment at each point of a grid, with the gradient f(x, y) from dy/dx = f(x, y). Substitute the x- and y-coordinates of the point into the right-hand side. For dy/dx = x² - y the segment at (2, 1) has gradient 3, so it rises. A segment is not a solution: it only shows the direction a solution curve takes through that point.
How do I find the points where the segments in a slope field are horizontal?
Set the right-hand side equal to zero, since f(x, y) = 0 makes every segment horizontal. If f contains only y, the horizontal segments lie along one horizontal line. For dy/dx = y - 1 every segment is horizontal at y = 1. For dy/dx = x² - 4 you get x = 2 or x = -2, so give both values.
How do I sketch a solution curve through a point on a slope field?
Start at the given point and follow the direction of the nearest segments, so the curve is tangent to each segment it crosses. Draw a smooth curve both ways from the start, to the right and to the left. For dy/dx = ycos x through (0, 1.5) the curve has a maximum at x = π/2 ≈ 1.5. A curve drawn only for positive x earns at most A1A0, so extend it to negative x.
How do I find the constant a when the zero-gradient points lie on the curve y = ax^2?
Substitute y = ax² into the differential equation and set dy/dx = 0. For dy/dx = x⁴ + 4x²y + 4y² you get 0 = x⁴(1 + 4a + 4a²), which gives a = -1/2. The answer is a number, so spot the perfect square rather than leaving a in terms of x. Writing a = -1/2 with no working is not enough.
How do I solve dy/dx = 2xy exactly when the solution passes through a given point?
Separate the variables to get 1/y dy = 2x dx, then integrate to ln y = x² + c. Exponentiate to get y = Ae^(x²), where A = e^(c), and use the point (0, 3) to find A = 3. The solution is y = 3e^(x²). The constant multiplies after exponentiating, so it is not y = e^(x²) + 3.
Why is the integral of 1/y^2 with respect to y not ln|y|?
Integrate 1/y² as -1/y, not as ln|y|. For dy/dx = xy², separating gives 1/y² dy = x dx, so -1/y = x²/2 + c. Through (0, 1) the solution is y = 2/(2 - x²), which is not defined at x = ±√2.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters