The optimal control problems considered here seek to determine a time-varying control action and a set of time-invariant parameters that optimize the performance of a dynamic system whose behaviour is described by index two differential-algebraic equations (DAEs).The problem formulation accommodates equality and inequality end and interior point constraints as well as constraints on control variables and parameters. The control parameterization approach, whereby the original problem is transformed into a nonlinear programming problem, is adopted.Due to the features of index two DAEs, the control representation employed may yield a discontinuous system trajectory and for this reason it is necessary to define functions yielding consistent initial conditions following control variable discontinuities. Variational analysis is carried out to derive expressions for the objective and constraint function gradients with respect to the optimization decision variables. A key characteristic of this analysis is that, ...