Calculate the line integral $I(a,b)=\int_{x^2+y^2=R^2}\limits\ln\frac{1}{\sqrt{(x-a)^2+(y-b)^2}} ds\quad(a^2+b^2\ne R^2).$ Calculate the line integral $$I(a,b)=\int_{x^2+y^2=R^2}\limits\ln\frac{1}{\sqrt{(x-a)^2+(y-b)^2}} ds\quad(a^2+b^2\ne R^2).$$
The parametrized integral path can be given as
$$x=R\cos t,y=R\sin t,t\in[0,2\pi].$$
Then I get into trouble when computing the integral
$$-\frac{1}{2}\int_{0}^{2\pi}R\ln(a^2+b^2+R^2-2aR\cos t-2bR\sin t) dt.$$
Should I take the derivative with respect to $R$ first? Or apply integration by parts?
Update: I find the offered answer is
$$I(a,b)=-2\pi R\ln\max\{R,\sqrt{a^2+b^2}\}$$
and I have examined its correctness.
 A: Hint : $$W=C\sin(t)+D\cos(t)=(\sqrt{C^2+D^2})(\frac{C}{\sqrt{C^2+D^2}}\sin(t)+\frac{D}{\sqrt{C^2+D^2}}\cos(t))$$
$$W=\sqrt{C^2+D^2}\sin(t+\phi)=E\sin(t+\phi)$$
with $\cos(\phi)=\frac{C}{\sqrt{C^2+D^2}}$ and $ \sin(\phi)=\frac{D}{\sqrt{C^2+D^2}}$
so $$I=\int_0^{2\pi} \ln(A+C\sin(t)+B\cos(t))\text{d}t=\int_0^{2\pi} \ln(A+E\sin(t+\phi))\text{d}t$$
here a formal calculation software can complete the calculation
A: As noted in @Dattier answer,
\begin{align}
I&=-\frac{1}{2}\int_{0}^{2\pi}R\ln(a^2+b^2+R^2-2aR\cos t-2bR\sin t) dt\\
&=-\frac{1}{2}\int_{0}^{2\pi}R\ln(a^2+b^2+R^2-2R\sqrt{a^2+b^2}\cos t) dt\\
\end{align}
If $a^2+b^2<R^2$, 
$$ \ln(a^2+b^2+R^2-2R\sqrt{a^2+b^2}\cos t)=2\ln R +\ln(1-2z\cos t +z^2)$$
with $z=\frac{\sqrt{a^2+b^2}}{R}$. We have a decomposition of the second $\ln$ using a generating function for the Chebyshev polynomials:
$$ \ln(1-2z\cos t +z^2)=-2\sum_{n=1}^\infty \frac{\cos nt}{n}z^n$$
Integral over $0,2\pi$ of each term of this series is zero, by symmetry. Thus
$$ I=-2\pi R\ln R$$
If $a^2+b^2>R^2$, calculating along the same lines gives
$$ I=-2\pi R\ln \sqrt{a^2+b^2}$$
A: As you did, let $z=x+yi=R\cos t+iR\sin t=Re^{it}$. Let $A=a+bi$. Then $ds=Rdt=\frac{R}{iz}dz$ and hence
\begin{eqnarray}
I(a,b)&=&\int_{x^2+y^2=R^2}\limits\ln\frac{1}{\sqrt{(x-a)^2+(y-b)^2}} ds\\
&=&-\frac{1}{2}\int_{|z|=R}\ln(|z-A|) ds\\
&=&-\frac{R}{2}\Re\int_{|z|=R}\ln(z-A) ds\\
&=&-\frac{R}{2}\Re\int_{|z|=R}\frac{\ln(z-A)}{iz}dz.
\end{eqnarray}
If $|A|>R$, then $\ln(z-A)$ is analytic inside $|z|=R$ and hence
\begin{eqnarray}
I(a,b)&=&-\frac{R}{2}\Re2\pi\ln(-A)\\
&=&-\pi R\ln|A|.
\end{eqnarray}
I have problem for $|A|<R$.
