The first part covers the general theory, encompassing all key results and illustrating them with significant examples. The latter part is devoted to applications concerning the Bolza problem in the calculus of variations and optimal exit time problems for nonlinear control systems. The exposition is essentially self-contained since the book includes all prerequisites from convex analysis, nonsmooth analysis, and viscosity solutions.