1

I have the following troublesome integral:

$$\int_0^{2\pi} \ln\Bigg(\frac{\color{red}{r^2}+\color{red}{r_0^2}-2rr_0\cos(\theta_0)}{r^2+\frac{a^4}{r_0^2}-2a^2\frac{r}{r_0}\cos(\theta_0)}\Bigg)d\theta_0$$

Where $r,r_0,a$ are all unspecified constants.

We could also dumb it down to a more general form: $$\int_0^{2\pi} \ln\Bigg(\frac{a-\color{red}c\cos(\theta_0)}{b-\color{red}d\cos(\theta_0)}\Bigg)d\theta_0$$ if anyone is more comfortable with this representation instead, it shouldn't change how it's solved.

The series representation of $\ln(x) = -\sum_{n=1}^\infty \frac{(-1)^n(x-1)^n}{n}$ which has a radius of convergence of $x=[0,2]$. I'll approximate this to be $\ln(x) \approx (x-1)$, so our integral would then become:

$$\int_0^{2\pi} \Bigg(\frac{\color{red}{r^2}+\color{red}{r_0^2}-2rr_0\cos(\theta_0)}{r^2+\frac{a^4}{r_0^2}-2a^2\frac{r}{r_0}\cos(\theta_0)} -1\Bigg) d\theta_0$$, right? I'm thinking that because $x = \cos(\theta_0)$, then $x = [-1,1]$ and our radius of convergence is $x=[0,2]$, that this might not work.


Main question is, is the series representation the right way to go?

Subsequent question is, is there anything wrong with my series representation?


EDIT: I forgot to change the integrand to what I had originally intended for it to be. I made the correction in red.

  • 3
    Are you sure the numerator makes sense dimensionally? Moreover, $x$ isn't just the cosine but the whole expression inside the logarithm... I suggest separating it into two logs. – Hug de Roda Aug 09 '24 at 20:56
  • @Conreu Separating into 2 logs would make finding a series representation much simpler. As for the second thing you mentioned, so we want a series representation of a function within a function (or a composite function) i.e. $\ln(\cos(\theta_0))$? And for the first thing you said, I'm not sure what you're getting at, could you clarify what you mean by "dimensionally"? – Researcher R Aug 09 '24 at 21:26
  • 2
    The argument inside logarithms, exponentials and trig. fucntions have to be adimentional. In your case the numerator has an $r$ and an $r_0$ which are distances summed with a distance squared, $2rr_0\cos\theta_0$. As for the other thing, what I mean is, once separated, $$\ln(a-b\cos\theta_0)=\ln(a)+\ln\left(1-\dfrac{b}{a}\cos\theta_0\right)$$ and the $2$nd log can be expanded using $$\ln(1-x)=\sum_{n\geq 1}\dfrac{(-x)^n}{n}$$ if and only if $\left|\dfrac{b}{a}\cos\theta_0\right|<1$ – Hug de Roda Aug 09 '24 at 21:38
  • @Conreu Thank you! – Researcher R Aug 09 '24 at 22:19
  • What is the purpose of the index in $\theta_0$ ? –  Sep 03 '24 at 17:46
  • @YvesDaoust The problem would be the same with or without the index, it's just a consequence of where the problem originates from, though I could have removed it and nothing would have changed – Researcher R Sep 03 '24 at 18:49
  • I am mostly concerned by the fact that typing this bloody useless index is boring. Same for using $\frac{a^2}{r_0}$ instead of some $r_1$. –  Sep 03 '24 at 18:51

6 Answers6

5

For simplicity, $$ \begin{aligned} \int_0^{2\pi} \ln \left(\frac{b-\cos x}{a-\cos x}\right) d x = & \int_0^ {2\pi}\left(\int_a^b \frac{1}{y-\cos x} d y\right) d x \\ = & 2\int_a^b\left( \underbrace{ \int_0^ {\pi}\frac{d x}{y-\cos x}}_{J} \right) d y \end{aligned} $$ Noticing that when $ x\mapsto \pi-x, J= \int_0^ {\pi}\frac{d x}{y+\cos x}$ and averaging the two versions yields $$ \begin{aligned} J& =\frac{1}{2} \int_0^\pi\left(\frac{1}{y-\cos x}+\frac{1}{y+\cos x}\right) d x \\ & =2 y \int_0^{\frac{\pi}{2}}\left(\frac{1}{y^2-\cos ^2 x}\right) d x \\ & =2 y \int_0^{\frac{\pi}{2}} \frac{\sec ^2 x}{y^2 \sec ^2 x-1} d x \\& =2 y \int_0^{\infty} \frac{d t}{\left(y^2-1\right)+y^2 t^2}\\&=\frac{2}{\sqrt{y^2-1}}\left[\tan ^{-1}\left(\frac{y t}{\sqrt{y^2-1}}\right)\right]_0^{\infty}\\&= \frac{\pi}{\sqrt{y^2-1}} \end{aligned} $$ Plugging back gives $$\int_0^{2\pi} \ln \left(\frac{b-\cos x}{a-\cos x}\right) d x =2\int_a^b \frac{\pi}{\sqrt{y^2-1}} d y$$ Putting $y=\cosh \theta$, we have \begin{aligned} \int_0^{2\pi} \ln \left(\frac{b-\cos x}{a-\cos x}\right) d x = & 2 \pi \int_{\cosh ^{-1} a}^{\cosh ^{-1}b} \frac{1}{\sinh \theta} \sinh \theta d \theta \\ & =2 \pi\left(\cosh ^{-1}b-\cosh ^{-1}a\right) \\ & =2 \pi\left[\ln \left(b+\sqrt{b^2-1}\right)-\ln \left(a+\sqrt{a^2-1}\right)\right] \\ & =2 \pi \ln \left(\frac{b+\sqrt{b^2-1}}{a+\sqrt{a^2-1}}\right) \end{aligned} As @Researcher R noted, replacing $a,b$ by $\frac{a}{c}$ and $\frac{b}{c}$ respectively yields generally $$\int_0^{2\pi} \ln \left(\frac{b-c\cos x}{a-c\cos x}\right) d x = 2 \pi \ln \left(\frac{b+\sqrt{b^2-c^2}}{a+\sqrt{a^2-c^2}}\right) $$

Lai
  • 31,615
  • And I notice that every step of this still holds for $c = c$. I mistakenly said that the dumbed down (or simpler) form would be for $c=1$, rather it should've been $$\int_0^{2\pi}\ln\Big(\frac{b-c \cos(\theta_0)}{a-c \cos(\theta_0)}\Big)$$. The final answer for $c = c$ would be $$2\pi\ln\bigg(\frac{b+\sqrt{b^2-c^2}}{a+\sqrt{a^2-c^2}}\bigg)$$ – Researcher R Aug 26 '24 at 22:50
  • 1
    Yes, you are right! – Lai Aug 27 '24 at 15:26
3

Hint

Consider $$I(c)=\int_0^{2\pi} \log(a-c\cos(x))\,dx \qquad \text{with}\qquad a>1$$ $$I'(c)=-\int_0^{2\pi} \frac{\cos (x)}{a-c \cos (x)}\,dx=\frac{2 \pi }{c} \left(1-\frac{a}{\sqrt{a^2-c^2}}\right)$$ $$\int_0^{2\pi} \log(a-\cos(x))\,dx =\int_0^1 I'(c)\,dc=-2 \pi \log \left(\frac{2 a}{a+\sqrt{a^2-1}}\right)$$

Do the same for the second logarithm and recombine the results in a single logarithm.

  • I hope you don't mind if I as a few questions. How did you perform the definite integration of $$-\int_0^{2\pi} \frac{\cos(x)}{a-c\cos(x)}dx$$; this integral itself looks rather involved? Was complex integration used at all by chance? – Researcher R Aug 11 '24 at 23:37
  • On the 3rd step, there's a few things I'd like to parse through. 1) the integrand lost the c term, 2) the bound of integration on $I'(c)$ (which performing this integral also looks rather intimidating) is from 0 to 1, is this bc $a>1$ and can c not be negative?, and 3) so the end result is that we've lost x and c, and now everything is in terms of a; 3) isn't so much a question and more I just found it interesting. Is the end result the solution to $I(c)$? – Researcher R Aug 11 '24 at 23:42
  • Okay so the second integral looks like you applied partial fraction decomposition and then I'm guessing you applied a technique (I had not seen before) called the Half angle tangent substitution which was used by Euler to solve $$\int_{x_0}^{x_f} \frac{dx}{a+b\cos(x)}$$ but it would be applied to $$a+i^2 b\cos(x)$$, right? – Researcher R Aug 13 '24 at 00:43
  • @ClaudeLeibovici I might be wrong but the last result is incorrect (checking computationally). What I got after taking the antiderivative of $I'(c)$ is $$I(c)=2\pi \tanh^{-1}\left(\dfrac{\sqrt{a^2-c^2}}{a}\right)+2\pi\log(c)+\text{constant}$$ When you set $c=0$ to determine the constant you get something of the sort $$2\pi\log(a)=2\pi \tanh^{-1}(\text{sign}(a))+2\pi\log(0)+C$$ which is undetermined. If you take the limit as $c\to 0$, use the log definition of arctanh and use MacLaurin series of $\sqrt{c^2-a^2}$ you'll get the limit depends on the sign of $c$ so the limit $\not\exists$. – Hug de Roda Aug 26 '24 at 00:40
  • 1
    @HugdeRoda. What I used is $I(c)=2 \pi \log \left(a+\sqrt{a^2-c^2}\right)$. For your formula, use $\tanh ^{-1}(x)=\frac{1}{2} \log \left(\frac{1+x}{1-x}\right)$ and combine the two logarithms to obtain the same result. Moreover, I wrote $a>1$. Cheers :-) – Claude Leibovici Aug 26 '24 at 05:06
  • 1
    I see, now it is correct since the values coincide numerically up to a constant. Notice though that what you wrote here and in you answer differ as $$I(c=1)=2\pi\log(a+\sqrt{a^2-1})\neq-2\pi\log\left(\dfrac{2a}{a+\sqrt{a^2-1}}\right)\enspace !$$ – Hug de Roda Aug 26 '24 at 16:21
  • @ClaudeLeibovici So I looked into this problem a little more, would this be the Feynman Integration technique? – Researcher R Sep 10 '24 at 21:19
  • 1
    @ResearcherR. Yes, it is ! – Claude Leibovici Sep 11 '24 at 04:36
2

Putting together what I've seen across different answer, I decided to piece together my own answer using an amalgamation of different workings I've seen.

Splitting up the natural log:

$$\frac{1}{4\pi}\int_0^{2\pi}\ln\Big(\frac{a^2}{r_0^2}\frac{r^2+r_0^2-2rr_0\cos\theta_0}{r^2+\frac{a^4}{r_0^2}-2\frac{r}{r_0}a^2\cos\theta_0}\Big) = \frac{1}{4\pi}\int_0^{2\pi}\ln\Big(\frac{a_1}{a_2}\frac{b_1-c_1\cos\theta_0}{b_2-c_2\cos\theta_0}\Big)d\theta_0 \\ = \frac{1}{4\pi}\Bigg[\underbrace{\int_0^{2\pi}\Big(\ln(a_1)+\ln(b_1-c_1\cos\theta_0)\Big)d\theta_0}_{(1)}-\underbrace{\int_0^{2\pi}\Big(\ln(a_2)-\ln(b_2-c_2\cos\theta_0)\Big)d\theta_0}_{(2)}\Bigg]$$

Starting with (1) by following from Claude's setup:

$$\cases{I(b_1,c_1) = \int_0^{2\pi}\ln(b_1-c_1\cos\theta_0)d\theta_0 \\ I'(b_1,c_1) = \frac{\partial}{\partial c_1} I(b_1,c_1)} \\ \text{We'll also use: }\int_0^c I'(b_1,c_1)dc_1 = I(b_1,c_1) - I(b_1,0) \rightarrow I(b_1,c_1) = I(b_1,0) + \int_0^c I'(b_1,c_1)dc \\ \text{And we can change the order of integration if we replace $c_1$ with a dummy variable : } \\I(b_1,c_1) = I(b_1,0) + \int_0^{2\pi} \Big(\int_0^c \frac{\partial}{\partial x'} f(b_1,x',\theta_0) dx' \Big)d\theta_0 = I(b_1,0) + \int_0^c \int_0^{2\pi} f(b_1,x',\theta_0)_{x'} d\theta_0 dx'$$

Solving the double integral can be done via half-angle tan substitution:

$$I(b_1,c_1) = \int_0^c \int_{-\pi}^{\pi}\frac{\cos\theta_0}{x'\cos\theta_0-b_1}d\theta_0 dx' \\ = \int_0^c\Bigg(-\frac{b_1}{x'}\int_{-\infty}^{\infty}\frac{dt}{(b_1-x')+(b_1+x')t^2}dt + \frac{2\pi}{x'}\Bigg)dx' \\ = \int_0^c\Bigg(-\frac{b_1}{x'(b_1+x')}\int_{-\infty}^{\infty}\frac{2dt}{\frac{b_1-x'}{b_1+x'}+t^2}dt + \frac{2\pi}{x'}\Bigg)dx' \\ = \int_0^c\Bigg(-\frac{2b_1}{x'\sqrt{b_1^2-x'^2}}\int_{-\infty}^{\infty}\frac{dt}{1+\Bigg(\frac{t}{\sqrt{\frac{b_1-x'}{b_1+x'}}}\Bigg)^2}dt + \frac{2\pi}{x'}\Bigg)dx' \\ =\boxed{2\pi\int_0^c \frac{1}{x'}-\frac{b_1}{x'\sqrt{b_1^2-x'^2}}dx'}$$

where we've used polynomial division to turn $\frac{\cos\theta_0}{c_1\cos\theta_0-b_1} = \frac{1}{x'}-\frac{b_1}{x'(b_1-x'\cos\theta_0)}$ prior to integrating to make the integrand a little easier to work with.

The next step is to then integrate $2\pi\int_0^c \frac{1}{x'}-\frac{b_1}{x'\sqrt{b_1^2-x'^2}} dx'$ which can be done using simple substitution:

$$2\pi\int_0^c \frac{1}{x'^2}\Bigg(1-\frac{b_1}{\sqrt{b_1^2-x'^2}}\Bigg) x'dx' \\ u^2 = b_1^2-x^2, -udu = x'dx \\ = -2\pi\int_{b_1}^\sqrt{b_1^2-c^2} \frac{1}{(b_1^2-u^2)}\Bigg(1-\frac{b_1}{u}\Bigg) udu \\ = 2\pi\int_{b_1}^\sqrt{b_1^2-c^2} \frac{1}{(b_1+u)(b_1-u)}\Bigg(b_1-u\Bigg) udu \\ v = b_1+x', dv = dx' \\ 2\pi\int_{2b_1}^{b_1+\sqrt{b_1^2-c^2}} \frac{dv}{v} \\ = 2\pi\ln\Bigg(\frac{b_1+\sqrt{b_1^2-c^2}}{2b_1}\Bigg)$$

Now subtract off $I(b_1,0) = \int_0^{2\pi} ln(b_1) d\theta_0$

$$\boxed{I(b_1,c_1) = 2\pi\ln\Bigg(\frac{b_1+\sqrt{b_1^2-c_1^2}}{2}\Bigg)} \\ \boxed{I(b_2,c_2) = 2\pi\ln\Bigg(\frac{b_2+\sqrt{b_2^2-c_2^2}}{2}\Bigg)}$$

And combining the natural logs together:

$$\frac{1}{2}\Bigg(\frac{a_1}{a_2}\frac{\frac{b_1+\sqrt{b_1^2-c_1^2}}{2}}{\frac{b_2+\sqrt{b_2^2-c_2^2}}{2}}\Bigg)$$

Just cancel out the 2s and:

$$I(b_1,c_1,b_2,c_2) = \frac{1}{2}\ln\Bigg(\frac{a_1}{a_2}\frac{b_1+\sqrt{b_1^2-c_1^2}}{b_2+\sqrt{b_2^2-c_2^2}}\Bigg)$$


Below is going to be a way to rewrite this result so that it becomes significantly easier for subsequent integration:

Rewriting this is in terms of $r$, $a$, and $r_0$:

$$-\frac{1}{2}\ln\Bigg(\frac{a^2}{r_0^2}\frac{r^2+\frac{a^4}{r_0^2}+\sqrt{\Big(r^2+\frac{a^4}{r_0^2}\Big)^2-4\Big(\frac{r}{r_0}a^2\Big)^2}}{r^2+r_0^2+\sqrt{(r^2+r_0^2)^2-4(rr_0)^2}}\Bigg) \\ = -\frac{1}{2}\ln\Bigg(\frac{a^2}{r_0^2}\frac{r^2+\frac{a^4}{r_0^2}+\sqrt{\Big(r^4+2r^2\frac{a^4}{r_0^2}+a^4(\frac{a}{r_0})^4\Big)-4\Big(\frac{r}{r_0}a^2\Big)^2}}{r^2+r_0^2+\sqrt{(r^4+2r^2r_0^2+r_0^4)-4(rr_0)^2}}\Bigg) \\ = -\frac{1}{2}\ln\Bigg(\frac{a^2}{r_0^2}\frac{r^2+\frac{a^4}{r_0^2}+\sqrt{r^4+a^4(\frac{a}{r_0})^4-2\Big(\frac{r}{r_0}a^2\Big)^2}}{r^2+r_0^2+\sqrt{r^4+r_0^4-2(rr_0)^2}}\Bigg) \\ =-\frac{1}{2}\ln\Bigg(\frac{a^2}{r_0^2}\frac{r^2+\frac{a^4}{r_0^2}+\sqrt{\Big(r^2-a^2(\frac{a}{r_0})^2\Big)^2}}{r^2+r_0^2+\sqrt{\Big(r^2-r_0^2\Big)^2}}\Bigg) \\ =-\frac{1}{2}\ln\Bigg(\frac{a^2}{r_0^2}\frac{r^2+\frac{a^4}{r_0^2}+|(r)^2-\Big(\frac{a^2}{r_0}\Big)^2|}{r^2+r_0^2+|(r)^2-(r_0)^2|}\Bigg)$$

$$\boxed{I(r,r_0) = -\frac{1}{2}\ln\Bigg(\frac{r_0^2}{a^2}\frac{r^2+\frac{a^4}{r_0^2}+|r^2-\Big(\frac{a^2}{r_0}\Big)^2|}{r^2+r_0^2+|r^2-(r_0)^2|}\Bigg)}$$

2

The integral vanishes per $\int_0^\pi \ln\left(1+2b\cos \theta+b^2\right)d\theta=0$

\begin{align} I =\int_0^{2\pi} \ln\frac{1-2\frac{r_0}{r}\cos\theta+ \frac{r^2_0}{r^2}}{1-2\frac{a^2}{r r_0}\cos\theta+ \frac{a^4}{r^2 r^2_0}}d\theta =0 \end{align}

Quanto
  • 120,125
  • I'm so sorry, I messed up and forgot to change the integrand to what I had originally intended for it to be. It was supposed to be $$\frac{\color{red}{r^2+r_0^2}-2rr_0\cos\theta_0}{r^2+\frac{a^4}{r_0^2}-2a^2\frac{r}{r_0}\cos\theta_0}$$. Also, if the result is $p_+^2$, I don't think $\pm$ would be in the final result, would it? Oh and $\frac{r+r_0}{\color{red}{2}}$, the 2 is missing, or did it go somewhere else? I'm sure if I parsed through this it would work just fine for this integrand though. Sorry for screwing that up! – Researcher R Aug 30 '24 at 04:57
  • @ResearcherR - It ‘s much simpler then. – Quanto Aug 30 '24 at 09:24
1

Answer to the question:

No, replacing $\log(x)$ by $x-1$ does not work at all even if you remain in the interval of convergence, because this approximation is gross, you neglect all other terms.

Illustration:

$$\int_1^2\log(x)\,dx=\left.(x\log x-x)\right|_1^2=2\log2-1$$

while

$$\int_1^2(x-1)\,dx=\left.(\tfrac{x^2}2-x)\right|_1^2=-\frac12.$$

1

@ResearcherR I'll provide a straightforward computation by using $1$st kind Chebyshev polynomials. This'll be a complementary explanation of what @Quanto means. Note the property $$\log(1-2xz+z^2)=-2\sum_{n\geq1}\dfrac{\mathrm T_n(x)}{n}z^n,\enspace -1<x<1;\enspace |z|<1$$ In our case $x=\cos\theta_0$ and so $$\begin{aligned} \int_0^{2\pi}\log(1-2z\cos\theta_0+z^2)\,\mathrm d\theta_0&=-2\sum_{n\geq1}\int_0^{2\pi}\dfrac{\mathrm T_n(\cos\theta_0)}{n}z^n\,\mathrm d\theta_0\\ &=-2\sum_{n\geq1}\int_0^{2\pi}\dfrac{\cos(n\theta_0)}{n}z^n\,\mathrm d\theta_0=0 \end{aligned} $$


In light of this, we can now compute your integral easily without recurring to differentiation under the integral sign. This is because your goal integral looks like $$\int_0^{2\pi}\ln\left(\dfrac{a^2+b^2-2ab\cos\theta_0}{c^2+d^2-2cd\cos\theta_0}\right)\,\mathrm d\theta_0$$ which can be separated into $$\int_0^{2\pi}\ln\left(a^2+b^2-2ab\cos\theta_0\right)\,\mathrm d\theta_0-\int_0^{2\pi}\ln\left(c^2+d^2-2cd\cos\theta_0\right)\,\mathrm d\theta_0$$ And by factoring either $a^2$ or $b^2$ in the first integral or $c^2$ or $d^2$ in the second such that $|z_1|<1$ and $|z_2|<1$ in $$\small\int_0^{2\pi}\ln(C_1)\,\mathrm d\theta_0+\int_0^{2\pi}\ln\left(1+z_1^2-2z_1\cos\theta_0\right)\,\mathrm d\theta_0-\int_0^{2\pi}\ln(C_2)\,\mathrm d\theta_0-\int_0^{2\pi}\ln\left(1+z_2^2-2z_2\cos\theta_0\right)\,\mathrm d\theta_0,$$ then it so follows that $$\int_0^{2\pi}\ln\left(\dfrac{a^2+b^2-2ab\cos\theta_0}{c^2+d^2-2cd\cos\theta_0}\right)\,\mathrm d\theta_0=2\pi\ln\left(\dfrac{C_1}{C_2}\right)$$ That being, there are $4$ situations: $\small \mathbf{1)}\ r>r_0\wedge r>\dfrac{a^2}{r_0}$, $\small \mathbf{2)}\ r>r_0\wedge r<\dfrac{a^2}{r_0}$, $\small \mathbf{3)}\ r<r_0\wedge r>\dfrac{a^2}{r_0}$ and $\small \mathbf{4)}\ r<r_0\wedge r<\dfrac{a^2}{r_0}$. We'll treat the cases where they are equal later.

In situation $\mathbf{1)}$ your goal integral is $$\small\int_0^{2\pi}\ln\left(\dfrac{r^2}{r^2}\cdot\dfrac{1+\dfrac{r_0^2}{r^2}-2\dfrac{r_0}{r}\cos\theta_0}{1+\dfrac{a^4}{r^2r_0^2}-2\dfrac{a^2}{rr_0}\cos\theta_0}\right)\,\mathrm d\theta=0$$ In $\mathbf{2)}$ $$\small\int_0^{2\pi}\ln\left(\dfrac{r^2}{\dfrac{a^4}{r_0^2}}\cdot\dfrac{1+\dfrac{r_0^2}{r^2}-2\dfrac{r_0}{r}\cos\theta_0}{1+\dfrac{r^2r_0^2}{a^4}-2\dfrac{rr_0}{a^2}\cos\theta_0}\right)\,\mathrm d\theta=4\pi\ln\left(\dfrac{rr_0}{a^2}\right)$$ In $\mathbf{3)}$ $$\small\int_0^{2\pi}\ln\left(\dfrac{r_0^2}{r^2}\cdot\dfrac{1+\dfrac{r^2}{r_0^2}-2\dfrac{r}{r_0}\cos\theta_0}{1+\dfrac{r^2r_0^2}{a^4}-2\dfrac{rr_0}{a^2}\cos\theta_0}\right)\,\mathrm d\theta=4\pi\ln\left(\dfrac{r_0}{r}\right)$$ And in $\mathbf{4)}$ $$\small\int_0^{2\pi}\ln\left(\dfrac{r_0^2}{\dfrac{a^4}{r_0^2}}\cdot\dfrac{1+\dfrac{r^2}{r_0^2}-2\dfrac{r}{r_0}\cos\theta_0}{1+\dfrac{r^2r_0^2}{a^4}-2\dfrac{rr_0}{a^2}\cos\theta_0}\right)\,\mathrm d\theta=8\pi\ln\left(\dfrac{r_0}{a}\right)$$ As for the equal cases, we cannot apply the same technique as the series expansion is not analytical when $z=1$. Your integral may then reduce to $$\small\int_0^{2\pi}\ln(C_1')\,\mathrm d\theta_0+\int_0^{2\pi}\ln\left(1-\cos\theta_0\right)\,\mathrm d\theta_0-\int_0^{2\pi}\ln(C_2)\,\mathrm d\theta_0,$$ $$\small\int_0^{2\pi}\ln(C_1)\,\mathrm d\theta_0-\int_0^{2\pi}\ln(C_2')\,\mathrm d\theta_0-\int_0^{2\pi}\ln\left(1-\cos\theta_0\right)\,\mathrm d\theta_0,$$ $$\text{or }\small\int_0^{2\pi}\ln(C_1')\,\mathrm d\theta_0-\int_0^{2\pi}\ln(C_2')\,\mathrm d\theta_0.$$ What's clear is that now we need to compute $$\int_0^{2\pi}\ln\left(1-\cos\theta_0\right)\,\mathrm d\theta_0$$ without employing that series expansion. Well, it turns out it isn't too cumbersome since $$\begin{aligned} \small\int_0^{2\pi}\ln\left(1-\cos\theta_0\right)\,\mathrm d\theta_0&\small=\int_0^{2\pi}\ln\left(2\sin^2\left(\frac{\theta_0}{2}\right)\right)\,\mathrm d\theta_0\\ &\small=2\pi\ln(2)+4\int_0^{\pi}\ln(\sin(\theta_0))\,\mathrm d\theta_0\\ &\small=2\pi\ln(2)+4\int_0^{\pi}\left(-\ln(2)-\sum_{k\geq 1}\dfrac{\cos(2k\theta_0)}{k}\right)\,\mathrm d\theta_0\\ &\small=-2\pi\ln(2) \end{aligned}$$ With that done let's enumerate the rest of possibilities: $\small \mathbf{5)}\ r=r_0\wedge r>\dfrac{a^2}{r_0}$, $\small \mathbf{6)}\ r=r_0\wedge r<\dfrac{a^2}{r_0}$, $\small \mathbf{7)}\ r>r_0\wedge r=\dfrac{a^2}{r_0}$ and $\small \mathbf{8)}\ r<r_0\wedge r=\dfrac{a^2}{r_0}$ and $\small \mathbf{9)}\ r=r_0\wedge r=\dfrac{a^2}{r_0}$.

For $\mathbf{5)}$ we've got $$\small\int_0^{2\pi}\ln\left(\dfrac{2r^2}{r^2}\cdot\dfrac{1-\cos\theta_0}{1+\dfrac{a^4}{r^2r_0^2}-2\dfrac{a^2}{rr_0}\cos\theta_0}\right)\,\mathrm d\theta=0$$ For $\mathbf{6)}$ $$\small\int_0^{2\pi}\ln\left(\dfrac{2r_0^2}{\dfrac{a^4}{r_0^2}}\cdot\dfrac{1-\cos\theta_0}{1+\dfrac{r^2r_0^2}{a^4}-2\dfrac{rr_0}{a^2}\cos\theta_0}\right)\,\mathrm d\theta=8\pi\ln\left(\dfrac{r_0}{a}\right)$$ For $\mathbf{7)}$ $$\small\int_0^{2\pi}\ln\left(\dfrac{r^2}{2r^2}\cdot\dfrac{1+\dfrac{r_0^2}{r^2}-2\dfrac{r_0}{r}\cos\theta_0}{1-\cos\theta_0}\right)\,\mathrm d\theta=0$$ For $\mathbf{8)}$ $$\small\int_0^{2\pi}\ln\left(\dfrac{r_0^2}{2\dfrac{a^4}{r_0^2}}\cdot\dfrac{1+\dfrac{r^2}{r_0^2}-2\dfrac{r}{r_0}\cos\theta_0}{1-\cos\theta_0}\right)\,\mathrm d\theta=8\pi\ln\left(\dfrac{r_0}{a}\right)$$ And finally for $\mathbf{9)}$, $$\small\int_0^{2\pi}\ln\left(\dfrac{2r_0^2}{2r_0^2}\cdot\dfrac{1-\cos\theta_0}{1-\cos\theta_0}\right)\,\mathrm d\theta=0$$ To sum up, $$\scriptsize\int_0^{2\pi}\ln\left(\dfrac{r^2+r_0^2-2rr_0\cos\theta_0}{r^2+\dfrac{a^4}{r_0^2}-2a^2\dfrac{r}{r_0}\cos\theta_0}\right)\,\mathrm d\theta_0= \left\{\begin{aligned} & r>r_0: \left[\begin{aligned} & 0,\enspace r>\dfrac{a^2}{r_0}\\ & 0,\enspace r=\dfrac{a^2}{r_0}\\ & 4\pi\ln\left(\dfrac{rr_0}{a^2}\right),\enspace r<\dfrac{a^2}{r_0}\\ \end{aligned}\right. \\ & r=r_0: \left[\begin{aligned} & 0,\enspace r>\dfrac{a^2}{r_0}\\ & 0,\enspace r=\dfrac{a^2}{r_0}\\ & 8\pi\ln\left(\dfrac{r_0}{a}\right),\enspace r<\dfrac{a^2}{r_0}\\ \end{aligned}\right. \\ & r<r_0: \left[\begin{aligned} & 4\pi\ln\left(\dfrac{r_0}{r}\right),\enspace r>\dfrac{a^2}{r_0}\\ & 8\pi\ln\left(\dfrac{r_0}{a}\right),\enspace r=\dfrac{a^2}{r_0}\\ & 8\pi\ln\left(\dfrac{r_0}{a}\right),\enspace r<\dfrac{a^2}{r_0}\\ \end{aligned}\right. \end{aligned}\right\} =4\pi\max\{\ln(r),\ln(r_0)\}-4\pi\max\{\ln(r),\ln\left(\frac{a^2}{r_0}\right)\} $$

Hug de Roda
  • 4,060
  • Thank you for your comprehensive answer! Could you elaborate on where the inequalities are coming from; I don't know exactly how they were worked out? If I factored out $r^2$ from the numerator, my z term is $z=r^2$, then if $|r^2|<1 \rightarrow r<1$, and I'm guessing that the numerator shares this inequality and is less than 1 as well: $$1+\frac{r_0^2}{r^2}-2\frac{r_0}{r}\cos\theta_0 < 1$$ which if true for all $\theta_0$, then picking $\theta_0=0$ $$\frac{r_0^2}{r^2}-2\frac{r_0}{r} < 0\rightarrow r>2r_0 \therefore r >r_0$$ Was this how you did it? – Researcher R Sep 03 '24 at 21:40
  • 1
    I didn't really do this. It's just like when you want to approximate the Green's function in $3$D using Legendre polynomials. So basically you can expand $$\dfrac{1}{|\boldsymbol{r-r_0}|}=\dfrac{1}{\sqrt{r^2+r_0^2-2rr_0\cos(\gamma)}}$$ using $$\dfrac{1}{\sqrt{1-2xt+t^2}}=\sum_{n\geq 0}P_n(x)t^n\enspace \color{red}{|t|<1}.$$ By factoring $r^2$ or $r_0^2$ the Green's function looks like a constant times the Legendre generating function: $$\dfrac{1}{r\sqrt{1+(r_0/r)^2-2(r_0/r)\cos(\gamma)}}\enspace&\enspace \dfrac{1}{r_0\sqrt{1+(r/r_0)^2-2(r/r_0)\cos(\gamma)}}$$ Since you want $|t|<1$, – Hug de Roda Sep 03 '24 at 22:33
  • 1
    then you either have $\left|\dfrac{r_0}{r}\right|<1$ or $\left|\dfrac{r}{r_0}\right|<1$, which translates to $r>r_0$ and $r<r_0$, respectively. You can apply the same reasoning when using the other generating function for $\ln(1-2xz+z^2)$. – Hug de Roda Sep 03 '24 at 22:35
  • Ohhhh okay! Interesting and helpful analogy for future reference as I planned to work through the 3D case next after I've finally parsed through integrating the 2D one. The next step is to integrate with respect to $dr_0$ and now we have our piecewise definitions to integrate over the domain from $r=[0,R]$, so I'll try that next. Thank you! – Researcher R Sep 03 '24 at 23:26
  • or $r_0dr_0$ since it's a polar integral. Anyways, if you were interested to see how well the integrand obtained using the other method (integrating the derivative and back integrating) worked out, I did try integrating that result wrt the radial component here to obtain the solution. I know I made a mistake somewhere, but both should work. – Researcher R Sep 03 '24 at 23:36
  • 1
    That's really nice actually because you'll only have to integrate something like $r_0 f(r_0)\ln(r_0)$ – Hug de Roda Sep 03 '24 at 23:41
  • Sorry to bother you one last time, but do you know how we would set up our second integral wrt $r_0dr_0$ given the pair of piecewise definitions for each term? My first attempt had the setup: $$\int_0^R r_0 \ln \frac{f(r,r_0)}{g(r,r_0}dr_0 = \int_0^r r_0 \ln f(r,r_0)dr_0+\int_r^R r_0\ln f(r,r_0)dr_0 - \int_0^{a^2/r} r_0\ln g(r,r_0)dr_0 - \int_{a^2/r}^R r_0\ln g(r,r_0)dr_0 = \pi[2R^2\ln\frac{a}{r} + r^2 - \frac{a^4}{r^2}]$$ where I attributed the different pieces of the domain to $f$ and $g$. Otherwise, not sure how to handle a piecewise definitions given a pair of domain inequalities. – Researcher R Sep 06 '24 at 04:57
  • The end result is the same as what I got in my linked question, however recall this result does not satisfy the Poisson Equation, so something is still off here. I also did not include the integration of the terms terms at $r=r_0$ and $r=\frac{a^2}{r_0}$ as I was not sure how to handle integration at a point like this. Would it be like integrating the convolution with a delta function like $\delta(r-r_0)$? – Researcher R Sep 06 '24 at 05:00
  • @ResearcherR Let me some time and I'll respond whenever I can. – Hug de Roda Sep 08 '24 at 01:38
  • 1
    Take as much time as you need! And I opened up a question about how to set up this a very similar integral HERE if you wanted to reply or even post an answer there instead. I pose the idea of splitting up the discontinuities, but if that isn't possible, I ask about how to set up the bounds of integration. I'll let you decide where you wanna respond though. Thanks and cheers! – Researcher R Sep 08 '24 at 02:12
  • Hope all is well! I just wanted to know if you were you still working on this. – Researcher R Sep 13 '24 at 20:55
  • @ResearcherR Is it enough if I just find the solution to the Poisson's equation in your other post (assuming that's what you were looking for the whole time)? – Hug de Roda Sep 13 '24 at 23:24
  • Unfortunately, I was looking for how to properly integrate Green's function the whole time. The 2-D case of Poisson's Equation I'm sure could be solved with other methods like say Eigenvalue expansions or taking advantage of the angular symmetry like aruralreader suggests, but I need to use Green's function for a simple 2-D case (in polar coordinates) as practice before moving to the 3-D case of Poisson's Equation (in spherical coordinates) where these other methods don't apply very well in spherical coordinates. – Researcher R Sep 14 '24 at 00:09
  • However, if you can arrive to the correct answer (which I don't know) using Green's function, that would be fine – Researcher R Sep 14 '24 at 00:16