Differentiable programming and its applications to dynamical systems