Optimal control theory with economic applications