Stav dette: Optimal control theory with applications in economics