 According to Robert H. Justman (qv) in his book "Star Trek: The  Real Story", this shows famous theme was not the first one written.  Lalo Schifrin (qv) had written a main theme, but creator and  executive producer Bruce Geller (I) (qv) decided that it was  inappropriate. Instead, Geller used some chase music Schifrin had  written for the end of the first episode. That throwaway musical cue  became one of the most famous and recognizable television show  themes in history.