Existence Theorems for Optimal Solutions in Pontryagin and Lagrange Problems