Interesting $\arctan$ integral

376 Views Asked by At

In a generalization of this problem: Integral involving product of arctangent and Gaussian, I am trying to calculate the integral

$$ I(a,b) = \int_{\mathbb{R}^2} \arctan^2 {\left( \frac{y+b}{x+a} \right)} e^{- (x^2 + y^2)} d x d y , $$

for $a,b \in \mathbb{R}$ in terms of commonly used special functions. The substitution that worked in the aforementioned question, i.e.

$$ \frac{1}{(x+a) \sqrt{\pi}} \arctan{ \left( \frac{y+b}{x+a} \right) } = \int_0^{\infty} \mathrm{erf} ((y+b)s) e^{-(x+a)^2 s^2} d s , $$

where $\mathrm{erf}(z) = \frac{2}{\sqrt{\pi}} \int_0^z e^{-t^2} d t$ is the standard error function, forces us to consider the integral

$$ \int_{\mathbb{R}} \mathrm{erf} ((y+b)t) \mathrm{erf} ((y+b)s) e^{- y^2} d y . $$

In the case of $b = 0$, we may use the result

$$ \int_0^{\infty} \mathrm{erf}{(ax)} \mathrm{erf}{(bx)} e^{-c^2 x^2} d x = \frac{1}{c \sqrt{\pi}} \arctan{\left( \frac{ab}{c \sqrt{a^2 + b^2 + c^2}} \right)} $$

found in, e.g., formula (18) of page 158 of https://nvlpubs.nist.gov/nistpubs/jres/75B/jresv75Bn3-4p149_A1b.pdf. Making this substitution, we find

$$ I(a,0) = \pi \int_0^{\pi/2} \int_0^{\infty} r \arctan{ \left( \frac{r \cos{\theta}\sin{\theta}}{\sqrt{1+r^2}} \right) } \exp{ \left\lbrace - \frac{a^2 r^2}{1 + r^2} \right\rbrace} \frac{(1 + 2 a^2 + r^2)}{(1+r^2)^{5/2}} d \theta d r . $$

I would be very happy just to demonstrate a closed-form for $I(a,0)$ above. However, now I am stuck trying to compute

\begin{align} \int_0^{\pi / 2} \arctan{ \left( \frac{r \cos{\theta}\sin{\theta}}{\sqrt{1+r^2}} \right) } d \theta . \hspace{2cm} (*) \end{align}

Would anyone on this platform know how to compute ($*$)? I have tried Mathematica, but it returns some nasty expression. Maybe I am going about this wrong by trying to compute the $\theta$ integral first? Any ideas about ($*$) or the original integral $I(a,b)$ are appreciated. I asked about a related integral here: Integral involving sin, cosine, exponential, and error functions.. The integral in this question is found by starting from polar coordinates with $I(a,b)$. Unfortunately, I have not been able to make progress on this integral either.

Update: Observe that

$$ \frac{d}{dr} \frac{e^{- a^2 r^2 / (1+r^2)}}{\sqrt{1+r^2}} = - r \exp{ \left\lbrace - \frac{a^2 r^2}{1 + r^2} \right\rbrace} \frac{(1 + 2 a^2 + r^2)}{(1+r^2)^{5/2}} . $$

We may therefore integrate-by-parts to find

\begin{align*} I(a,0) & = - \pi \int_0^{\pi/2} \int_0^{\infty} \arctan{ \left( \frac{r \cos{\theta}\sin{\theta}}{\sqrt{1+r^2}} \right) } \frac{d}{dr} \frac{e^{- a^2 r^2 / (1+r^2)}}{\sqrt{1+r^2}} dr d \theta \\ & ​= \pi \int_0^{\pi/2} \int_0^{\infty} \frac{\cos{\theta} \sin{\theta}}{(1+r^2) (1 + r^2 ( 1 + \cos^2{\theta} \sin^2{\theta} )) } e^{- a^2 r^2 / (1+r^2)} dr d \theta . \end{align*}

Hopefully this observation simplifies the problem some. Apparently, Mathematica believes

$$ \int_0^{\pi/2} \frac{\cos{\theta} \sin{\theta}}{1 + r^2 ( 1 + \cos^2{\theta} \sin^2{\theta} ) } d \theta = \frac{2 \mathrm{arctanh}{ \frac{r}{\sqrt{5 r^2 + 4}} }}{r \sqrt{ 5 r^2 + 4 } } , $$

where $\mathrm{arctanh}$ is the inverse hyperbolic tangent. I haven't been able to derive this myself though.

Update 2: I was able to make a little more progress on the special case $I(a,0)$. Starting from the previous identity involving the hyperbolic $\mathrm{arctanh}$, our integral of interest becomes \begin{align*} I(a,0) = 2 \pi \int_0^{\infty} \frac{2 \mathrm{arctanh}{ \frac{r}{\sqrt{5 r^2 + 4}} }}{r (1 + r^2) \sqrt{ 5 r^2 + 4 } } e^{- a^2 r^2 / (1+r^2)} d r . \end{align*} Now, observe that \begin{align*} \frac{d }{d r} \mathrm{arctanh}^2{ \frac{r}{\sqrt{5 r^2 + 4}} } = 2 \frac{\mathrm{arctanh}{ \frac{r}{\sqrt{5 r^2 + 4}} }}{(1+r^2) \sqrt{5 r^2 + 4}} . \end{align*} Then, via integration-by-parts, \begin{align*} I(a,0) & = 2 \pi \int_0^{\infty} \frac{1}{r} e^{- a^2 r^2 / (1+r^2)} \frac{d }{d r} \mathrm{arctanh}^2{ \frac{r}{\sqrt{5 r^2 + 4}} } d r \\ & = 2 \pi \int_0^{\infty} \left( \frac{1}{r^2} + \frac{2a^2}{(1+r^2)^2} \right) e^{- a^2 r^2 / (1+r^2)} \mathrm{arctanh}^2{ \frac{r}{\sqrt{5 r^2 + 4}} } d r . \end{align*} Now we look to making the Euler substitution to simplify the integral. Let $\sqrt{ 5 r^2 + 4 } = \sqrt{5} r + t$. Then, \begin{align*} r = \frac{4 - t^2}{2 \sqrt{5} t} = \frac{\sqrt{5}}{10} \left( \frac{4}{t} - t \right). \end{align*} Consequently, \begin{align*} d r = - \frac{\sqrt{5}}{10} \left( \frac{4}{t^2} + 1 \right) d t . \end{align*} Plugging this into our integral and simplifying reveals \begin{align} I(a,0) = 4 \pi \sqrt{5} \int_{- \infty}^{\infty} (4 + t^2) \left( \frac{1}{(t^2 - 4)^2} + \frac{40 a^2 t^2}{(t^4 + 12 t^2 + 16)^2} \right) e^{- \frac{a^2 (t^2 - 4)^2}{16+12t+t^2}} \mathrm{arctanh}^2{ \left( \frac{t^2 - 4}{ \sqrt{5} (t^2 + 4)} \right) } d t . \end{align}

It is starting to seem as though some "closed-form" in terms of $a$ is possible. Due to the appearance of $\mathrm{arctanh}^2$ in the previous integral, I am inclined to conjecture that $\mathrm{arctanh}$ is part of the final answer. This would be a nice "duality" with this integral and the final answer to the related one in the question linked at the very top.

Does anyone have any suggestions on how I could proceed?

Update 3: I found a mistake in my original version of ($\ast$). Please see the posted answer of mine for an update.

4

There are 4 best solutions below

2
On BEST ANSWER

Using $k=\frac r {2\sqrt{1+r^2}}$ $$I=\int_0^{\pi / 2} \arctan{ \left( \frac{r \cos(\theta)\sin(\theta)}{\sqrt{1+r^2}} \right) }\, d \theta =\int_0^{\pi / 2} \arctan{ \left(k \sin(2\theta)\right) }\, d \theta$$ $$I=\text{Li}_2\left(k-\sqrt{k^2+1}\right)-\text{Li}_2\left(-k+\sqrt{k^2+1}\right)-2 \sinh ^{-1}(k) \coth ^{-1}\left(\sqrt{k^2+1}+k\right)+\frac{\pi ^2}{4}$$ The result does not look so bad.

As a function of $k$ $(0 \leq k \leq \frac 12)$, it is very close to a straight line. Expanded as a series $$I=k-\frac{2 }{9}k^3+\frac{8 }{75}k^5-\frac{16}{245} k^7+\frac{128 }{2835} k^9+O\left(k^{11}\right)$$

4
On

For the problematic integral,let $x=\cos(\theta)$

$$I=\int\frac{\cos(\theta) \sin(\theta)}{1 + r^2 ( 1 + \cos^2(\theta) \sin^2(\theta) ) } d \theta=\int \frac x{r^2 x^4-r^2 x^2-(r^2+1) }\,dx$$ $$r^2 x^4-r^2 x^2-(r^2+1)=r^2\left(x^2-\frac{r^2-r \sqrt{5 r^2+4}}{2 r^2}\right) \left(x^2-\frac{r^2+\sqrt{5r^2+4} r}{2 r^2}\right)$$ Now, $x^2=t$ gives $$I=\frac{1}{2 r^2}\int \frac{dt}{ \left(t-\frac{r^2-r \sqrt{5 r^2+4}}{2 r^2}\right) \left(t-\frac{r^2+\sqrt{5 r^2+4} r}{2 r^2}\right)}$$ Partial fraction decomposition $$I=\frac{\tan ^{-1}\left(\frac{r (2 t-1)}{\sqrt{-5 r^2-4}}\right)}{r \sqrt{-5 r^2-4}}$$

Using the bounds $$J=\int_0^{\frac \pi 2}\frac{\cos(\theta) \sin(\theta)}{1 + r^2 ( 1 + \cos^2(\theta) \sin^2(\theta) ) } d \theta=\frac{1}{2 r \sqrt{5 r^2+4}}\log \left(\frac{\sqrt{5 r^2+4}+r}{\sqrt{5 r^2+4}-r}\right)$$ $$J=\frac{2}{ r \sqrt{5 r^2+4}}\tanh ^{-1}\left(\frac{r}{\sqrt{5 r^2+4}}\right)$$ as given by Wolfram Alpha.

Edit

Concerning $$I(a,0)=4\pi\int_0^\infty \frac{\tanh ^{-1}\left(\frac{r}{\sqrt{5 r^2+4}}\right)}{r \left(r^2+1\right) \sqrt{5 r^2+4}}e^{-a^2\frac{ r^2}{r^2+1}}\,dr$$ it looks very much like a gaussian.

For $a=0$, we have $$I(0,0) \sim \frac{\pi }{10\left(e^{\gamma }-{e^{\frac 12}}\right)}$$ which is in absolute error of $4.89\times 10^{-8}$

1
On

I made a mistake in writing down ($\ast$) in the OP. It should read \begin{equation} \int_0^{\pi/2} \arctan{ \left( \frac{r^2 \cos{\theta} \sin{\theta}}{\sqrt{1+r^2}} \right) } d \theta. \end{equation} However, the calculations in the subsequent updates I made are still valid, but need to be updated. We now have \begin{equation} I_4 (a,0) = \pi \int_0^{\pi/2} \int_0^{\infty} \frac{ r (r^2 + 2) \cos{\theta} \sin{\theta} }{(1 + r^2) (1 + r^2 + r^4 \cos^2{\theta} \sin^2{\theta})} \exp{ \left\lbrace - \frac{a^2 r^2}{1+r^2} \right\rbrace } d r d \theta . \end{equation} The $\theta$ integral is \begin{equation} \int_0^{\pi/2} \frac{\cos{\theta} \sin{\theta}}{ 1 + r^2 + r^4 \cos^2{\theta} \sin^2{\theta} } d \theta = \frac{\ln{(1+r^2)}}{r^2 (2 + r^2)} . \end{equation} Plugging this in and using the substitution $u = r / \sqrt{1+r^2}$, we arrive at \begin{equation} I_4 (a,0) = - \pi \int_0^1 \frac{\ln{(1 - u^2)}}{u} e^{-a^2 u^2} d u . \end{equation} In order to evaluate the previous integral, we first note that \begin{align*} \int_0^u \frac{\ln{(1-w^2)}}{w} d w = - \frac{1}{2} \mathrm{Li}_2 (u^2) , \end{align*} where $\mathrm{Li}_2$ is the Polylogarithm of order $2$, defined by \begin{align*} \mathrm{Li}_2 (z) = \int_0^z \frac{\mathrm{Li}_1 (t)}{t} d t , \end{align*} where $\mathrm{Li}_1 (t) = - \ln{(1-t)}$. Consequently, we may integrate-by-parts to find \begin{align*} I_4 (a,0) & = \frac{\pi}{2} \int_0^1 e^{-a^2 u^2} \frac{d }{d u} \mathrm{Li}_2 (u^2) d u \\ & = \frac{\pi}{2} \left( \frac{\pi^2}{6} e^{-a^2} + 2 a^2 \int_0^1 u \mathrm{Li}_2 (u^2) e^{-a^2 u^2} d u \right) \\ & = \frac{\pi}{2} \left( \frac{\pi^2}{6} e^{-a^2} + a^2 \int_0^1 \mathrm{Li}_2 (u) e^{-a^2 u} d u \right) . \end{align*} The previous expression is getting very close to what I had hoped for. We can already see that for $a = 0$, we find $I_4 (a,0) = \pi^3 / 12$, which can be easily computed from the original form \begin{equation} I_4 (0,0) = \int_{\mathbb{R}^2} \arctan^2{\left( \frac{y}{x} \right)} e^{- (x^2+y^2)} d x dy = \frac{\pi^3}{12} . \end{equation} I now hope to simplify \begin{align*} \int_0^1 \mathrm{Li}_2 (u) e^{-a^2 u} d u \end{align*} in terms of known special functions. I will post a separation question asking about this.

10
On

I'm not sure if this is 100% correct, but here's my attempt. Please, point out any inconsistency.

$$\begin{align}I(a,b)&=\underbrace{\int_{\mathbb{R}^2}\arctan^2\left(\frac{y+b}{x+a}\right)e^{-x^2+y^2}dxdy}_{x+a\rightarrow x\\ y+b\rightarrow y}=\underbrace{\int_{\mathbb{R}^2}\arctan^2\left(\frac{y}{x}\right)e^{-(x-a)^2+(y-b)^2}dxdy}_{x\rightarrow r\cos(\theta)\\y\rightarrow r\sin(\theta)}\\&=e^{-(a^2+b^2)}\int_{0}^{\infty}re^{-r^2}dr\int_0^{2\pi}\arctan^2\left(\tan(\theta)\right)\exp\left(2ar\cos(\theta)+2br\sin(\theta)\right)d\theta\end{align} $$

Let's consider the following function: $$U(\alpha,\beta)=\int_0^{2\pi}\arctan^2\left(\tan(\theta)\right)\exp\left(\alpha\cos(\theta)+\beta\sin(\theta)\right)d\theta$$

$$\frac{\partial^2U}{\partial \alpha^2}+\frac{\partial^2U}{\partial \beta^2}=U=A(\alpha)B(\beta)$$

$$\frac{A''(\alpha)}{A(\alpha)}+\frac{B''(\beta)}{B(\beta)}=1\therefore \frac{A''(\alpha)}{A(\alpha)}=1-\frac{B''(\beta)}{B(\beta)}=\lambda$$

$$\begin{cases}\displaystyle{A''(\alpha)=\lambda A(\alpha)\\B''(\beta)=(1-\lambda)B(\beta)} \end{cases}\therefore\begin{cases}\displaystyle{A(\alpha)=c_1e^{\sqrt{\lambda}\alpha}+c_2e^{-\sqrt{\lambda}\alpha}\\B(\beta)=c_3e^{\sqrt{1-\lambda}\beta}+c_4e^{-\sqrt{1-\lambda}\beta}}\end{cases}$$ $$\begin{cases}\displaystyle U(0,0)=\int_{0}^{2\pi}\arctan^2(\tan(\theta))d\theta=\frac{\pi^3}{6}=(c_1+c_2)(c_3+c_4)\\ \displaystyle\frac{\partial^2U(0,0)}{\partial \alpha^2}=\int_{0}^{2\pi}\arctan^2(\tan(\theta))\cos^2(\theta)d\theta=\frac{\pi^3}{12}-\frac{\pi}{2}=\lambda(c_1+c_2)(c_3+c_4)\\ \displaystyle\frac{\partial U(0,0)}{\partial \alpha}=\int_{0}^{2\pi}\arctan^2(\tan(\theta))\cos(\theta)d\theta=0=\sqrt{\lambda}(c_1-c_2)(c_3+c_4)\\ \displaystyle\frac{\partial U(0,0)}{\partial \beta}=\int_{0}^{2\pi}\arctan^2(\tan(\theta))\sin(\theta)d\theta=0=\sqrt{1-\lambda}(c_1+c_2)(c_3-c_4)\end{cases}$$

Thus $$\begin{cases}\displaystyle c_1=c_2\\ \displaystyle c_3=c_4\\ \displaystyle \lambda=\frac{1}{2}-\frac{3}{\pi^2} \end{cases}\therefore U(\alpha,\beta)=\frac{\pi^3}{6}\cosh\left(\alpha\sqrt{\frac{1}{2}-\frac{3}{\pi^2}}\right)\cosh\left(\beta\sqrt{\frac{1}{2}+\frac{3}{\pi^2}}\right)$$

Applying the result into the original integral $$\begin{align}I(a,b)&=\frac{\pi^3}{6}e^{-(a^2+b^2)}\int_{0}^{\infty}re^{-r^2}\cosh\left(2ar\sqrt{\frac{1}{2}-\frac{3}{\pi^2}}\right)\cosh\left(2br\sqrt{\frac{1}{2}+\frac{3}{\pi^2}}\right)dr\\&=\frac{\pi^3}{12}e^{-(a^2+b^2)}\int_{0}^{\infty}re^{-r^2}\left[\cosh\left(2\phi r\right)+\cosh\left(2\omega r\right)\right]dr\\&=\frac{\pi^3}{12}e^{-(a^2+b^2)}\left[1+\frac{\sqrt{\pi}}{2}\phi e^{\phi^2}\text{erf}(\phi)+\frac{\sqrt{\pi}}{2}\omega e^{\omega^2}\text{erf}(\omega)\right]\end{align}$$

$$\begin{cases}\displaystyle\phi=a\sqrt{\frac{1}{2}-\frac{3}{\pi^2}}+b\sqrt{\frac{1}{2}+\frac{3}{\pi^2}}\\ \displaystyle \omega=a\sqrt{\frac{1}{2}-\frac{3}{\pi^2}}-b\sqrt{\frac{1}{2}+\frac{3}{\pi^2}}\end{cases}$$