3

Is there a sensible analytic solution to the following integral: $$\int_a^b \frac{\arctan(A+Bt)}{C^2 + (t-Z)^2}dt$$ where all constants are real and $C>0$.

This integral is part of the third term in a Neumann expansion applied on a specific Rendering equation. I have solved the first and second terms in 2D and 3D, an interactive implementation can be found here (shadertoy).

Mathematica was used first and it outputs an expression for the integral with sums of complex logs and polylogs (I use assumptions to help the program). The log-sum is multiplied by $i$, so all real parts of the log-sum should cancel out since the integrand is real. As far as I know there is no way to generally extract the imaginary part from $\operatorname{Li}_2(\ldots)$. No practical implementation probably exists based on this expression.

I have also tried to use Feynman's integral trick, but not having much success. Since Mathematica is limited (the following example fails: $\int_0^\pi\ln(1-2a\cos(x)+a^2)\,dx$ from this tutorial, which has a closed form), I hoper there is a simpler solution without the dilogarithm.

Edit: clarified the integral

Blue
  • 75,673
Mathis
  • 31
  • The Rendering equation leads to definite integrals – Quanto Jul 05 '22 at 20:24
  • Yes, I could write my question as $\int_a^b ...$ where $a>0$ and $b>a$, but the values of $a$ and $b$ are not known since they are computed from the geometric visibility function $V(\vec{x}_1,\vec{x}_2)$. – Mathis Jul 05 '22 at 20:45
  • 1
    Is this along the lines of what you’re looking for? https://math.stackexchange.com/questions/4284361/closed-form-evaluation-of-a-trigonometric-integral-in-terms-of-polylogarithms – David H Jul 05 '22 at 21:10
  • Yes, it seems close to my question. But I don't think I can use his answer since my integral is a bit different with 5 variables and not within his constraints (I might be wrong). – Mathis Jul 05 '22 at 21:38

1 Answers1

1

Our goal here is the general evaluation of the following six-parameter class of integrals:

$$\int_{t_{0}}^{t_{1}}\mathrm{d}t\,\frac{s\arctan{\left(p+qt\right)}}{\left(t-r\right)^{2}+s^{2}};~~~\small{(p,q,r,s,t_{0},t_{1})\in\mathbb{R}^{6}\land0<s}.$$

Such an integral can be rewritten and split up as

$$\begin{align} \int_{t_{0}}^{t_{1}}\mathrm{d}t\,\frac{s\arctan{\left(p+qt\right)}}{\left(t-r\right)^{2}+s^{2}} &=\int_{\frac{t_{0}-r}{s}}^{\frac{t_{1}-r}{s}}\mathrm{d}u\,\frac{\arctan{\left(p+qr+qsu\right)}}{1+u^{2}};~~~\small{\left[t=r+su\right]}\\ &=\int_{\arctan{\left(\frac{t_{0}-r}{s}\right)}}^{\arctan{\left(\frac{t_{1}-r}{s}\right)}}\mathrm{d}\tau\,\arctan{\left(p+qr+qs\tan{\left(\tau\right)}\right)};~~~\small{\left[u=\tan{\left(\tau\right)}\right]}\\ &=\int_{0}^{\arctan{\left(\frac{t_{1}-r}{s}\right)}}\mathrm{d}\tau\,\arctan{\left(p+qr+qs\tan{\left(\tau\right)}\right)}\\ &~~~~~-\int_{0}^{\arctan{\left(\frac{t_{0}-r}{s}\right)}}\mathrm{d}\tau\,\arctan{\left(p+qr+qs\tan{\left(\tau\right)}\right)}\\ &=\mathcal{I}{\left(p+qr,qs,\arctan{\left(\frac{t_{1}-r}{s}\right)}\right)}-\mathcal{I}{\left(p+qr,qs,\arctan{\left(\frac{t_{0}-r}{s}\right)}\right)},\\ \end{align}$$

where in the last line we've introduced the function $\mathcal{I}:\mathbb{R}\times\mathbb{R}\times(-\frac{\pi}{2},\frac{\pi}{2})\rightarrow\mathbb{R}$ given by the three-parameter definite integral

$$\mathcal{I}{\left(a,b,\theta\right)}:=\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(a+b\tan{\left(\tau\right)}\right)}.$$

Our focus then shifts naturally to the general evaluation of $\mathcal{I}$, which fortunately has significantly less parameter clutter than what we started with.


Observe that for $(a,b,\theta)\in\mathbb{R}\times\mathbb{R}\times(-\frac{\pi}{2},\frac{\pi}{2})$, we can show that

We can quickly derive a couple of basic functional relations for $\mathcal{I}$ that essentially allow us to choose the signs of up to two of the three parameters: for $(a,b,\theta)\in\mathbb{R}\times\mathbb{R}\times(-\frac{\pi}{2},\frac{\pi}{2})$,

$$\begin{align} \mathcal{I}{\left(-a,-b,\theta\right)} &=\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(-a-b\tan{\left(\tau\right)}\right)}\\ &=-\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(a+b\tan{\left(\tau\right)}\right)}\\ &=-\mathcal{I}{\left(a,b,\theta\right)},\\ \end{align}$$

and

$$\begin{align} \mathcal{I}{\left(-a,b,-\theta\right)} &=\int_{0}^{-\theta}\mathrm{d}\tau\,\arctan{\left(-a+b\tan{\left(\tau\right)}\right)}\\ &=\int_{0}^{\theta}\mathrm{d}\tau\,(-1)\arctan{\left(-a+b\tan{\left(-\tau\right)}\right)};~~~\small{\left[\tau\mapsto-\tau\right]}\\ &=\int_{0}^{\theta}\mathrm{d}\tau\,(-1)\arctan{\left(-a-b\tan{\left(\tau\right)}\right)}\\ &=\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(a+b\tan{\left(\tau\right)}\right)}\\ &=\mathcal{I}{\left(a,b,\theta\right)}.\\ \end{align}$$

Going forward, we will assume without loss of generality that both $b$ and $\theta$ are nonnegative. In fact, we might as well go ahead and say $b$ and $\theta$ are strictly positive since the $\theta=0$ or $b=0$ cases can be excluded as basically trivial:

$$\mathcal{I}{\left(a,b,0\right)}=0,$$

$$\mathcal{I}{\left(a,0,\theta\right)}=\theta\arctan{\left(a\right)}.$$


We consider the $a=0$ case first. Suppose $b\in\mathbb{R}_{>0}\land\theta\in(-\frac{\pi}{2},\frac{\pi}{2})$.

$$\begin{align} \mathcal{I}{\left(0,b,\theta\right)} &=\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(b\tan{\left(\tau\right)}\right)}\\ &=\int_{0}^{\theta}\mathrm{d}\tau\int_{0}^{b}\mathrm{d}x\,\frac{\tan{\left(\tau\right)}}{1+x^{2}\tan^{2}{\left(\tau\right)}}\\ &=\int_{0}^{b}\mathrm{d}x\int_{0}^{\theta}\mathrm{d}\tau\,\frac{\tan{\left(\tau\right)}}{1+x^{2}\tan^{2}{\left(\tau\right)}}\\ &=\int_{0}^{b}\mathrm{d}x\int_{0}^{\theta}\mathrm{d}\tau\,\frac{\cos{\left(\tau\right)}\sin{\left(\tau\right)}}{\cos^{2}{\left(\tau\right)}+x^{2}\sin^{2}{\left(\tau\right)}}\\ &=\int_{0}^{b}\mathrm{d}x\int_{0}^{\theta}\mathrm{d}\tau\,\frac{\cos{\left(\tau\right)}\sin{\left(\tau\right)}}{1-\left(1-x^{2}\right)\sin^{2}{\left(\tau\right)}}\\ &=\int_{0}^{b}\mathrm{d}x\int_{0}^{\sin{\left(\theta\right)}}\mathrm{d}t\,\frac{t}{1-\left(1-x^{2}\right)t^{2}};~~~\small{\left[\sin{\left(\tau\right)}=t\right]}\\ &=\int_{0}^{b}\mathrm{d}x\int_{0}^{\sin^{2}{\left(\theta\right)}}\mathrm{d}u\,\frac{1}{2\left[1-\left(1-x^{2}\right)u\right]};~~~\small{\left[t^{2}=u\right]}\\ &=\int_{0}^{b}\mathrm{d}x\int_{0}^{\sin^{2}{\left(\theta\right)}}\mathrm{d}u\,\frac{d}{du}\left[-\frac{\ln{\left(1-\left(1-x^{2}\right)u\right)}}{2\left(1-x^{2}\right)}\right]\\ &=\int_{0}^{b}\mathrm{d}x\,\left[-\frac{\ln{\left(1-\left(1-x^{2}\right)\sin^{2}{\left(\theta\right)}\right)}}{2\left(1-x^{2}\right)}\right]\\ &=-\frac12\int_{0}^{b}\mathrm{d}x\,\frac{1}{1-x^{2}}\ln{\left(1-\left(1-x^{2}\right)\sin^{2}{\left(\theta\right)}\right)}\\ &=-\frac12\int_{1}^{\frac{1-b}{1+b}}\mathrm{d}y\,\frac{(-2)}{\left(1+y\right)^{2}}\cdot\frac{\left(1+y\right)^{2}}{4y}\ln{\left(1-\frac{4y}{\left(1+y\right)^{2}}\sin^{2}{\left(\theta\right)}\right)};~~~\small{\left[x=\frac{1-y}{1+y}\right]}\\ &=-\frac12\int_{\frac{1-b}{1+b}}^{1}\mathrm{d}y\,\frac{1}{2y}\ln{\left(\frac{\left(1+y\right)^{2}-4y\sin^{2}{\left(\theta\right)}}{\left(1+y\right)^{2}}\right)}\\ &=-\frac12\int_{\frac{1-b}{1+b}}^{1}\mathrm{d}y\,\frac{1}{2y}\ln{\left(\frac{1+2y\left[1-2\sin^{2}{\left(\theta\right)}\right]+y^{2}}{\left(1+y\right)^{2}}\right)}\\ &=-\frac12\int_{\frac{1-b}{1+b}}^{1}\mathrm{d}y\,\frac{1}{2y}\ln{\left(\frac{1+2y\cos{\left(2\theta\right)}+y^{2}}{\left(1+y\right)^{2}}\right)}\\ &=\frac12\int_{\frac{1-b}{1+b}}^{1}\mathrm{d}y\,\frac{1}{2y}\left[2\ln{\left(1+y\right)}-\ln{\left(1+2y\cos{\left(2\theta\right)}+y^{2}\right)}\right]\\ &=\frac12\left[\int_{\frac{1-b}{1+b}}^{1}\mathrm{d}y\,\frac{\ln{\left(1+y\right)}}{y}-\int_{\frac{1-b}{1+b}}^{1}\mathrm{d}y\,\frac{\ln{\left(1+2y\cos{\left(2\theta\right)}+y^{2}\right)}}{2y}\right]\\ &=\frac12\left[-\operatorname{Li}_{2}{\left(-1\right)}+\operatorname{Li}_{2}{\left(-\frac{1-b}{1+b}\right)}+\operatorname{Li}_{2}{\left(1,\pi-2\theta\right)}-\operatorname{Li}_{2}{\left(\frac{1-b}{1+b},\pi-2\theta\right)}\right]\\ &=\frac12\left[\theta^{2}+\operatorname{Li}_{2}{\left(-\frac{1-b}{1+b}\right)}-\operatorname{Li}_{2}{\left(\frac{1-b}{1+b},\pi-2\theta\right)}\right],\\ \end{align}$$

where

$$\operatorname{Li}_{2}{\left(z\right)}:=-\int_{0}^{z}\mathrm{d}x\,\frac{\ln{\left(1-x\right)}}{x};~~~\small{z\in(-\infty,1]},$$

$$\operatorname{Li}_{2}{\left(r,\theta\right)}:=-\frac12\int_{0}^{r}\mathrm{d}y\,\frac{\ln{\left(1-2y\cos{\left(\theta\right)}+y^{2}\right)}}{y};~~~\small{\left(r,\theta\right)\in\mathbb{R}^{2}}.$$

Note: It can be shown (see appendix below for proof) that

$$\operatorname{Li}_{2}{\left(1,\theta\right)}=\operatorname{Li}_{2}{\left(-1\right)}+\left(\frac{\theta}{2}-\frac{\pi}{2}\right)^{2};~~~\small{0\le\theta\le2\pi}.$$


We now consider the $a\neq0$ case.

Suppose $a\in\mathbb{R}_{\neq0}\land b\in\mathbb{R}_{>0}\land\theta\in(0,\frac{\pi}{2})$. The trick here is to find a set of values $(A,B,\varphi)\in\mathbb{R}^{3}$ such that

$$\forall\tau\in[0,\theta]:\arctan{\left(a+b\tan{\left(\tau\right)}\right)}=\arctan{\left(A\right)}+\arctan{\left(B\tan{\left(\tau-\varphi\right)}\right)}.$$

Note: In order for the RHS of $(1)$ to be singularity-free over the integration interval (like the LHS is), we require that

$$\forall\tau\in[0,\theta]:-\frac{\pi}{2}<\tau-\varphi<\frac{\pi}{2}.$$

Also note that we must have $B\neq0$ in order for the RHS of $(1)$ to be non-constant with respect to $\tau$.

Recall the arctangent addition formula

$$\arctan{\left(z\right)}+\arctan{\left(w\right)}=\arctan{\left(\frac{z+w}{1-zw}\right)};~~~\small{(z,w)\in\mathbb{R}^{2}\land zw<1},$$

as well as the angle difference formula for tangent

$$\tan{\left(x-y\right)}=\frac{\tan{\left(x\right)}-\tan{\left(y\right)}}{1+\tan{\left(x\right)}\tan{\left(y\right)}};~~~\small{(x,y)\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right)^{2}}.$$

Assuming $0<1-AB\tan{\left(\tau-\varphi\right)}$, we then have

$$\arctan{\left(A\right)}+\arctan{\left(B\tan{\left(\tau-\varphi\right)}\right)}=\arctan{\left(\frac{A+B\tan{\left(\tau-\varphi\right)}}{1-AB\tan{\left(\tau-\varphi\right)}}\right)}.$$

Then, given $B\in\mathbb{R}_{>0}\land B\neq1\land\tau\in\left[0,\frac{\pi}{2}\right)\land\varphi\in\left(0,\frac{\pi}{2}\right)$, and setting $A:=\frac{\tan{\left(\varphi\right)}}{B}\land\beta:=2\arctan{\left(B\right)}$, we have $0<\beta<\pi\land\beta\neq\frac{\pi}{2}\land B=\tan{\left(\frac{\beta}{2}\right)}$, and

$$1-AB\tan{\left(\tau-\varphi\right)}=\frac{1+\tan^{2}{\left(\varphi\right)}}{1+\tan{\left(\tau\right)}\tan{\left(\varphi\right)}}>0,$$

and then

$$\begin{align} \frac{A+B\tan{\left(\tau-\varphi\right)}}{1-AB\tan{\left(\tau-\varphi\right)}} &=\frac{A+B\left[\frac{\tan{\left(\tau\right)}-\tan{\left(\varphi\right)}}{1+\tan{\left(\tau\right)}\tan{\left(\varphi\right)}}\right]}{1-AB\left[\frac{\tan{\left(\tau\right)}-\tan{\left(\varphi\right)}}{1+\tan{\left(\tau\right)}\tan{\left(\varphi\right)}}\right]}\\ &=\frac{A\left[1+\tan{\left(\tau\right)}\tan{\left(\varphi\right)}\right]+B\left[\tan{\left(\tau\right)}-\tan{\left(\varphi\right)}\right]}{\left[1+\tan{\left(\tau\right)}\tan{\left(\varphi\right)}\right]-AB\left[\tan{\left(\tau\right)}-\tan{\left(\varphi\right)}\right]}\\ &=\frac{\left[A-B\tan{\left(\varphi\right)}\right]+\left[B+A\tan{\left(\varphi\right)}\right]\tan{\left(\tau\right)}}{\left[1+AB\tan{\left(\varphi\right)}\right]-\left[AB-\tan{\left(\varphi\right)}\right]\tan{\left(\tau\right)}}\\ &=\frac{\left[B^{-1}\tan{\left(\varphi\right)}-B\tan{\left(\varphi\right)}\right]+\left[B+B^{-1}\tan^{2}{\left(\varphi\right)}\right]\tan{\left(\tau\right)}}{\left[1+\tan^{2}{\left(\varphi\right)}\right]};~~~\small{AB=\tan{\left(\varphi\right)}}\\ &=\frac{\left(B^{-1}-B\right)\tan{\left(\varphi\right)}+\left[B+B^{-1}\tan^{2}{\left(\varphi\right)}\right]\tan{\left(\tau\right)}}{\sec^{2}{\left(\varphi\right)}}\\ &=\left(B^{-1}-B\right)\tan{\left(\varphi\right)}\cos^{2}{\left(\varphi\right)}+\left[B+B^{-1}\tan^{2}{\left(\varphi\right)}\right]\cos^{2}{\left(\varphi\right)}\tan{\left(\tau\right)}\\ &=\left(\frac{1-B^{2}}{B}\right)\sin{\left(\varphi\right)}\cos{\left(\varphi\right)}+\frac{B^{2}\cos^{2}{\left(\varphi\right)}+\sin^{2}{\left(\varphi\right)}}{B}\tan{\left(\tau\right)}\\ &=\frac{1-B^{2}}{2B}\sin{\left(2\varphi\right)}+\frac{B^{2}\left[1+\cos{\left(2\varphi\right)}\right]+\left[1-\cos{\left(2\varphi\right)}\right]}{2B}\tan{\left(\tau\right)}\\ &=\frac{1-B^{2}}{2B}\sin{\left(2\varphi\right)}+\left[\frac{1+B^{2}}{2B}-\frac{1-B^{2}}{2B}\cos{\left(2\varphi\right)}\right]\tan{\left(\tau\right)}\\ &=\cot{\left(\beta\right)}\sin{\left(2\varphi\right)}+\left[\csc{\left(\beta\right)}-\cot{\left(\beta\right)}\cos{\left(2\varphi\right)}\right]\tan{\left(\tau\right)}\\ &=a+b\tan{\left(\tau\right)},\\ \end{align}$$

provided $\beta,\varphi$ satisfy the system of equations

$$\begin{cases} &a=\cot{\left(\beta\right)}\sin{\left(2\varphi\right)},\\ &b=\csc{\left(\beta\right)}-\cot{\left(\beta\right)}\cos{\left(2\varphi\right)}.\\ \end{cases}$$

We find

$$\begin{cases} &a=\cot{\left(\beta\right)}\sin{\left(2\varphi\right)},\\ &b=\csc{\left(\beta\right)}-\cot{\left(\beta\right)}\cos{\left(2\varphi\right)},\\ \end{cases}$$

$$\implies\begin{cases} &\sin{\left(\beta\right)}=\frac{2b}{1+a^{2}+b^{2}},\\ &\cot{\left(2\varphi\right)}=\frac{1+a^{2}-b^{2}}{2ab},\\ \end{cases}$$

$$\implies\begin{cases} &\frac{2B}{1+B^{2}}=\frac{2b}{1+a^{2}+b^{2}},\\ &\tan{\left(\frac{\pi}{2}-2\varphi\right)}=\frac{1+a^{2}-b^{2}}{2ab},\\ \end{cases}$$

$$\implies\begin{cases} &B=\frac{1+a^{2}+b^{2}-\operatorname{sgn}{\left(a\right)}\sqrt{\left[a^{2}+\left(b-1\right)^{2}\right]\left[a^{2}+\left(b+1\right)^{2}\right]}}{2b},\\ &\varphi=\frac{\pi}{4}-\frac12\arctan{\left(\frac{1+a^{2}-b^{2}}{2ab}\right)},\\ &\varphi=\arctan{\left(\frac{-1-a^{2}+b^{2}+\operatorname{sgn}{\left(a\right)}\sqrt{\left[a^{2}+\left(b-1\right)^{2}\right]\left[a^{2}+\left(b+1\right)^{2}\right]}}{2ab}\right)}.\\ \end{cases}$$

Hence, for $a\in\mathbb{R}_{\neq0}\land b\in\mathbb{R}_{>0}\land\theta\in(0,\frac{\pi}{2})$ with

$$B:=\frac{1+a^{2}+b^{2}-\operatorname{sgn}{\left(a\right)}\sqrt{\left[a^{2}+\left(b-1\right)^{2}\right]\left[a^{2}+\left(b+1\right)^{2}\right]}}{2b},$$

$$\varphi:=\frac{\pi}{4}-\frac12\arctan{\left(\frac{1+a^{2}-b^{2}}{2ab}\right)},$$

we obtain

$$\begin{align} \mathcal{I}{\left(a,b,\theta\right)} &=\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(a+b\tan{\left(\tau\right)}\right)}\\ &=\int_{0}^{\theta}\mathrm{d}\tau\,\left[\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}+\arctan{\left(B\tan{\left(\tau-\varphi\right)}\right)}\right]\\ &=\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}+\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(B\tan{\left(\tau-\varphi\right)}\right)}\\ &=\theta\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}+\int_{0}^{\theta}\mathrm{d}\tau\,\arctan{\left(B\tan{\left(\tau-\varphi\right)}\right)}\\ &=\theta\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}+\int_{-\varphi}^{\theta-\varphi}\mathrm{d}\tau\,\arctan{\left(B\tan{\left(\tau\right)}\right)};~~~\small{\left[\tau\mapsto\tau+\varphi\right]}\\ &=\theta\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}+\int_{0}^{\theta-\varphi}\mathrm{d}\tau\,\arctan{\left(B\tan{\left(\tau\right)}\right)}\\ &~~~~~-\int_{0}^{-\varphi}\mathrm{d}\tau\,\arctan{\left(B\tan{\left(\tau\right)}\right)}\\ &=\theta\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}\\ &~~~~~+\frac12\left(\theta-\varphi\right)^{2}+\frac12\operatorname{Li}_{2}{\left(-\frac{1-B}{1+B}\right)}-\frac12\operatorname{Li}_{2}{\left(\frac{1-B}{1+B},\pi-2\theta+2\varphi\right)}\\ &~~~~~-\frac12\varphi^{2}-\frac12\operatorname{Li}_{2}{\left(-\frac{1-B}{1+B}\right)}+\frac12\operatorname{Li}_{2}{\left(\frac{1-B}{1+B},\pi+2\varphi\right)}\\ &=\frac12\left(\theta-\varphi\right)^{2}-\frac12\varphi^{2}+\theta\arctan{\left(\frac{\tan{\left(\varphi\right)}}{B}\right)}\\ &~~~~~+\frac12\operatorname{Li}_{2}{\left(\frac{1-B}{1+B},\pi+2\varphi\right)}-\frac12\operatorname{Li}_{2}{\left(\frac{1-B}{1+B},\pi-2\theta+2\varphi\right)}.\\ \end{align}$$


Appendix. For $0<\theta<2\pi$,

$$\begin{align} \operatorname{Li}_{2}{\left(1,\theta\right)} &=\operatorname{Li}_{2}{\left(1,\pi\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\,\frac{d}{d\varphi}\operatorname{Li}_{2}{\left(1,\varphi\right)}\\ &=-\frac12\int_{0}^{1}\mathrm{d}y\,\frac{\ln{\left(1-2y\cos{\left(\pi\right)}+y^{2}\right)}}{y}\\ &~~~~~+\int_{\pi}^{\theta}\mathrm{d}\varphi\,\frac{d}{d\varphi}\left[-\frac12\int_{0}^{1}\mathrm{d}y\,\frac{\ln{\left(1-2y\cos{\left(\varphi\right)}+y^{2}\right)}}{y}\right]\\ &=-\int_{0}^{1}\mathrm{d}y\,\frac{\ln{\left(1+2y+y^{2}\right)}}{2y}\\ &~~~~~+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}y\,\frac{\partial}{\partial\varphi}\left[-\frac{\ln{\left(1-2y\cos{\left(\varphi\right)}+y^{2}\right)}}{2y}\right]\\ &=-\int_{0}^{1}\mathrm{d}y\,\frac{\ln{\left((1+y)^{2}\right)}}{2y}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}y\,\left[-\frac{\sin{\left(\varphi\right)}}{1-2y\cos{\left(\varphi\right)}+y^{2}}\right]\\ &=-\int_{0}^{1}\mathrm{d}y\,\frac{\ln{\left(1+y\right)}}{y}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}y\,\frac{\left[-\sin{\left(\varphi\right)}\right]}{1-2y\cos{\left(\varphi\right)}+y^{2}}\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}y\,\frac{\left[-\sin{\left(\varphi\right)}\right]}{1-2y\cos{\left(\varphi\right)}+y^{2}}\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{1}^{0}\mathrm{d}t\,\frac{(-2)}{\left(1+t\right)^{2}}\cdot\frac{\left[-\sin{\left(\varphi\right)}\right]}{1-2\left(\frac{1-t}{1+t}\right)\cos{\left(\varphi\right)}+\left(\frac{1-t}{1+t}\right)^{2}};~~~\small{\left[y=\frac{1-t}{1+t}\right]}\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}t\,\frac{2\left[-\sin{\left(\varphi\right)}\right]}{\left(1+t\right)^{2}-2\left(1-t^{2}\right)\cos{\left(\varphi\right)}+\left(1-t\right)^{2}}\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}t\,\frac{\left[-\sin{\left(\varphi\right)}\right]}{\left(1+t^{2}\right)-\left(1-t^{2}\right)\cos{\left(\varphi\right)}}\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}t\,\frac{\left[-\sin{\left(\varphi\right)}\right]}{\left[1-\cos{\left(\varphi\right)}\right]+t^{2}\left[1+\cos{\left(\varphi\right)}\right]}\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}t\,\frac{\left[-2\sin{\left(\frac{\varphi}{2}\right)}\cos{\left(\frac{\varphi}{2}\right)}\right]}{2\sin^{2}{\left(\frac{\varphi}{2}\right)}+2t^{2}\cos^{2}{\left(\frac{\varphi}{2}\right)}}\\ &=\operatorname{Li}_{2}{\left(-1\right)}-\int_{\pi}^{\theta}\mathrm{d}\varphi\int_{0}^{1}\mathrm{d}t\,\frac{\cot{\left(\frac{\varphi}{2}\right)}}{1+t^{2}\cot^{2}{\left(\frac{\varphi}{2}\right)}}\\ &=\operatorname{Li}_{2}{\left(-1\right)}-\int_{\pi}^{\theta}\mathrm{d}\varphi\,\arctan{\left(\cot{\left(\frac{\varphi}{2}\right)}\right)}\\ &=\operatorname{Li}_{2}{\left(-1\right)}-\int_{\pi}^{\theta}\mathrm{d}\varphi\,\arctan{\left(\tan{\left(\frac{\pi}{2}-\frac{\varphi}{2}\right)}\right)}\\ &=\operatorname{Li}_{2}{\left(-1\right)}-\int_{\pi}^{\theta}\mathrm{d}\varphi\,\left(\frac{\pi}{2}-\frac{\varphi}{2}\right)\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\int_{\pi}^{\theta}\mathrm{d}\varphi\,\left(\frac{\varphi}{2}-\frac{\pi}{2}\right)\\ &=\operatorname{Li}_{2}{\left(-1\right)}+\left(\frac{\theta}{2}-\frac{\pi}{2}\right)^{2}.\\ \end{align}$$


David H
  • 29,921