Defaults: k=0.5, h=0.1, x_end=4, y0=10. The exact value is y(4) = 10*e^-2 ≈ 1.3534. Increasing h explodes the Euler error.
x axis: x in [0, x_end]; y axis: y. White heavy line: exact y = y0*exp(-k*x); blue: RK4; red: Euler. With small h, RK4 nearly overlaps the exact curve while Euler droops below it; with large h, the Euler gap becomes obvious.
x axis: x; y axis: log10|y_num - y_exact|. Blue: RK4 absolute error; red: Euler absolute error. RK4 is several decades smaller than Euler (about 1e5 difference at h=0.1), and both grow with x at very different rates.
The ODE and its exact solution:
$$\frac{dy}{dx} = -k\,y,\qquad y(0)=y_0 \;\Longrightarrow\; y(x) = y_0\,e^{-kx}$$Explicit Euler (first-order, global error O(h)):
$$y_{n+1} = y_n + h\,f(x_n, y_n) = y_n(1-kh)$$Classical fourth-order Runge-Kutta (RK4, global error O(h^4)):
$$\begin{aligned}k_1 &= h\,f(x_n, y_n)\\ k_2 &= h\,f(x_n+\tfrac{h}{2}, y_n+\tfrac{k_1}{2})\\ k_3 &= h\,f(x_n+\tfrac{h}{2}, y_n+\tfrac{k_2}{2})\\ k_4 &= h\,f(x_n+h, y_n+k_3)\\ y_{n+1} &= y_n + \tfrac{1}{6}(k_1+2k_2+2k_3+k_4)\end{aligned}$$$k$ is the decay rate (time constant $\tau=1/k$), $h$ is the step size and $y_0$ is the initial value. Euler uses only the starting slope, RK4 takes a Simpson-style weighted average of four slopes; halving $h$ shrinks Euler error by 1/2 and RK4 error by 1/16.