In this paper, the formation mission design problem for commercial aircraft is studied. Given the departure times and the departure and arrival locations of several commercial flights, the relevant weather forecast, and the expected fuel savings during formation flight, the problem consists in establishing how to organize them in formation or solo flights and in finding the trajectories that minimize the overall direct operating cost of the flights. Since each aircraft can fly solo or in different positions inside a formation, the mission is modeled as a switched dynamical system, in which the discrete state describes the combination of flight modes of the individual aircraft and logical constraints in disjunctive form establish the switching logic among the discrete states of the system. The formation mission design problem has been formulated as an optimal control problem of a switched dynamical system and solved using an embedding approach, which allows switching decision among discrete states to be modeled without relying on binary variables. The resulting problem is a classical optimal control problem which has been solved using a knotting pseudospectral method. Several numerical experiments have been conducted to demonstrate the effectiveness of this approach. The obtained results show that formation flight has great potential to reduce fuel consumption and emissions.