We study the solvability of the minimization problem \[ \min_{\eta \in\Kd} \int_0^T \alpha(t)[f(|\eta'(t)|)+g(\eta(t))]\, dt\,, \] where $\Kd$ is a subset of $AC_{loc}[0,T[$ depending on the weight function $\alpha$. Neither the convexity nor the superlinearity of $f$ are required. The main application concerns the existence and uniqueness of minimizers to integral functionals on convex domains $\Omega \subset \R^{N}$, defined in the class of functions in $\Wuu (\Omega)$ depending only on the distance from the boundary of $\Omega$. As a corollary, when $\Omega$ is a ball we obtain the existence of radially symmetric solutions to nonconvex and noncoercive functionals