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

Here are two approaches available on TI-84 Plus. Analogous approaches exist for other models.

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

Also if you are to estimate a point on the solution to the right of the initial point, then your hh is positive. Otherwise if you are asked to estimate a point to the left of what’s given, use the same hh but make it negative, eg h=0.1h = -0.1.

TI-84 method using command concatenation

This method is by Dr. William J. Larson .

Multiple commands can be re-run together if they are separated by : or A‑LOCK ALPHA 𝑖 .

  1. Set the initial value and step. Here the given point is (0,1)(0, 1) and step size is 0.10.1. So set 0→X, ie CATALOG _ 0RCL X STO>link X,T,θ,n. Using the alpha letters, store 1 in Y and 0.1 in H.
  2. Enter Y+H*Y^2/(1+X)→Y:X+H→X:{X,Y}. The curly brackets are available from 2ND { K ( and 2ND } L ). This updates Y and X and prints the new values. Note that Y is updated first so it uses the old X value.
  3. Hit ENTRY SOLVE ENTER to see the results after each step. Write down the point.
  4. Repeat Step 3 until the desired xx is reached.

Theoretically, this should work for HP Prime as well though it has not been personally tested.

For Casio calculators, you can use shift + exe instead of the colon. What this does is that it allows you to write a new command in the next line.

TI-84 method using sequences mode (legacy)

This is the method typically taught for numerical method. It’s slightly longer. For AA HL, the previous method works very well, but for completion the sequence mode method is also included.

On TI-84 Plus, u, v, w are available via 2NDU O 7, 2NDV P 8, and 2NDW Q 9, respectively. 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. QUIT MODE choose SEQ instead of FUNC.
  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

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.

For the TI-84 Plus CE, you should use the option of SEQ(n+1), as it reduces all the u(n-1) and v(n-1) to simply u(n) and v(n). Also you will be setting u(1) and v(1) instead of u(nMin) and v(nMin).