Euler's numerical method (HL)

One of the few calculus topics that is studied in greater depth in AI HL than AA HL.

Contents

Theory

In interpretations of derivatives, it was mentioned that a smooth curve can be approximated by a series of jagged lines segments as each line segment becomes small.

This is exactly what we do in Euler’s method.

Given some differential equation

dydx=f(x,y)\frac{\d y}{\d x} = f(x, y)

and some initial point (x0,y0)(x_0, y_0), and a step size hh, then each successive value of xx, and yy is

xn+1=xn+hx_{n+1} = x_n + h
yn+1=yn+hf(xn,yn)y_{n+1} = y_n + hf(x_n, y_n)

Note that each iteration depends on only the previous iteration. f(xn,yn)f(x_n, y_n) is the estimate for the gradient of the line. hh is Δx\Delta x. So the equation for yy is saying

Δyn+1=Δxngradientn\Delta y_{n+1} = \Delta x_n \cdot \text{gradient}_n

On some calculators, you instead use

xn=xn1+hx_{n} = x_{n-1} + h
yn=yn1+hf(xn1,yn1)y_{n} = y_{n-1} + hf(x_{n-1}, y_{n-1})

In both cases, start with x0,y0x_0, y_0, and after kk iterations, return yky_k as a final answer. Questions could also sometimes ask for (xk,yk)(x_k, y_k) instead.

Practice

Use sequence mode or recursion mode or spreadsheet on your calculator to implement a solution. As your calculator gets reset before your exams, it is good practice to make the math wrap as opposed to display in one line.

Given that

dydx=y21+x,    y(0)=1\frac{\d y}{\d x} = \frac{y^2}{1+x},\;\; y(0) = 1

Use a step size of h=0.1h= 0.1, estimate yy when x=0.5x = 0.5

On TI-84 Plus, u, v, w are available via 2ND + 7, 2ND + 8, 2ND + 9. Here we presume the lists or sequences are named u, v, w etc. It depends on specific model of your calculator.

  1. Set calculator to sequences mode.
  2. In y=, set nMin to 0.
  3. Define u(nMin) = 0, u(n) = 0.1*n, for a list of xnx_n
  4. Define v(nMin) = 1, v(n) = v(n-1) + 0.1*(v(n-1)^2/(1+u(n-1))), for a list of yny_n
  5. See table of values where n is 5, and u(n) is .5, and find v(n) to be 1.6225 \qed

Typically, writing down a full, correct list of each yny_n is sufficient for full marks.

In the above example, an extra set of parentheses were used after h*, which is a good practice in case f(x,y)f(x, y) is not a fraction, though not necessary in this particular question.