(* forall n > 0. d(n) = u(n) - u(n-1) and d(0) = 0 *)
let node diff u = y where rec y = 0.0 -> u -. pre(u)

(* forall n > 0. x'(n) = k u(n) / h) - (k  u(n-1) / h)
 * x'(0) = 0 *)
let node derivative(h)(k, u) = x' where
  rec x' = diff (k *. u /. h)