A method for obtaining analytical solutions of Maxwell equations is proposed for stationary and alternating electromagnetic fields. In contrast to traditional methods of finding the analytical solutions, based on the solution of direct problems of electrical prospecting, this method uses a specially posed inverse problem. A package of new analytical solutions of three-dimensional problems of electrical prospecting is designed