Suppose a cost function $J$ is defined as follows, $J=J(U(\alpha),\alpha)$ where $U$ and $\alpha$ Finite difference method: