- hand-written function for computing the gradient of the linear-dynamical system (`solve`)