Theory of functions and its applications