Hansen earned his bachelor's degree in electrical engineering from Purdue University in 1946 and his master's degree in mathematics in 1948, also from Purdue. During this time, he also served in the United States Marine Corps Reserve as a Second Lieutenant and was a member of the Phi Gamma Delta fraternity. Hansen received his doctorate in mathematics from Case Institute of Technology in 1958. Hansen also holds several honorary degrees.

At Georgia Tech, Hansen served as dean of engineering and, from 1969 to 1971, president of the Institute. He accepted the position of president at Purdue University from 1971 to 1982, the first Purdue alumnus to do so.<sup id="cite_ref-0" class="reference">[1]</sup> In 1982, Hansen left Purdue to become chancellor of the Texas A&M University System. Hansen left this post to become the director of research of the Hudson Institute and an educational consultant until his retirement.">