# A generalized Ahmed's integral

Let $\vec{A}:=(A_1,A_2,A_3)$ be a vector where all its components are positive real numbers. In the context of this question An integral involving error functions and a Gaussian we came across a following integral. \begin{equation} I(\vec{A}) := A_1\int\limits_0^{A_3} \frac{ \arctan\left(\frac{A_2}{\sqrt{1+A_1^2 +\xi^2}}\right)}{(1+\xi^2)\sqrt{1+A_1^2+\xi^2}} d\xi \end{equation} By performing the following transformations, firstly by substituting $\xi = \sqrt{1+A_1^2} \tan(\theta)$and then by substituting $t=\tan(\theta/2)$ we brought the quantity being sought for to the following form: \begin{eqnarray} &&I(\vec{A}) = \arctan(\frac{A_1 A_3}{\sqrt{1+A_1^2+A_3^2}}) \arctan(\frac{A_2}{\sqrt{1+A_1^2+A_3^2}})+\\ &&4 A_2\sqrt{1+A_1^2}\int\limits_0^{B} \arctan(\frac{t}{\sqrt{1+A_1^2}-A_1}) \cdot \frac{ t}{A_2^2 (1-t^2)^2 + (1+A_1^2) (1+t^2)^2} dt-\\ &&4 A_2\sqrt{1+A_1^2}\int\limits_0^{B} \arctan(\frac{t}{\sqrt{1+A_1^2}+A_1}) \cdot \frac{ t}{A_2^2 (1-t^2)^2 + (1+A_1^2) (1+t^2)^2} dt \end{eqnarray} where $B:= (-\sqrt{1+A_1^2} + \sqrt{1+A_1^2+A_3^2})/A_3$.

Now the question is how do we complete the calculation? Is the result expressed through elementary functions only and if not what kind of special functions enter the result?

## 1 Answer

Define $\phi:= \arccos(A_2/\sqrt{1+A_1^2+A_2^2})$ and $\alpha := \sqrt{1+A_1^2}-A_1$ and $\beta:=\sqrt{1+A_1^2}+A_1$ and \begin{eqnarray} &&{\mathcal F}^{(a,b)}(t):=\int \arctan(\frac{t}{a}) \frac{1}{t-b} dt = \log(t-b) \arctan(\frac{t}{a})\\ &&-\frac{1}{2 \imath} \left( \log(t-b) \left[ \log(\frac{t-\imath a}{b-\imath a}) - \log(\frac{t+\imath a}{b+\imath a})\right] + Li_2(\frac{b-t}{b-\imath a}) - Li_2(\frac{b-t}{b+\imath a})\right) \end{eqnarray}

By using the following partial fraction decomposition : \begin{eqnarray} \frac{t}{A_2^2(1-t^2)^2 + (1+A_1^2) (1+t^2)^2} = \frac{I}{8 A_2 \sqrt{1+A_1^2}} \left( -\frac{1}{t-e^{\imath\phi}} + \frac{1}{t-e^{-\imath\phi}}+\frac{1}{t+e^{-\imath\phi}}-\frac{1}{t+e^{\imath\phi}}\right) \end{eqnarray} and by integrating each fraction over $t$ using the antiderivative above we arrive at the following result: \begin{eqnarray} &&I(\vec{A})= \arctan\left( \frac{A_1 A_3}{\sqrt{1+A_1^2+A_3^2}}\right) + \arctan\left( \frac{A_2}{\sqrt{1+A_1^2+A_3^2}}\right)+\\ &&\left.\frac{\imath}{2} \left( {\mathcal F}^{\alpha,+\exp(-\imath \phi))}(t) + {\mathcal F}^{\alpha,-\exp(-\imath \phi))}(t) - {\mathcal F}^{\alpha,-\exp(+\imath \phi))}(t) - {\mathcal F}^{\alpha,+\exp(+\imath \phi))}(t) \right)\right|_0^B -\\ &&\left.\frac{\imath}{2} \left( {\mathcal F}^{\beta,+\exp(-\imath \phi))}(t) + {\mathcal F}^{\beta,-\exp(-\imath \phi))}(t) - {\mathcal F}^{\beta,-\exp(+\imath \phi))}(t) - {\mathcal F}^{\beta,+\exp(+\imath \phi))}(t) \right)\right|_0^B \end{eqnarray}