Slope Fields

Category: Differential Equations   Level: 301

dy/dx = y, y(0) = 1 ⇒ y = ex

A differential equation gives a slope at every point. Draw those slopes as short dashes and a solution is any curve that follows the dashes.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Read the rule

The equation dy/dx = y says the slope at any point equals its height. At height 2 the slope is 2, at height 0 it is flat, and below the axis it points down.

slope at (x, y) = y

Step 1: Read the rule

Step 2: Fill in the field

Draw a dash at every grid point. The slope only depends on y, so each row repeats the same dash. Up high, the dashes get steep fast.

dy/dx = y

Step 2: Fill in the field

Step 3: Pick a starting point

An initial condition picks one solution out of the crowd. Start at (0, 1), where the dash has slope 1.

y(0) = 1

Step 3: Pick a starting point

Step 4: Follow the dashes

Walk forward and backward along the dashes from (0, 1). The path is y = eˣ, the function that is its own slope.

y = ex, dy/dx = ex = y

Step 4: Follow the dashes

Step 5: Try other starts

Other starting heights give other members of the family y = C eˣ. Start at 0 and you stay at 0 forever, the calmest solution there is.

y = C ex for C = 2, 1/2, 0, -1/2

Step 5: Try other starts

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render slope-field --out /tmp/slope-field

Source: svgmath/diagrams/first_order_odes.py