This paper considers the optimal control problem for linear hybrid automata. In particular, it is shown that the problem can be transformed into a constrained optimization problem whose constraints are a set of inequalities with quantifiers. Quantifier Elimination (QE) techniques are employed in order to derive quantifier free inequalities that are linear. The optimal cost is obtained using linear programming. The optimal switching times and optimal continuous control inputs are computed and used in order to derive the optimal hybrid controller. Our results are applied to an air traffic management example.