📘 CodingMarble Learn

Slope Fields, Euler's Method and Logistic Models

A differential equation dy/dx = f(x, y) gives the slope at every point. Drawing tiny lines with those slopes makes a slope field, and solution curves follow the lines. Euler's method walks along the field in straight steps: yₙ₊₁ = yₙ + h·f(xₙ, yₙ). The logistic model dP/dt = kP(1 − P/K) grows fastest at P = K/2 and levels off at the carrying capacity K. A falling object with drag, m dv/dt = mg − bv, approaches the terminal velocity v_t = mg/b.

🎬 Step-by-step story

  1. Each little line shows the slope dy/dx = x − y at that point. Together they make a slope field.
  2. Put a start point at (0, 4). The solution curve flows along the little lines, like a leaf on a stream.
  3. Euler's method uses straight steps of size h = 0.5. At each point: read the slope, move forward, repeat. The orange path stays close to the true blue curve.
  4. Logistic growth: a population P grows fast at first, then slows, and levels off at the carrying capacity K = 10.
  5. A falling ball with air drag: dv/dt = 9.8 − 0.5v. Speed rises, but never goes past 19.6 m/s. That is the terminal velocity.
  6. Free play: pick a rule, move the start value and change the step h. Smaller h makes Euler more accurate.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

How can I sketch a solution without solving the equation?

Start at the initial point and follow the little lines. The field already tells you the direction everywhere.

Why is Euler's method not exact?

Each step follows a straight tangent, but the true curve bends. The gap adds up step by step. Smaller h means less bending per step.

Why does the logistic curve slow down?

The factor (1 − P/K) gets small as P nears K: less food and space per individual, so births balance deaths.

Why doesn't the falling ball keep speeding up?

Drag grows with speed until it equals the weight. Then the net force is zero and the speed stays at v_t.

Does a smaller step always help?

Yes, for these problems the error shrinks roughly in proportion to h, but you need more steps. Try h = 2 and h = 0.1 in free play.

Sketching slope fields

A differential equation like dy/dx = x − y tells you the slope at any point (x, y). To sketch a slope field:

  1. Pick grid points, e.g. x and y from −2 to 2.
  2. Work out the slope at each point.
  3. Draw a short line with that slope.

Tips: slope 0 → flat line; equal slopes along a line are called isoclines (for x − y, every point with y = x has slope 0). If the rule uses only x, columns look the same; if only y, rows look the same.

Reasoning with slope fields

A solution curve through a start point (initial condition) follows the little lines without crossing them.

Approximating solutions using Euler's method

Start at (x₀, y₀). Choose a step size h. Repeat:

yₙ₊₁ = yₙ + h·f(xₙ, yₙ), xₙ₊₁ = xₙ + h.

Each step follows the tangent line, so it is a chain of linearizations.

A table with columns x, y, slope, h × slope keeps the work tidy.

Logistic models

Exponential growth dP/dt = kP never stops. Real populations run out of food or space. The logistic model fixes this:

dP/dt = kP(1 − P/K)

Resistive (drag) forces and terminal velocity

A ball of mass m falls with air drag −bv (b in kg/s). Newton's second law: m dv/dt = mg − bv.

After one τ the speed is 63% of v_t; after 5τ it is over 99%. For fast objects drag can grow like v² instead; then v_t = √(mg/c).

Try it: a paper-cone race

Make two paper cupcake cases. Drop one, then two stacked together, from 2 m. The heavier stack reaches a higher terminal speed (v_t = mg/b grows with m) and lands first. Then draw a 5 × 5 slope field for dy/dx = y on paper and sketch the curve through (0, 1).

Key formulas and definitions

Worked examples

1. For dy/dx = x − y, find the slopes at (0, 0), (1, 0) and (0, 2).

Slope = x − y: (0,0) → 0, flat; (1,0) → 1; (0,2) → −2, steeply down.

2. Which equation fits a slope field where all lines in each row are the same, and lines are flat on y = 1: dy/dx = x − 1 or dy/dx = y − 1?

Same in each row means the rule uses only y. Flat at y = 1 means y − 1 = 0 there. So dy/dx = y − 1.

3. Use Euler's method with h = 0.5 for dy/dx = x − y, y(0) = 4, to estimate y(1).

Step 1: slope at (0, 4) = −4; y₁ = 4 + 0.5(−4) = 2 at x = 0.5. Step 2: slope at (0.5, 2) = −1.5; y₂ = 2 + 0.5(−1.5) = 1.25 at x = 1. Estimate y(1) ≈ 1.25.

4. The true solution in Example 3 is y = x − 1 + 5e^(−x). Is Euler's estimate too high or too low, and why?

True y(1) = 5/e ≈ 1.839. Euler gave 1.25, too low. y″ = 1 − y′ = 1 − x + y > 0 here, so the curve is concave up and tangent steps fall below it.

5. dP/dt = 0.8P(1 − P/10), P(0) = 1. Find the carrying capacity, the population when growth is fastest, and lim P(t).

K = 10. Fastest at P = K/2 = 5. As t → ∞, P → 10.

6. For the model in Example 5, find P(t) and P(2).

A = (10 − 1)/1 = 9. P(t) = 10/(1 + 9e^(−0.8t)). P(2) = 10/(1 + 9e^(−1.6)) = 10/(1 + 1.817) ≈ 3.55.

7. A 0.5 kg ball falls with drag constant b = 0.25 kg/s (g = 9.8 m/s²). Find v_t, τ and the speed after 2 s.

v_t = mg/b = 0.5 × 9.8 / 0.25 = 19.6 m/s. τ = m/b = 2 s. v(2) = 19.6(1 − e^(−1)) ≈ 19.6 × 0.632 ≈ 12.4 m/s.

Common mistakes

Practice quiz

1. In a slope field for dy/dx = y, the lines are flat where:
2. Euler's formula is:
3. dP/dt = 0.3P(1 − P/600). Growth is fastest when P =
4. Making the Euler step h smaller usually:
5. For m dv/dt = mg − bv, terminal velocity is:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a slope field?

A picture of short line segments showing the slope given by a differential equation at many points. Solution curves follow the segments.

What is Euler's method?

A step-by-step way to approximate a solution: new y = old y + h × slope at the old point.

What is the logistic differential equation?

dP/dt = kP(1 − P/K). It models growth that slows down and levels off at the carrying capacity K.

Where this is taught

USA (Common Core, NGSS, AP)Grade 12Differential Equations
USA (Common Core, NGSS, AP)Grade 12Differential Equations
USA (Common Core, NGSS, AP)Grade 12Force and Translational Dynamics

Learn first

Learn next

Related lessons

All Maths lessons