Module 39 of 46Lesson 1 of 9 · HL · Diff eqs & series 1 · Slope fields & Euler’s method
1
Differential equations & Maclaurin series · Essential understanding 1

Slope fields & Euler's method

IB AA AHL 5.18with Prof. Kitso
💻 Using the TI-Nspire CX Student Software on a laptop
  • The screens in these notes are drawn exactly as the Student Software shows them. The keypad on the left of the software works like the handheld — click its keys with the mouse.
  • menu: click menu on the on-screen keypad (or Documents Toolbox ▸ 🔧). The menu numbers and letters are the same as in these notes.
  • enter = Enter  ·  tab = Tab (next box)  ·  esc = Esc  ·  del = Backspace.
  • Powers: type ^ (Shift+6), the power, then press → to come back down before typing more. x² = ^2 then →.
  • Fraction: type /  ·  √: type sqrt(  ·  π: type pi  ·  eˣ: type exp(  ·  store: type :=. For EE (×10ⁿ) and i, click them on the keypad.
  • New page: Ctrl+I (or the Insert menu)  ·  change page: Ctrl+← / Ctrl+→  ·  graph entry line: Ctrl+G  ·  var: Ctrl+L.
  • Radian / Degree: click Settings in the status bar at the bottom of the window. The mode (RAD or DEG) shows in the top bar.
  • IB exam mode (Press-to-Test): everything in these notes works on the non-CAS TI-Nspire with the IB exam settings. In exam mode there are no dot-product, cross-product, unit-vector or eigenvalue keys and no Diff Eq graphs — the notes show the allowed way (type the components, use polyRoots on the characteristic equation, do Euler steps on a Calculator page).
  • If you type nDeriv(, the software shows it as centralDiff( — it is the same command.
The big idea: A differential equation tells you the gradient at every point. Euler's method turns that into a walk: take a small step along the gradient, recalculate the gradient, step again.
By the end of this lesson you can:
  • read a differential equation as a rule for the gradient at any point
  • use Euler's method by hand, with a clear table
  • use a spreadsheet (Lists & Spreadsheet) to run many Euler steps for Paper 2
  • explain why a smaller step size gives a better answer
  • apply Euler's method when the variables are named , , and so on
🧑🏾 Imagine this…
You are walking across the Kalahari in thick fog. You cannot see where you are going, but a compass tells you the direction to walk right here, right now. You walk 10 steps that way, stop, check the compass again, and walk 10 more. You will not follow the perfect curved path, but you will end up close. That is Euler's method. The compass is the equation .
Differential equation
an equation that contains a derivative, such as . It gives the gradient at each point .
Initial condition
one known point, such as , which means when . It picks one curve from the family of solutions.
Slope field
a grid of tiny line segments; each has the gradient given by the equation at that point. Solution curves follow the segments.
Step size h
how far moves in each step of Euler's method.
★ Euler's method (in the formula booklet)
  • Start at . Then and .
  • In words: new y = old y + (step size) × (gradient at the OLD point).
  • If the variables are and :

    .
  • Number of steps to get from to a target : .
  • A smaller means more steps and usually a more accurate answer.
  • Exam mode: the GDC cannot draw slope fields or run an Euler command (they are blocked). Work out a few gradients on the Calculator page and sketch the field by hand; do Euler with a one-line recursion or a spreadsheet (Example 1.3).
⚠️ Mistakes that lose marks
  • Using the gradient at the new point. Euler always uses the old point .
  • Forgetting to add to each time, so the next gradient uses the wrong .
  • Rounding too early. Keep full values in the working and round only the final answer to 3 s.f.
🧪 Try it yourselfSee the slope field and Euler's walk
The grey dashes are the gradients of . The orange path is Euler's method starting at with 8 steps. Drag h and watch the end point. At , 8 steps reach ; compare with Example 1.3 (same equation, ).

Worked examples

Example 1.1Two Euler steps by hand
Given and when , use Euler's method with step size to estimate when .
🧠 Think it through
  1. Start: . We need steps.
  2. Step 1: find the gradient at , multiply by , add to .
  3. Step 2: do the same from the new point.
✍️ By hand
(M1)
(A1)
✅ Answer
The true value is 1.797 (found by a method in Lesson 4). Two big steps undershoot a curve that is bending upwards: we will see why in Example 1.4.
Example 1.2Starting away from zero
A curve satisfies and passes through . Use Euler's method with to estimate when .
🧠 Think it through
  1. Steps needed: .
  2. Be careful: the first gradient uses , not .
✍️ By hand
(M1)
(A1)
✅ Answer
Write the answer as a decimal. In Paper 1 an exact fraction is also fine: .
Example 1.3Five steps with a spreadsheet (Paper 2)Paper 2 style
For , use Euler's method with to estimate . The exact value is 1.79744. Find the percentage error.
🧠 Think it through
  1. steps: far too slow to do by hand with full working, so use the spreadsheet.
  2. Column A holds , column B holds . Each B cell uses the A and B cells just above it.
  3. Percentage error .
✍️ By hand
(3 s.f.)
🔢 On your TI-Nspire CX II
  1. Open 1.1 Lists & Spreadsheet. Name column A x and column B y.
  2. Type the starting values 0 and 1 in the first cells of A and B.
  3. Click the second cell of column A and type =a1+0.1. In the second cell of B type =b1+0.1*(a1+b1). (This is exactly .)
    1.1*DocRAD◆Ax=a1+0.100.1By=b1+0.1*(a1+b1)11.1CD12A10
  4. Select both new cells, press ctrl💻 Ctrl C, then select the cells below down to row 6 and press ctrl💻 Ctrl V. The spreadsheet fills the table.
    1.1*DocRAD◆Ax00.10.20.30.40.5By11.11.221.3621.52821.72102CD123456A10
    Row 6 is x = 0.5
  5. Quicker alternative on a Calculator page: type x:=0: y:=1, then y:=y+0.1*(x+y): x:=x+0.1: y and press enter ↵💻 Enter five times. Each press is one step and shows the new .
    📍 Where to find it on the TI-Nspire
    ⌨️ store a value: type := (colon, then equals) on the keyboard
    1.1*DocRADx:=0:y:=11y:=y+0.1·(x+y):x:=x+0.1:y1.1y:=y+0.1·(x+y):x:=x+0.1:y1.22y:=y+0.1·(x+y):x:=x+0.1:y1.362y:=y+0.1·(x+y):x:=x+0.1:y1.5282y:=y+0.1·(x+y):x:=x+0.1:y1.72102
    Five steps: y(0.5) ≈ 1.72102
  6. On a Calculator page: abs(1.72102-1.79744)/1.79744*100.
    📍 Where to find it on the TI-Nspire
    ⌨️ type abs( on the keyboard; the screen shows it as | |
    1.1*DocRAD|1.72102−1.79744|1.79744·1004.2516
✅ Answer (3 s.f.); percentage error .
Example 1.1 used and gave 1.625 (error 9.6%). Halving the step size more than halved the error.
Example 1.4Does a smaller step size help?
For with , Euler's method is used to estimate .
  1. (a) Use (by hand).
  2. (b) The results for and are 2.4414 and 2.5937. The exact value is . Describe what happens as gets smaller.
  3. (c) Explain why every estimate is below the exact value.
🧠 Think it through
  1. Here the gradient equals itself, so each step multiplies by .
  2. Two steps of 0.5 reach .
  3. A curve that bends upwards is always above its tangent lines.
✍️ By hand
(A1)
✅ Answer (a) 2.25. (b) The estimates 2.25, 2.4414, 2.5937 get closer to 2.7183 as decreases. (c) The solution curve is concave up (it bends upwards), so each tangent step lands below the curve and the errors build up.
Euler's method will not make the error vanish for a fixed , but halving roughly halves the error.
Example 1.5A population model (Paper 2)Paper 2 style
The number of kudu (in hundreds) in a reserve after years satisfies . Initially . Use Euler's method with to estimate the number of kudu after 3 years.
🧠 Think it through
  1. The variables are and , so with .
  2. Three steps. The right-hand side has no , so only is needed each time.
  3. Remember the units: is in hundreds.
✍️ By hand
🔢 On your TI-Nspire CX II
  1. In Lists & Spreadsheet put in column A (0, then =a1+1) and in column B starting at 10.
  2. In B2 type =b1+1*0.1*b1*(1-b1/100) and fill down to row 4.
    1.1*DocRAD◆At0123Bp=b1+0.1*b1*(1-b1/100)1010.911.871212.9174CD1234A10
✅ Answer hundred, about 1290 kudu.
Notice the growth rate is 0.9 in year 1, then 0.97, then 1.05: the population is speeding up while still far below the limit of 100 hundred.

Challenge questions

⭐ Challenge 1.6Estimating with EulerPaper 1 style
A curve satisfies and passes through .
  1. (a) Use Euler's method with to estimate .
  2. (b) The true value is . Find the absolute error of your estimate.
  3. (c) Suggest how the error could be reduced.
✏️ Try it on paper and on your calculator first. Then check.
Show the full solution
🧠 Think it through
  1. Two steps. The first gradient is .
  2. Error = estimate minus exact, then take the size.
  3. Think about .
✍️ By hand
(A1)
(A1)
✅ Answer (a) 1.25. (b) About 0.40 (the estimate is too low). (c) Use a smaller step size , for example 0.1 or 0.05 (needs more steps; use a spreadsheet).
The first step gives no growth at all, because the gradient at is zero. This is why the estimate is so poor.
⭐ Challenge 1.7Where does e come from?Paper 3 style
Investigate Euler's method on with , where is a constant.
  1. (a) Show that , and hence that .
  2. (b) Take and estimate using steps of size . Complete the table for .
  3. (c) Describe what the values approach, and write down the exact solution of .
  4. (d) Now let be any value and use steps of size . Write an expression for the estimate of and suggest what it tends to as .
✏️ Try it on paper and on your calculator first. Then check.
Show the full solution
🧠 Think it through
  1. The gradient at step is . Put this into the Euler formula and factorise.
  2. Each step multiplies by the same number, so this is a geometric pattern.
  3. For (b) work out for each on the calculator.
  4. In (d) the common ratio becomes .
✍️ By hand
(M1)(AG)
(R1)
🔢 On your TI-Nspire CX II
  1. On a Calculator page type (1+1/1000)^1000 and press enter ↵💻 Enter to check the last value; repeat with other .
  2. Use ctrl💻 Ctrl enter ↵💻 Enter if you want the decimal form.
    1.1*DocRAD1+11001002.704811+1100010002.71692e12.71828
✅ Answer (b) 2, 2.25, 2.5937, 2.7048, 2.7169. (c) The values approach ; exact solution . (d) as , so the solution of with is .
This is the original definition of e: compound interest with smaller and smaller periods. Euler's method with tiny steps IS the exponential function.
Next: Lesson 2 · Separation of variables