Euler method

Description

The Euler method is a procedure of numerical integration to solve ordinary differential equations from an initial value. To start, we have to make nn intervals of hh width:

h=xnxn1nh = \dfrac{x_{n} - x_{n-1}}{n}

With this intervals, we get the points x0x_0, x1x_1, …, xnx_n, where xi=x0+ihx_i = x_0 + ih. The initial condition y(x0)=y0y(x_0) = y_0 is the point P0=(x0,y0)P_0 = (x_0, y_0) and we can evaluate the function in P0P_0:

F(x)=dydxP0=f(x0,y0)=y1y0x1x0F^{\prime}(x) = \left.\dfrac{dy}{dx}\right|_{P_0} = f(x_0, y_0) = \dfrac{y_1 - y_0}{x_1 - x_0}

Solving for y1y_1:

y1=y0+(x1x0)f(x0,y0)=y0+hf(x0,y0)y_1 = y_0 + (x_1 - x_0)f(x_0, y_0) = y_0 + hf(x_0, y_0)

Solving the approximations, we get:

y1=y0+hf(x0,y0)yi+1=yi+hf(xi,yi)yn=yn1+hf(xn1,yn1)\begin{aligned} y_1 & = y_0 + hf(x_0, y_0) \\ & \vdots \\ y_{i + 1} & = y_i + hf(x_i, y_i) \\ & \vdots \\ y_{n} & = y_{n - 1} + hf(x_{n - 1}, y_{n - 1}) \\ \end{aligned}

Calculator