def rk4_step(f, x0, t0, t1):
    """
    One time step of Runge-Kutta method

    f  : function dx_dt(t0, x0)
    x0 : initial condition
    t0 : this step time
    t1 : next step time
    """
    delta_t = (t1 - t0)
    delta_t_half = delta_t * 0.5
    t_half = t0 + delta_t_half
    
    # Step 1
    s1 = f(t0, x0)

    # Step 2
    s2 = f(t_half, x0 + s1 * delta_t_half)

    # Step 3
    s3 = f(t_half, x0 + s2 * delta_t_half)

    # Step 4
    s4 = f(t1, x0 + s3 * delta_t)

    # Step 5
    s = (1.0 / 6.0) * (s1 + (s2 + s3) * 2 + s4)

    # Step 6
    x1 = x0 + s * delta_t

    return x1