Slope fields, Euler’s method and algorithms: VCE Specialist Mathematics Units 3 & 4

Loav · VCE Specialist Mathematics · Units 3 & 4

S34-E03 · Recommended sequence: Unit 4

1. Read a differential equation as a map of local slopes

For a first-order differential equation y′ = F(x, y), every allowed point (x, y) is assigned a slope. A slope field displays short line segments with those slopes on a grid. The segments describe local direction, not function values and not finite jumps. A solution curve should pass through them tangentially while also passing through its specified initial point.

At a point where F(x, y) = 0, the segment is horizontal. A positive value gives an upward-sloping segment from left to right, while a negative value gives a downward-sloping segment. A large magnitude gives a steep segment. Fields are usually drawn with equal segment lengths, so the visual length does not encode the rate's magnitude.

Test a few informative points when matching an equation to a field. If F depends only on x, slopes are the same along each vertical grid line. If F depends only on y, slopes are the same along each horizontal grid line. If F depends on both variables, neither pattern is generally present. These structural observations often eliminate incorrect choices faster than inspecting every segment.

2. Equilibria and zero slopes are not the same claim

An equilibrium solution is a constant function y = c that satisfies the differential equation throughout the relevant x-interval. It requires F(x, c) = 0 for every x in that interval. A single horizontal segment at one point is insufficient. For y′ = x − y, the slopes vanish on y = x, but that diagonal is not a solution: its own derivative is 1, while the equation would require zero.

A zero-slope curve can still be informative. It marks where a solution may change from rising to falling as it passes through the plane. To investigate an autonomous equation y′ = g(y), mark the zeros of g and inspect its sign between them. The resulting direction pattern predicts whether nearby solutions move toward or away from an equilibrium level.

When a field omits points because F is undefined there, do not interpolate a solution straight across the missing region. The equation's domain comes before graphical guesses. Likewise, a small viewing window can make a rapidly growing solution appear to terminate even though it has simply left the display. Separate mathematical boundaries from plotting boundaries.

Worked example 1: Interpret an autonomous slope field

Consider y′ = y(2 − y). Since the right-hand side does not involve x, each horizontal row has a constant slope. At y = 0 and y = 2, the slope is zero for every x, so both horizontal lines are equilibrium solutions.

For 0 < y < 2, the rate is positive. For y > 2 it is negative, and for y < 0 it is also negative. Thus a solution starting at (0, 1/2) initially increases toward the upper equilibrium, whereas one starting at (0, 3) initially decreases toward it. A starting value below zero moves downward rather than toward zero.

At y = 1/2 the exact slope is (1/2)(3/2) = 3/4, so a short tangent segment through the initial point is y − 1/2 = (3/4)x. This line approximates the curve locally. It is not the exact solution for all x because its constant slope would not continue to match the changing value y(2 − y).

Slopes repeat across each horizontal row. Equilibrium levels are zero and two, and the initial curve rises from one half toward two.An autonomous slope field and an initial-value curve 2026-10-16T02:36:02.865998 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/ −1 0 1 2 3 4 5 x −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 y (0, 1/2) Slope field: y′ = y(2 − y) Solution through (0, 1/2) Equilibria y = 0 and y = 2
Rows have equal slopes because this equation depends only on y. The overlaid solution follows the local segments and flattens as it approaches y = 2.

3. Euler's method repeatedly follows a tangent

Suppose the current approximation is (xn, yn) and the positive step size is h. The slope there is F(xn, yn). Following the tangent for a horizontal distance h gives the first-order Euler update:

xn+1 = xn + h
yn+1 = yn + hF(xn, yn).

The slope must be evaluated at the old point. Updating x first and then evaluating F with the new x but old y gives a different procedure. Compute the slope before changing either coordinate, or store both new coordinates separately. This detail matters especially when F depends explicitly on x.

The initial point is exact data, not the result of an Euler step. If the endpoint is b and (b − x₀)/h is an integer N, perform N updates. A table containing N + 1 points includes the initial point and the N computed points. Confusing point count with step count is a frequent off-by-one error.

Each update replaces the unknown short curve segment with a straight tangent step. The next slope is evaluated at the new approximation, which may already differ from the exact solution. Consequently errors can accumulate, and an exact rate formula does not make the resulting coordinates exact. Use the approximation symbol when reporting a numerical Euler estimate.

Worked example 2: Show every update, including the x-dependence

Use Euler's method with h = 0.2 to estimate y(0.6) for y′ = x + y, y(0) = 1. Start at (0, 1). The first slope is 0 + 1 = 1, giving y₁ = 1 + 0.2(1) = 1.2 at x₁ = 0.2.

The next slope is 0.2 + 1.2 = 1.4, giving y₂ = 1.2 + 0.2(1.4) = 1.48 at x₂ = 0.4. The third slope is 0.4 + 1.48 = 1.88, giving y₃ = 1.48 + 0.2(1.88) = 1.856 at x₃ = 0.6.

Thus the Euler estimate is y(0.6) ≈ 1.856. The exact solution y = 2ex − x − 1 gives y(0.6) ≈ 2.044238, so this estimate is low by about 0.188238. The numerical arithmetic in each step is exact for the chosen decimals; the discrepancy is method error rather than merely calculator rounding.

4. Step size affects accuracy, workload and behaviour

A smaller positive step usually improves an Euler approximation over a fixed interval when the solution and rate function behave suitably and numerical errors are controlled. It also requires more updates. Halving h doubles the number of steps to the same endpoint. Compare estimates at the same input value; estimates at different endpoints do not isolate the effect of step size.

Concavity explains the direction of a single tangent error. For a smooth concave-up exact solution, the tangent at an exact starting point lies below the nearby curve; for a concave-down solution it lies above. Across many steps, however, the starting point is approximate and the slope depends on that approximation. Do not claim a universal overestimate or underestimate solely from one tangent picture without checking the equation's behaviour.

A large step can produce implausible results even when the true solution is well behaved. For y′ = −2y, Euler gives yn+1 = (1 − 2h)yn. With h = 0.75 and positive y₀, the factor is −1/2 and the iterates alternate in sign, although the exact solution y₀e−2x stays positive. The numerical method has created the sign changes.

Keep sufficient intermediate precision. Rounding every slope or updated value to two decimal places introduces additional errors that may hide the effect of changing h. Carry the stored calculator values and round the final requested estimate. If a task explicitly prescribes rounding at each step, follow that instruction and state that convention.

Worked example 3: Compare two meshes against an exact solution

For y′ = y, y(0) = 1, estimate y(1). With h = 0.5, each update multiplies y by 1.5. Two steps give 1, 1.5, 2.25, so y(1) ≈ 2.25. With h = 0.25, each update multiplies by 1.25. Four steps give 1, 1.25, 1.5625, 1.953125 and 2.44140625.

The exact value is e ≈ 2.71828183. The errors in magnitude are about 0.468282 and 0.276876 respectively. Both are underestimates, and the finer mesh is closer. The improvement is evidence about this calculation, not a proof that every arbitrary differential equation behaves identically.

The repeated update also gives a checkable formula: after N equal steps to 1, the approximation is (1 + 1/N)N. This connects the loop's repeated multiplication with its numerical output. It gives an independent arithmetic check without replacing the required Euler working.

5. Design an algorithm that preserves the mathematics

An algorithm should specify its inputs, starting values, repeated calculation and output. For Euler's method, the essential inputs are F, x₀, y₀, h and the number of steps N. A clear pseudocode version stores the slope first and outputs the initial point before starting the loop:

INPUT x0, y0, h, N
x ← x0
y ← y0
OUTPUT x, y
FOR n FROM 1 TO N
    slope ← F(x, y)
    next_y ← y + h × slope
    x ← x + h
    y ← next_y
    OUTPUT x, y
END FOR

Trace one or two iterations by hand before trusting an implementation. For the equation x + y from worked example 2, the first output after the update must be (0.2, 1.2). If it is (0.2, 1.24), the program probably used the updated x in the slope. This is a targeted test that identifies the likely error rather than merely observing that the final answer differs.

For an endpoint that is not an exact multiple of h away, state how the final step is handled. One option is a shorter final step Δx = b − x. Do not overshoot b and label the resulting value y(b). If a supplied algorithm uses a specific stopping condition, trace that condition literally before deciding which point it returns.

6. Explain what a numerical result establishes

Euler estimates approximate a solution from initial data; they do not find roots of an equation. Newton iteration has a different purpose and update rule. A slope field visualises directions; it does not supply an exact function simply because a smooth curve can be drawn through it. Keep the representation and the task distinct.

A non-routine investigation can compare a mixing model's exact solution with Euler values at several step sizes. Record the final input, approximation, exact value when known and signed error. Ask whether the approximations preserve nonnegative amounts and stay within expected equilibrium bounds. An unexpected overshoot can reveal a coarse step or an implementation mistake before it becomes a contextual claim.

When technology is permitted, present enough of the update process to make the algorithm visible. Give h, the initial point, the requested endpoint and a table or clearly labelled sequence. Then interpret the final number with the correct units and an approximation sign. A bare calculator output does not communicate which numerical method was used.

Practise, then check

  1. For y′ = x − 2y, find slopes at (0, 1), (2, 1) and (2, 0).
  2. Explain why the zero-slope line y = x for y′ = x − y is not itself a solution.
  3. Use two Euler steps of size 0.1 for y′ = 2y, y(0) = 3.
  4. Use h = 0.5 to take two Euler steps for y′ = x + y, y(0) = 2.
  5. How many updates and output points are needed from x = 1 to x = 2.2 with h = 0.2?
  6. For y′ = −3y with y₀ = 4 and h = 0.5, find the first two approximations and comment on their signs.
  7. An implementation updates x before evaluating F(x, y). Why is this wrong for ordinary Euler, and how should it be repaired?
Fully explained answers
  1. Substitution gives −2, 0 and 2 respectively. The first segment slopes down, the second is horizontal and the third slopes up. The slope depends on both coordinates, so changing y at the same x can reverse its sign.
  2. Along y = x the equation's right-hand side equals zero. But the derivative of the proposed function y(x) = x is 1. Since 1 ≠ 0, it fails the defining equation. A locus of horizontal segments need not be a constant solution or any solution.
  3. The update multiplies y by 1 + 0.1 × 2 = 1.2. Thus y₁ = 3.6 at x = 0.1 and y₂ = 4.32 at x = 0.2. Report y(0.2) ≈ 4.32; the exact solution is 3e2x, so the method output is an approximation.
  4. At (0, 2), the slope is 2, giving y₁ = 3 at x = 0.5. The next slope is 0.5 + 3 = 3.5, giving y₂ = 4.75 at x = 1. Both slopes use the old coordinates of their respective steps.
  5. The number of updates is (2.2 − 1)/0.2 = 6. Including the initial point gives 7 output points. The last point occurs after the sixth update, so a loop that updates seven times would overshoot the target.
  6. The multiplier is 1 − 3(0.5) = −0.5. The first two values are −2 and 1. Their alternating signs are numerical artefacts: the exact solution 4e−3x remains positive. A smaller step is needed to represent the qualitative behaviour sensibly.
  7. Euler requires the slope at the old point (xn, yn). Updating x first uses a mixed point and changes the method when F depends on x. Store slope = F(x, y) before either update, or store both next coordinates separately and assign them afterwards.

Curriculum and sources

VCE Specialist Mathematics Units 3 and 4, Areas of Study 4 as applicable, with Outcomes 1–3. Scope follows the VCAA Mathematics Study Design 2023–2027 and the current Specialist Mathematics FAQ. Curriculum checked 15 October 2026. Teaching reference: Cambridge Senior Mathematics VCE Specialist Mathematics 3&4, second edition (2023), sections 11I–11J (pp518–527);1H (pp51–56);14D (pp642–644). All teaching prose, examples, practice questions and diagrams are original. Independent teaching material; not a VCAA publication.