In this paper, we consider the main problem
of variational calculus when the derivatives are
Riemann–Liouville-type fractional with incommensurate
orders in general. As the most general form of the
performance index, we consider a fractional integral
form for the functional that is to be extremized. In the
light of fractional calculus and fractional integration
by parts, we express a generalized problem of the calculus
of variations, in which the classical problem is
a special case. Considering five cases of the problem
(fixed, free, and dependent final time and states), we
derive a necessary condition which is an extended version
of the classical Euler–Lagrange equation. As another
important result, we derive the necessary conditions
for an optimization problem with piecewise
smooth extremals where the fractional derivatives are
not necessarily continuous. The latter result is valid
only for the integer order for performance index. Finally,
we provide some examples to clarify the effectiveness
of the proposed theorems.