Spontaneous potential well-logging is an important technique in petroleum exploitation. To make the corresponding log interpretation chart, it is supposed that the geometrical structure of the formation, the resistivity in each subdomain, and the spontaneous potential difference on each interface are all known; then in the direct problem, the spontaneous potential u = u(r, z) satisfies an elliptic boundary value problem with jump conditions on interfaces. At the joint points A and B of the interfaces (figure 2), the jumps of the spontaneous potential do not, in general, satisfy the compatibility condition. It turns out that it is impossible to find a piecewise H1 solution to the problem, and the standard finite element method cannot be applied to get an approximate solution. In this paper, by means of a method of removing the singularities at A and B, it is proved that the problem admits a unique weak solution that is piecewise W1,p for any fixed p with 1 ≤ p <2. Moreover, based on this method a numerical scheme is suggested, and some numerical examples and some conclusions of practical interest are given. The techniques used in this paper will find a wider applicability in other problems.