When was it proposed that electricity and magnetism were distinct effects by scientists William Gilbert ?
Ørsted 's work influenced Ampère to produce a theory of electromagnetism that set the subject on a mathematical foundation .