In the simulation of space vehicles, we often encounter the trajectory prescribed path control (TPPC) problems. That is, we usually append a set of path constraints to the equations of motion for describing the shape of the trajectory. To describe the TPPC problem, the concept of the differential-algebraic equation (DAE) system is usually adopted. In this paper, the optimal guidance law for aircraft dynamics is derived based on a DAE approach. We will reformulate the problem as a Hamiltonian DAE system. After establishing the system of aircraft dynamics, we can derive the optimal guidance law of the system by numerical method. The numerical method is mainly based on the backward differential formulas (BDF).