"Optimization" can mean many things. Let's say you want to breech the Karman line with minimal delta-v expenditure. It becomes primarily a tradeoff between a minimization of "gravity drag" (how much delta-v you use trying to move directly up in a gravity well) and atmospheric drag (delta-v lost to air resistance). We can furture constrain the problem by stipulating a gravity turn after some pitchover conditions are meet. This is now a local optimization problem, and there may be solutions you won't capture, but in exchange we now have a fully-deterministic ascent profile, given certain boundary conditions. Lastly, for a given vehicle configuration, we can search this well-formed space (altitude, pitchover angle, and turn control parameters) to converge on an optimal solution. At this point, the biggest problem is accounting for the staging characteristics of each unique vehicle--you've entered a min-max problem space, constrained by subjective measurements like separation risk. The last sensitivity I should point out is that of models. How high are you shooting (i.e., what model determines your objective), what kind of atmospheric/drag/gravitational models are you using, how are you modeling and/or integrated control through the beginning, pitchover, and throttling sequences, etc. If you are a controls scientist or systems engineer, "optimization" means something very specific. With a problem with these qualitative sensitivities and discrete/discontinuous behaviors, analytical optimization is a pipedream. However, proper constraints of your design space and selection of appropriate models will let you find a near-optional solution numerically.