The integral method can effectively analyze magnetic fields, but the traditional integral method can analyze only coils with regular geometries. Therefore, a new integral method was developed to calculate the three-dimensional (3-D) magnetic field created by an arbitrary geometry coil with a rectangular cross section using the local coordinate method and a 3-D coordinate transformation. However, when the field points are on the surface of the coil or the basic segment is the right angle trapezoidal prism, singularities occur that make the numerical analysis of the magnetic field more difficult. Thus, we present here some mathematical methods to eliminate the singularities to allow accurate numerical analysis of the magnetic field. We validate the integral method by comparing it with the analytical solutions for regular geometry coils.