We study the minimum problem for functionals of the form
begin{equation*}
mathcal{F}(u) = int_{I} f(x, u(x), u^pr(x), u^pp(x)),dx,
end{equation*}
oindent
where the integrand $f:I imesR^m imesR^m imes R^m o R$ is not convex in the last variable. We provide an existence result assuming that the lower convex envelope $of=of(x,p,q,\xi)$ of $f$ with respect to $\xi$ is regular and enjoys a special dependence with respect to the i-th single components $p_i, q_i, \xi_i$ of the vector variables $p,q,\xi$. More precisely, we assume that it is monotone in $p_i$ and that it satisfies suitable affinity properties with respect to $\xi_i$ on the set ${f>of}$ and with respect to $q_i$ on the whole domain. We adopt refined versions of the integro-extremality method, extending analogous results already obtained for functionals with first order lagrangians. In addition we show that our hypotheses are nearly optimal, providing in such a way an almost necessary and sufficient condition for the solvability of this class of variational problems.