Mathematics / Free calculator

Euler & Runge–Kutta numerical solver

Solve a first-order initial value problem with Euler or classical fourth-order Runge–Kutta and inspect each iteration.

01 Your inputs

Use x and y, + − * / ^, and functions such as sin(x), exp(x), sqrt(x), and ln(x).

Entered function
f(x,y)=y
Numerical method

Calculated on your device. Inputs are not transmitted or stored.

02 Your result

Enter your values and select Calculate.

The method

yn+1=yn+k1+2k2+2k3+k46

A worked example

For y′ = y, y(0) = 1, h = 0.1 and 10 steps, RK4 gives y(1) ≈ 2.7182797441. The independent exact solution is e ≈ 2.7182818285; absolute error is about 2.0843 × 10⁻⁶.

Assumptions & limits

Fixed-step Euler or RK4, 1–80 steps, nonzero positive or negative step size. Steps too small to distinguish intermediate x coordinates are rejected. This is not an adaptive or stiff solver. Repeat with a smaller step size to check convergence. Domain errors and nonfinite outputs are rejected. Expressions use a restricted parser; no JavaScript evaluation.

Calculation source: Selected expression parser and RK4 implementation from Math Workbench beta 0.5.

Explore Math Workbench ↗