compute jacobian