maxwell 's famous equations , which first saw the light of day in 1864 , deployed mathematics to explain the interactions between electric and magnetic fields and demonstrated the principles behind electromagnetic waves created when electric and magnetic fields oscillate simultaneously .