In this paper, we propose a generalization of the fractional Euler–Lagrange equations of the form: \(\begin{aligned} \dfrac{\partial F}{\partial y}(t,y,~_{0}D_{t}^{\alpha }y) + ~_{t}D_{T}^{\alpha }\left( \dfrac{\partial F}{\partial ~_{0}D_{t}^{\alpha } y} ( t,y,~_{0}D_{t}^{\alpha }y)\right) = 0, ~\forall t \in [0,T], \end{aligned}\) where \(_{t}D_{T}^{\alpha }\) and \(_{0}D_{t}^{\alpha }\) are the right and left Riemann-Liouville fractional derivatives of generalization order \(n-1< \alpha < n\) . Based on the variational methods, the main theorems provide some new results regarding the existence a weak solution which the previous results are a special case of our problem. These equations appear for problems of the calculus of variations with functionals containing fractional derivatives.