Toward using automatic differentiation