Set . Periodicity and separation of variables give the angular modes , , and . The radial equation is
whose solutions are for ; the zero mode has solutions and . Thus a general real harmonic function on the annulus is
The boundary data contain only the cosine mode, so write
The condition at gives , and the condition at fixes . The Dirichlet problem on an annulus for one Fourier mode therefore has solution
For the nonconstant boundary data, use separation of variables in polar coordinates and put . Laplace's equation reduces to
This Cauchy-Euler equation has independent solutions and . Unlike a disk containing the origin, the annulus permits both. The zero inner boundary value requires , and the outer value requires . Hence
Substituting gives zero, while gives . This is the Dirichlet problem on an annulus for one Fourier mode; no other angular mode is needed.
For the changed inner boundary value, use superposition to add a radial harmonic function that is at and zero at . The radial zero-mode equation is , giving . Imposing the two constant boundary values gives
Therefore the second answer is
The logarithmic term is independent of , so it changes only the angular average of the electric potential. Both answers are unique for these Dirichlet boundary conditions, by uniqueness for Laplace's equation.