The analytical technique was developed for 3D boundary problems described by Poisson's equation. It includes the analytical integration over triangle elements represent the boundary surfaces, and over hexahedral space elements represent the space charge distribution with linear approximation for surface [1] and space source distributions [2]. Analytical integration removes the kernel singularities inherent to the original Green's function which corresponds to the integral representation for the single-layer potential. Special notice was attended to the analysis of the edge singularity problem for the field gradients. The complete set of equations for self-consistent problems of electron optics includes the field equation, the motion equation for relativistic particle in electromagnetic field, and the continuity equation for space charge and current density. This non linear problem was solving by iteration procedure with charge and current relaxation. The accuracy of numerical solution was demonstrated as for the test problems as for the realistic computer design of electron gun for 75MW X-band sheet-beam klystron by comparison with experimental data obtained at SLAC [3].