Elements of the mathematical theory of electricity and magnetism