Derivation of Optimal Guidance and Control Problem