We consider the classical autonomous constrained variational problem of minimization of \int_a^b f(v(t),v′(t))dt in the class Ω:={v ∈ W^{1,1}(a,b): v(a) = α, v(b) = β,v′(t) ≥ 0 a.e. in (a,b)}, where f : [α,β] × [0,+∞) → R is a lower semicontinuous, nonnegative integrand, which can be nonsmooth, nonconvex and noncoercive. We prove a necessary and sufficient condition for the optimality of a trajectory v ∈ Ω in the form of a DuBois-Reymond inclusion involving the subdifferential of Convex Analysis. Moreover, we also provide a relaxation result and necessary and sufficient conditions for the existence of the minimum expressed in terms of an upper limitation for the assigned mean slope (β − α)/(b − a). Applications to various noncoercive variat...