Autograd, automatic differentiation, and adjoint optimization: basics