On Generalized Solutions to Some Problems in Electromagnetism and Geometric Optics