The eigenvalue problem of the angular part of generalized spheroidal wave equations (SWE) for describing the scattering of a charged particle on two Coulomb centers with different charges is cast in a matrix form which is then solved by a standard matrix procedure. This simple mathematical method is shown to be the most efficient and accurate among the others given for obtaining the solution to the ordinary SWE and the generalized SWE. An application to a complete solution for describing the scattering of a charged particle by a dipole is presented. The mathematical method for the analytical solution to the radial part of SWE obtained by series expansion in Coulomb wave functions for the two-center Coulomb scattering is found to be more efficient and accurate than the numerical methods. In the conclusion this work provides an analytical solution to the generalized spheroidal wave equation and the Green's function of one-electron diatomic molecules.