An analytic approach to electromagnetic scattering problems