MathorynMathematical Formula Database

Differential Equations

Euler's Method

Euler's method approximates the solution of y′=f(x,y)y'=f(x,y) by taking small straight steps along the slope field. It is the simplest numerical method for differential equations; its error shrinks roughly in proportion to the step size hh. It is used to sketch solutions and to introduce better methods such as Runge–Kutta.

yn+1=yn+h f(xn,yn),xn+1=xn+hy_{n+1}=y_n+h\,f(x_n,y_n),\qquad x_{n+1}=x_n+h
LaTeXy_{n+1}=y_n+h\,f(x_n,y_n),\qquad x_{n+1}=x_n+h

Variables

hh
step size
f(x,y)f(x,y)
right-hand side of the ODE
xn, ynx_n,\ y_n
current approximation

Example

Approximate y(1)y(1) for y′=yy'=y, y(0)=1y(0)=1 with h=0.25h=0.25.

  1. Each step multiplies by 1+h=1.251+h=1.25.
  2. After 44 steps: 1.2541.25^4.
  3. The exact value is e≈2.7183e\approx2.7183.

Answer: y(1)≈2.4414y(1)\approx2.4414.

Related formulas