Advanced calculus and its applications in variational quantum mechanics and relativity theory. (2021)