In 1807 Hansteen began the inquiries in
terrestrial magnetism with which his name is especially associated. His first scientific publication was printed in
Journal de Physique, following a contest on magnetic axes created in 1811 by the
Royal Danish Academy of Sciences and Letters. In 1813 he was given a research scholarship by the recently established (in 1811)
Royal Frederick University in Christiania, with a promise of a future academic position. After marrying Johanne Cathrine Andrea Borch in May 1814, they left for Norway in the summer. Due to the
Swedish campaign against Norway in 1814, they opted to travel by sea, and were threatened by a Swedish
privateer as well as seized by a British frigate en route. Reaching Norway after five days, they settled in the street
Pilestredet. In 1842 Hansteen wrote his
Disquisitiones de mutationibus, quas patitur momentum acus magneticae. He also contributed various papers to different scientific journals, especially
Magazin for Naturvidenskaberne. Hansteen was a member of the
Royal Norwegian Society of Sciences and Letters from 1818 and of the
Norwegian Academy of Science and Letters from 1857, as well as several learned societies in other countries, including the
Royal Swedish Academy of Sciences (1822) and a Foreign Honorary Member of the
American Academy of Arts and Sciences (1863). He was a member of the board of the
Royal Norwegian Society for Development for many years, and also chaired the board of the
Norwegian National Academy of Craft and Art Industry. ==Later life==