The paper presents a gauss pseudospectral solution for the trajectory optimization problem of a hypersonic vehicle. Determination of optimal trajectory of a hypersonic vehicle is of great interest due to the different path and boundary conditions that need to be met for high accuracy. Recent researches show that pseudospectral methods are capable of providing high accuracy in computationally efficient manner. The hypersonic vehicle optimized here is accelerated through solid rocket propulsion to mach 3.5 and after ejection of the rocket motor it is accelerated to mach 6 where it starts cruise for reaching target. The flight profile which is divided into boost, ascent, cruise and dive phase is optimized using multi-phase implementation programme of gauss pseudospectral method GPOPS. The optimization is carried out in 2D assuming non-rotating flat earth assumption and considering propulsion, dynamic and atmospheric constraints. The results are then analyzed for max range and max final velocity and hit angle. The results are found to be feasible.