262

Evaluate the following integral $$ \tag1\int_{0}^{\frac{\pi}{2}}\frac1{(1+x^2)(1+\tan x)}\,\mathrm dx $$


My Attempt:

Letting $x=\frac{\pi}{2}-x$ and using the property that

$$ \int_{0}^{a}f(x)\,\mathrm dx = \int_{0}^{a}f(a-x)\,\mathrm dx $$

we obtain

$$ \tag2\int_{0}^{\frac{\pi}{2}}\frac{\tan x}{\left(1+\left(\frac{\pi}{2}-x\right)^2\right)(1+\tan x)}\,\mathrm dx $$

Now, add equation $(1)$ and $(2)$. After that I do not understand how I can proceed further.

Maximilian Janisch
  • 12,071
  • 2
  • 15
  • 41
juantheron
  • 50,082
  • 13
  • 80
  • 221
  • 19
    I don't think there is a closed solution. The numerical value is $\approx 0.597382$. – Hans Engler Apr 17 '13 at 15:47
  • 27
    Where did you get this from? – Aryabhata Apr 17 '13 at 15:53
  • 1
    I did not rembember but i have seen somewere in internet – juantheron Apr 18 '13 at 02:44
  • 3
    Not sure about a closed form, but maybe this will help, $$\int \frac{1}{\left( 1 + x^2 \right) \left( 1 + \tan{x} \right)} = \arctan{x} - \int \frac{\sin{x}}{\left( x^2 + 1 \right) \left( \cos{x} + \sin{x} \right)}$$ – Gamma Function Jul 15 '13 at 01:36
  • 1
    Also, I can add a few more digits onto the numerical value $\approx 0.597381809452$ – Gamma Function Jul 15 '13 at 01:38
  • 1
    @JacobMayle: I don't think your integration by parts is correct. – Ron Gordon Jul 15 '13 at 02:13
  • @RonGordon Really? I'm pretty sure that its correct. Though, I doubt its utility. – Gamma Function Jul 15 '13 at 03:46
  • 7
    @JacobMayle: I thought it would be $$\frac{\arctan{x}}{1+\tan{x}} + \int dx \frac{\arctan{x} \sec^2{x}}{(1+\tan{x})^2}$$ – Ron Gordon Jul 15 '13 at 03:56
  • Wolfram Alpha just gives a "numerical result": $\color{#ff0000}{\large\ 0.597382\ }$. I suspect there is not any analytical result!!!. http://www.wolframalpha.com/input/?i=%5Cint_%7B0%7D%5E%7B%5Cpi%2F2%7D%5Cfrac%7B1%7D%7B%281%2Bx%5E2%29%281%2B%5Ctan+x%29%7D+dx – Felix Marin Sep 09 '13 at 21:44
  • 12
    I twiddled and got $\int_0^{\arctan(\pi/2)} {d\theta\over 1 + \tan(\tan(\theta))}$. This has a certain intransigent ugliness to it. – ncmathsadist Oct 18 '13 at 15:46
  • 1
    This integral don't have any closed form. Integrals like \tan(tan(x)) are not soluble. – Arucard Oct 20 '13 at 23:44
  • 34
    I don't have a closed form but I'm able to represent the integral as a series: $$\frac{\arctan(\frac{\pi}{2}) - t\log\sqrt{1+\frac{\pi^2}{4}}}{1+t^2} + \frac{\pi^2}{4} \sum_{n=0}^{\infty}\frac{ (2n+1)\left(\log(n+\frac{3}{4})-\log(n+\frac{1}{4})\right) }{ \left(1+\pi^2(n+\frac{1}{4})^2\right)\left(1+\pi^2(n+\frac{3}{4})^2\right) }$$ where $t = \tanh(1)$. I hope someone can simplify this further. BTW, summing the first $10^4$ term gives me 0.59738180945178, a number consistent with what Jacob got. – achille hui Oct 21 '13 at 05:07
  • 3
    By approximating the sum for $n > 5000$ using its Taylor expansion at $\infty$ up to terms of order $\frac{1}{n^7}$, the updated numerical value is $0.597381809451803484613113XX$ where the last two digits satisfy $23 \le XX \le 86$. – achille hui Oct 22 '13 at 19:11
  • Does a u-substitution u = (1 + tan(x)) not work? – zerosofthezeta Oct 23 '13 at 07:31
  • 3
    Ron's answer above can be further simplified to $$\int_0^{\pi\over2}\frac{\arctan x}{1+\sin(2x)}dx$$ – Lucian Oct 25 '13 at 14:36
  • 1
    This integral is improper since $tan(pi/2)$ undefined. So, you must change the integral to: $\int_{0}^{R}\frac{1}{(1+x^2)(1+\tan x)}\,\mathrm dx : R \rightarrow (\pi/2)^- $ – AHH Oct 30 '13 at 17:37
  • Is $\int_{0}^{a}f(x)\,\mathrm dx = \int_{0}^{a}f(a-x)\,\mathrm dx$ given? @juantheron – AHH Oct 30 '13 at 19:05
  • 1
    @Lucian: by exploiting the symmetry around $x=\pi/4$ of the denominator, the integral can be represented also like: $$\frac{1}{2}\int_{0}^{\pi/4}\frac{\arctan\left(\frac{\pi/2}{(1-\pi^2/16)+x^2}\right)}{\cos^2 x}dx=$$ $$=\frac{1}{2}\int_{0}^{1}\arctan\left(\frac{\pi/2}{(1-\pi^2/16)+\arctan^2 x}\right)dx.$$ – Jack D'Aurizio Nov 20 '13 at 03:05
  • @JackD'Aurizio: What (approach) do you have in mind ? – Lucian Nov 20 '13 at 11:16
  • @Lucian: I would like to manipulate the integral in order to write it as a series of integrals of the form $\int_{0}^{1}\arctan\left(\frac{\log(1-v)}{2\pi z}\right)\frac{dv}{v}$, for which the Binet second log-Gamma formula works well. – Jack D'Aurizio Nov 20 '13 at 16:09
  • 2
    @JackD'Aurizio: [What's stopping you](http://www.visiblemeasures.com/wp-content/uploads/2013/09/nike-just-do-it.jpg) ? :-) – Lucian Nov 20 '13 at 16:29
  • 1
    Here's a suggestion that might be of some help: Let $I$ be the required integral. Then I can prove that $2I = \int_0^{\pi/2} \frac{1}{1+x^2} \frac{2}{1-\tan^2 x} \,dx$. The identities $\tan(\pi/4 \pm x) = \frac{1 \pm \tan x}{1 \mp\tan x}$ might be of some help? – Raghav Nov 21 '13 at 04:26
  • This question sure has generated a lot of junk responses. It must look a lot easier than it is. – Bennett Gardiner Nov 30 '13 at 06:28
  • 4
    The mathematical value of this question is nil, so how come it has not been deleted? – Alexander Grothendieck Dec 07 '13 at 18:24
  • 5
    Just wondering... What if the original question had a tiny $^{-1}$ after the $\tan$? – user21820 Dec 08 '13 at 02:35
  • 1
    In that case, the upper limit should've been $\infty$, not $\frac\pi2$. – Lucian Dec 08 '13 at 18:47
  • @achille hui: Please post your answer with the procedure. We are waiting for your great answer! – Harry Peter Dec 16 '13 at 14:15
  • Have you ever thought of cross-posting this on *Math Overflow* ? – Lucian Mar 15 '14 at 17:31
  • achille hui how did you represent the integral as series? – esege Apr 25 '14 at 21:28
  • 2
    What a train wreck. Who could've known, after so many good questions with impossible looking integrals that have been evaluated regardless that we could have such a bad one! – Bennett Gardiner May 06 '14 at 05:04
  • Although I'm not sure of this, I remember hearing somewhere that integrals containing tan(tan(x)) could not be evaluated. That makes me think that this integral too doesn't have any closed form solution. The ugliness of the series form too makes me think this won't work. – A. Thomas Yerger May 22 '14 at 02:09
  • I think this is a typo; tan should perhaps be arctan in the question. Then things makes sense. – Per Alexandersson Jun 01 '14 at 09:13
  • I tried on **Mathematica 9**. I got a closed form result to this impossible integral, which every one of us trying. (2 $\sqrt{3} \pi + \log{64})/18$ – L.K. Jun 13 '14 at 12:35
  • @lavkush No, that can't be right, it doesn't agree with the numerical value of the integral. – user7530 Jun 14 '14 at 08:20
  • Not sure it is helpful or not. Since $atan(x)$'s derivative is $\frac{1}{1+x^2}$, have you consider integral by parts? – Yan Zhu Jun 16 '14 at 09:12
  • 3
    This question is highly amusing because of its illustration of the difficulty of finding analytic solutions to definite integrals as an open problem more than the question itself. We have the Risch algorithm to find if an expression has a closed form solution in elementary functions that mostly works (except for the constant problem) but all we have for searching for analytic solutions to definite integrals with no closed form antiderivative is heuristics rather than an actual algorithm. Axiom is the only CAS I know of that has fully implemented Risch. – dezakin Jun 16 '14 at 18:23
  • 2
    I think we need to go with contour integration.. – David Jun 24 '14 at 11:28
  • 2
    What is the source of this problem? – Beni Bogosel Jul 08 '14 at 11:20
  • 2
    We may write \begin{align} \int_0^{\pi /2} {\frac{{dx}}{{\left( {1 + x^2 } \right)\left( {1 + \tan x} \right)}}} &= \int_0^{\pi /2} {\frac{{\cos x}}{{\left( {1 + x^2 } \right)\left( {\cos x + \sin x} \right)}} \cdot \frac{{\cos x - \sin x}}{{\cos x - \sin x}}dx} \\ &= \int_0^{\pi /2} {\frac{{\cos ^2 x - \sin x\cos x}}{{\left( {1 + x^2 } \right)\cos 2x}}dx} \\ &= \frac{1}{2}\int_0^{\pi /2} {\frac{{\sec 2x}}{{1 + x^2 }}dx} + \frac{1}{2}\int_0^{\pi /2} {\frac{1}{{1 + x^2 }}dx} - \frac{1}{2}\int_0^{\pi /2} {\frac{{\tan 2x}}{{1 + x^2 }}dx} \end{align} – Mohammad W. Alomari Jul 09 '14 at 12:00
  • 1
    Can anyone find closed forms for @mwomath's 1st and 3rd integrals? – Ryan Jul 18 '14 at 15:44
  • 1
    I think we can use series. $$1/(1+x^2)=\sum (-1)^k x^{2k},$$ $$\tan x =\sum_{k=1}^{\infty}{(-1)^{k-1}\frac{2^{2k}(2^{2k}-1) B_{2k}}{(2k)!} x^{2k- 1}} $$ where $ B_{2k} $ are thé Bernoulli numbers, and I don't know a closed expansion of $\sec x $ if anybody help?! – Mohammad W. Alomari Jul 22 '14 at 04:58
  • @mwomath Very similar to the $\tan$ series, with Euler numbers instead: $\sec x = \sum_{k=0}^{\infty}\frac{|E_{2k}|}{(2k)!}x^{2k}$. Good luck! – David H Sep 08 '14 at 07:12
  • 2
    What is the source of this problem? – ritvik1512 Apr 02 '15 at 05:36

5 Answers5

230

Here is an approach.

We give some preliminary results.


The poly-Hurwitz zeta function


The poly-Hurwitz zeta function may initially be defined by the series $$ \begin{align} \displaystyle \zeta(s\mid a,b) := \sum_{n=1}^{+\infty} \frac{1}{(n+a)^{s}(n+b)}, \quad \Re a >-1, \, \Re b >-1, \, \Re s>0. \tag1 \end{align} $$ This special function is a natural extension of the Hurwitz zeta function initially defined as $$ \zeta(s,a)=\sum_{n=0}^{\infty} \frac{1}{(n+a)^s}, \quad \Re a>0, \Re s>1, \tag2 $$ which is a natural extension itself of the Riemann zeta function initially defined as $$ \zeta(s)=\sum_{n=1}^{\infty} \frac{1}{n^s}, \quad \Re s>1. \tag3 $$

The poly-Hurwitz function appears in different places with different notations, one may find it here: [Masri, p. 2 and p. 15 (2004)], [Murty, p. 17 (2006)], [Sinha, p. 45 (2002)]. In this answer we are dealing with a simplified version of a general poly-Hurwitz function.

The series in $(1)$ converges absolutely for $\displaystyle \Re s>0$. Moreover, the convergence of the series is uniform on every half-plane $$\displaystyle H_{\delta}=\left\{s \in \mathbb{C}, \Re s \geq \delta \right\}, \, \delta \in \mathbb{R},\, \delta>0,$$ therefore the poly-Hurwitz zeta function $\displaystyle \zeta(\cdot \mid a,b)$ is analytic on the half-plane $\displaystyle \Re s>0$.

Let $a$, $b$ and $s$ be complex numbers such that $\Re a >-1, \, \Re b >-1, \, \Re s >0$. One may observe that $$ \begin{align} \zeta(s\mid a,b) & = \sum_{n=1}^{+\infty} \frac{1}{(n+a)^{s}(n+b)}\\ & = \sum_{n=1}^{+\infty} \frac{(n+b)+(a-b)}{(n+a)^{s+1}(n+b)}\\ & = \sum_{n=1}^{+\infty} \frac{1}{(n+a)^{s+1}}+(a-b)\sum_{n=1}^{+\infty} \frac{1}{(n+a)^{s+1}(n+b)} \tag4 \end{align} $$ giving the functional identity $$ \begin{align} \zeta(s \mid a,b) = \zeta(s+1,a+1) +(a-b) \zeta(s+1 \mid a,b) \tag5 \end{align} $$

where $\displaystyle \zeta(\cdot,\cdot)$ is the standard Hurwitz zeta function.

From $(5)$, we obtain by induction, for $n=1,2,3,\ldots $,

$$ \begin{align} \zeta(s\mid a,b) = \sum_{k=1}^{n}(a-b)^{k-1}\zeta(s+k,a+1) +(a-b)^n\zeta(s+n \mid a,b). \tag6 \end{align} $$

We use $(6)$ to extend $\displaystyle \zeta(\cdot \mid a,b)$ to a meromorphic function on each open set $\Re s>-n $, $n\geq 1$. Since the Hurwitz zeta function is analytic on the whole complex plane except for a simple pole at $1$ with residue $1$, then from $(6)$ the poly-Hurwitz zeta function $\displaystyle \zeta(\cdot\mid a,b)$ is analytic on the whole complex plane except for a simple pole at $0$ with residue $1$.


The poly-Stieltjes constants


In 1885 Stieltjes has found that the Laurent series expansion around $1$ of the Riemann zeta function $$ \zeta(1+s) = \frac{1}{s} + \sum_{k=0}^{\infty} \frac{(-1)^{k}}{k!}\gamma_k s^k, \quad s \neq 0,\tag7 $$ is such that the coefficients of the regular part of the expansion are given by $$ \begin{align} \gamma_k& = \lim_{N\to \infty}\left(\sum_{n=1}^N \frac{\log^k n}{n}-\frac{\log^{k+1} \!N}{k+1}\right). \end{align} \tag8 $$ Euler was the first to define a constant of this form (1734) $$ \begin{align} \gamma & = \lim_{N\to\infty}\left(1+\frac12+\frac13+\cdots+\frac1N-\log N\right)=0.577215\ldots. \end{align} $$ The constants $\displaystyle \gamma_k$ are called the Stieltjes constants and due to the fact that $\displaystyle \gamma_0=\gamma$ they are sometimes called the generalized Euler's constants.

Similarly, Wilton (1927) and Berndt (1972) established that the Laurent series expansion in the neighbourhood of $1$ of the Hurwitz zeta function $$ \begin{align} \zeta(1+s,a) = \frac1s+\sum_{k=0}^{\infty}\frac{(-1)^{k}}{k!} \gamma_{k}(a)\:s^{k}, \quad \Re a>0, \,s\neq 0, \tag{9} \end{align} $$ is such that the coefficients of the regular part of the expansion are given by $$ \begin{align} \gamma_k(a)& = \lim_{N\to \infty}\left(\sum_{n=0}^N \frac{\log^k (n+a)}{n+a}-\frac{\log^{k+1} (N+a)}{k+1}\right), \quad \Re a>0, \end{align} \tag{10} $$ with $\displaystyle \gamma_{0}(a)=-\psi(a)=-\Gamma'(a)/\Gamma(a)$. The coefficients $\gamma_k(a)$ are called the generalized Stieltjes constants.

We have seen from $(6)$ that the poly-Hurwitz zeta function admits a Laurent series expansion around $0$. Let's denote by $\displaystyle\gamma_k(a,b)$ the coefficients of the regular part of $\displaystyle \zeta(\cdot\mid a,b)$ around $0$. I will call these coefficients the poly-Stieltjes constants.

Do we have an analog of $(10)$ for $\displaystyle\gamma_k(a,b)$?

The following result is new.

Theorem 1. Let $a,b$ be complex numbers such that $\Re a >-1, \, \Re b >-1$. Consider The poly-Hurwitz zeta function $$ \begin{align} \zeta(s\mid a,b) := \sum_{n=1}^{+\infty} \frac{1}{(n+a)^{s}(n+b)}, \quad \Re s>0. \tag{11} \end{align} $$ Then the meromorphic extension of $\displaystyle \zeta(\cdot\mid a,b)$ admits the following Laurent series expansion around $0$, $$ \zeta(s \mid a,b) = \frac{1}{s} + \sum_{k=0}^{+\infty} \frac{(-1)^{k}}{k!}\gamma_k(a,b) s^k, \quad s \neq 0,\tag{12} $$ where the poly-Stieltjes constants $\displaystyle \gamma_k(a,b)$ are given by $$ \begin{align} \gamma_k(a,b)& = \lim_{N\to+\infty}\left(\sum_{n=1}^N \frac{\log^k (n+a)}{n+b}-\frac{\log^{k+1} \!N}{k+1}\right) \end{align} \tag{13} $$ with $$ \gamma_{0}(a,b)=-\psi(b+1)=-\Gamma'(b+1)/\Gamma(b+1). \tag{14}$$

Proof. Let $a,b$ be complex numbers such that $\Re a >-1, \, \Re b >-1$.

We first assume $\Re s>0$. Observing that, for each $n \geq 1$, $$ \left|\sum_{k=0}^{\infty}\frac{\log^k(n+a)}{n+b}\frac{(-1)^{k}}{k!}s^k\right| \leq \sum_{k=0}^{\infty}\left|\frac{\log^k(n+a)}{n+b}\right|\frac{|s|^k }{k!}<\infty $$ and that $$ \sum_{n=1}^{\infty}\left|\sum_{k=0}^{\infty}\frac{\log^k(n+a)}{n+b}\frac{(-1)^{k}}{k!}s^k\right|=\sum_{n=1}^{\infty}\left|\frac1{(n+a)^s(n+b)}\right| = \sum_{n=1}^{\infty}\frac1{|n+a|^{\Re s}|n+b|}<\infty,$$ we obtain $$ \begin{align} &\sum_{k=0}^{\infty}\frac{(-1)^{k}}{k!}\lim_{N\to+\infty}\left(\sum_{n=1}^N\frac{\log^k(n+a)}{n+b}-\frac{\log^{k+1} \!N}{k+1}\right) s^k \\\\ &= \lim_{N\to+\infty}\sum_{k=0}^{\infty} \frac{(-1)^{k}}{k!}\left(\sum_{n=1}^N\frac{\log^k(n+a)}{n+b}-\frac{\log^{k+1} \!N}{k+1}\right) s^k \\\\ &=\lim_{N\to+\infty}\sum_{k=0}^{\infty}\left(\sum_{n=1}^N\frac{(-1)^{k}}{k!}\frac{\log^k(n+a)}{n+b}s^k -\frac{(-1)^{k}}{k!}\frac{\log^{k+1} \!N}{k+1}s^k\right) \\\\ &=\lim_{N\to+\infty}\left(\sum_{n=1}^N\sum_{k=0}^{\infty}\frac{(-1)^{k}}{k!}\frac{\log^k(n+a)}{n+b}s^k -\sum_{k=0}^{\infty}\frac{(-1)^{k}}{k!}\frac{\log^{k+1} \!N}{k+1}s^k\right) \\\\ &=\lim_{N\to+\infty}\left(\sum_{n=1}^N\frac1{(n+a)^s(n+b)} +\frac1{N^s}-\frac1s\right) \\\\ &=\zeta(s \mid a,b)-\frac1{s} \end{align} $$ as desired. Then, using $(6)$, we extend the preceding identity by analytic continuation to all $s \neq 0$. To prove $(14)$, we start from a standard series representation of the digamma function (see Abram. & Steg. p. 258 6.3.16): $$ \begin{align} -\psi(b+1) &= \gamma - \sum_{n=1}^{\infty} \left( \frac1n - \frac1{b+n} \right) \\ &=\lim_{N\to+\infty}\left(\gamma - \sum_{n=1}^N\left( \frac1n - \frac1{b+n} \right)\right)\\ &=\lim_{N\to+\infty}\left(\left(\sum_{n=1}^N\frac1{b+n} -\ln N\right)-\left(\sum_{n=1}^N\frac1n-\ln N-\gamma \right)\right)\\ &=\lim_{N\to+\infty}\left(\sum_{n=1}^N\frac1{b+n} -\ln N\right)\\\\ &=\gamma_0(a,b) \end{align} $$ using $(13)$.

$\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \Box$


One of the consequences of Theorem 1 is the new possibility to express some series in terms of the poly-Stieltjes constants.

Theorem 2. Let $a,b,c$ be complex numbers such that $\Re a >-1, \, \Re b >-1, \, \Re c >-1$.

Then $$ \begin{align} (b-a)\sum_{n=1}^{+\infty} \frac{\log (n+c)}{(n+a)(n+b)}=\gamma_1(c,a)-\gamma_1(c,b), \tag{15} \end{align} $$ similarly $$ \begin{align} \sum_{n=1}^{+\infty} \frac1{n+b}\left({\log (n+a)-\log (n+c)}\right)=\gamma_1(a,b)-\gamma_1(c,b), \tag{16} \end{align} $$ with the poly-Stieltjes constant $$\gamma_1(a,b) = \lim_{N\to+\infty}\left(\sum_{n=1}^N \frac{\log (n+a)}{n+b}-\frac{\log^2 \!N}2\right). $$

Proof. Let $a,b,c$ be complex numbers such that $\Re a >-1, \, \Re b >-1, \, \Re c >-1$.

We have $$ (b-a)\frac{\log (n+c)}{(n+a)(n+b)}=\frac{\log (n+c)}{n+a}-\frac{\log (n+c)}{n+b} $$ giving, for $N\geq1$, $$ \begin{align} (b-a)&\sum_{n=1}^N \frac{\log (n+c)}{(n+a)(n+b)}=\\\\ & \left(\sum_{n=1}^N\frac{\log (n+c)}{n+a}-\frac{\log^2 \!N}2\right)-\left(\sum_{n=1}^N\frac{\log (n+c)}{n+b}-\frac{\log^2 \!N}2\right) \tag{17} \end{align} $$ letting $N \to \infty$ and using $(13)$ gives $(15)$.

We have, for $N\geq1$, $$ \begin{align} &\sum_{n=1}^N \frac1{n+b}\left({\log (n+a)-\log (n+c)}\right)\\\\ &= \left(\sum_{n=1}^N\frac{\log (n+a)}{n+b}-\frac{\log^2 \!N}2\right)-\left(\sum_{n=1}^N\frac{\log (n+c)}{n+b}-\frac{\log^2 \!N}2\right) \tag{18} \end{align} $$ letting $N \to \infty$ and using $(13)$ gives $(16)$.

$\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \Box$


Juantheron's integral


Let’s first give a numerical evaluation of Juantheron’s integral.

I would like to thank Jonathan Borwein and David H. Bailey who obtained the result below to $1000$ digits, in just 3.9 seconds run time, using David's new MPFUN-MPFR software, along with the tanh-sinh quadrature program included with the MPFUN-MPFR package.

They also tried the integral with David's MPFUN-Fort package, which has a completely different underlying multiprecision system, and they obtained the same result below.

Finally, they computed the integral with Mathematica $11.0$; it agreed with the result below, although it required about 10 times longer to run.

Proposition 1. We have $$ \begin{align} \int_{0}^{\Large\frac{\pi}2}\!&\frac1{(1+x^2)(1+\tan x)}\mathrm dx\\\\= 0.&59738180945180348461311323509087376430643859042555\\ &67307703207161550311033249824121789098990404474443\\ &73300942847961727020952797366230453350097928752529\\ &62099371263365268445580755896768905606293308536674\\ &89639352215352393870280616186538538722285601087082\\ &81730013060929540132583577240799018025603130403772\\ &83596189879605956759516344861849456740112012597646\\ &30195536341071109827787231788650530475635336662512\\ &50757672078320586388500276160658476344052492489409\\ &64026178233152015087197531148322444147655936720008 \tag{19}\\ &40650450631581050321100329502169853063154902765446\\ &58804861176982696627707544105655815406116180984371\\ &54148587721902800400109013880620460529382772599713\\ &06874977209651994186527207589425408866256042399213\\ &80515694164361264997143539392018681691584285790381\\ &65536517701019826846772718498479534803417547866296\\ &23842162877309354675086691711521468623807334908897\\ &71491673168051054009130049879837629516862688171756\\ &13790927986073268994254629238035029442300668334396\\ &901581838911515359223628586133156893962372426055\cdots \end{align} $$

David H. Bailey confirmed that Mathematica $11.0$, in spite of the great numerical precision, could not find a closed-form of the integral.

The next result proves that the OP integral admits a closed form in terms of the poly-Stieltjes constants.

Proposition 2. We have $$ \begin{align} \int_{0}^{\Large\frac{\pi}2}\!\!\frac1{(1+x^2)(1+\tan x)}\mathrm dx &=\frac{(e^2+1)^2}{2(e^4+1)}\arctan \! \frac{\pi}{2}-\frac{e^4-1}{4(e^4+1)}\log\left(1+\frac{\pi^2}{4}\right)\\\\ &+\frac{64 \pi^2\log 3}{(\pi^2+16)(9\pi^2+16)} \\\\ &+\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac34,\frac34 +\frac{i}{\pi}\!\right) -\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac14,\frac34 +\frac{i}{\pi}\!\right)\tag{20}\\\\ &+\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac34,\frac14 -\frac{i}{\pi}\!\right) -\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac14,\frac14 -\frac{i}{\pi}\!\right) \end{align} $$ with the poly-Stieltjes constant $$\gamma_1(a,b) = \lim_{N\to+\infty}\left(\sum_{n=1}^N \frac{\log (n+a)}{n+b}-\frac{\log^2 \!N}2\right). $$

Proof. We proceed in three steps.

Step 1. One may write $$ \require{cancel} \begin{align} &\int_{0}^{\Large\frac{\pi}{2}}\frac{1}{(1+x^2)(1+\tan x)}\mathrm dx \\ &=\int_{0}^{\Large\frac{\pi}{2}}\frac{\cos x}{(1+x^2)(\cos x+\sin x)}\mathrm dx\\ &=\frac12\int_{0}^{\Large\frac{\pi}{2}}\frac{(\cos x+\sin x)+(\cos x-\sin x)}{(1+x^2)(\cos x+\sin x)}\mathrm dx\\ &=\frac12\int_{0}^{\Large\frac{\pi}{2}}\!\frac{1}{1+x^2}\mathrm dx+\frac12\int_{0}^{\Large\frac{\pi}{2}}\frac{1}{(1+x^2)}\frac{(\cos x-\sin x)}{(\cos x+\sin x)}\mathrm dx\\ &=\frac12 \arctan\! \frac{\pi}{2}+\frac12\int_{0}^{\Large\frac{\pi}{2}}\frac{1}{1+x^2}\tan (x-\pi/4)\:\mathrm dx\\ &=\frac12 \arctan\! \frac{\pi}{2}+\frac12\int_{-\Large\frac{\pi}{4}}^{\Large\frac{\pi}4}\frac{1}{1+(x+\pi/4)^2}\tan x \:\mathrm dx\\ &=\frac12 \arctan\! \frac{\pi}{2}+\frac12\int_0^{\Large\frac{\pi}4}\left(\frac1{1+(x+\pi/4)^2}-\frac1{1+(x-\pi/4)^2}\right)\tan x \:\mathrm dx\\ &=\frac12 \arctan\! \frac{\pi}{2}-\frac{\Im}2 \!\int_{0}^{\Large\frac{\pi}{4}}\!\!\left(\!\frac1{x+\pi/4+i}+\frac1{x-\pi/4-i}\!\right) \tan x \:\mathrm dx \tag{21} \end{align} $$ Let’s evaluate the latter integral.

Step 2. One may recall that the tangent function, as a meromorphic function, can be expressed as an infinite sum of rational functions: $$ \tan x = \sum_{n=0}^{+\infty} \frac{2x}{\pi^2 (n+1/2)^2-x^2}, \quad x \neq \pm \pi/2, \pm 3\pi/2,\pm 5\pi/2,\ldots. \tag{22} $$ We have the inequality $$ \sup_{x \in [0,\pi/4]}\left|\frac{2x}{\pi^2 (n+1/2)^2-x^2}\right|\leq \frac1{(n+1/2)^2}, \quad n=0,1,2,\ldots, \tag{23} $$ the convergence in $(22)$ is then uniform on $[0,\pi/4]$. Thus, plugging $(22)$ into $(21)$, we are allowed to integrate $(21)$ termwise.

Each term, via a partial fraction decomposition, is evaluated to obtain $$ \begin{align} \int_{0}^{\Large\frac{\pi}4}\!&\left(\!\frac1{x+\pi/4+i}+\frac1{x-\pi/4-i}\!\right)\frac{2x}{\pi^2 (n+1/2)^2-x^2}\:\mathrm dx\\ &=\frac{2\tau}{\pi^2 (n+1/2)^2-\tau^2}\log \left( \frac{4\tau-\pi}{4\tau+\pi}\right)\\ &+\frac1{\pi}\frac1{(n+1/2+\tau/\pi)}\left(\log\!\left(n+\frac34\right)-\log\!\left(n+\frac14\right) \right)\\ &+\frac1{\pi}\frac1{(n+1/2-\tau/\pi)}\left(\log\!\left(n+\frac34\right)-\log\!\left(n+\frac14\right) \right) \end{align} \tag{24} $$ where for the sake of convenience we have set $\tau:=\pi/4+i$.

Step 3. We sum $(24)$ from $n=0$ to $\infty$ obtaining

$$ \begin{align} \int_{0}^{\Large\frac{\pi}{4}}\!&\left(\!\frac1{x+\pi/4+i}+\frac1{x-\pi/4-i}\!\right) \tan x \:\mathrm dx\\ &=\sum_{n=0}^{\infty}\frac{2\tau}{\pi^2 (n+1/2)^2-\tau^2}\log \left( \frac{4\tau-\pi}{4\tau+\pi}\right)\\ &+\frac1{\pi}\sum_{n=0}^{\infty}\frac1{(n+1/2+\tau/\pi)}\left(\log\!\left(n+\frac34\right)-\log\!\left(n+\frac14\right) \right)\\ &+\frac1{\pi}\sum_{n=0}^{\infty}\frac1{(n+1/2-\tau/\pi)}\left(\log\!\left(n+\frac34\right)-\log\!\left(n+\frac14\right) \right), \tag{25} \end{align} $$ then, singling out the first terms in the two last series and using Theorem $2$ $(16)$, we get $$ \begin{align} \int_{0}^{\Large\frac{\pi}{4}}\!&\left(\!\frac1{x+\pi/4+i}+\frac1{x-\pi/4-i}\!\right) \tan x \:\mathrm dx\\ &=\tan \tau \log \left( \frac{4\tau-\pi}{4\tau+\pi}\right) +\frac{4\pi}{\pi^2 -4\tau^2}\log 3 \\&+\frac1{\pi}\gamma_1\!\left(\!\frac34,\frac12 +\frac{\tau}{\pi}\!\right) -\frac1{\pi}\gamma_1\!\left(\!\frac14,\frac12 +\frac{\tau}{\pi}\!\right)\tag{26}\\ &+\frac1{\pi}\gamma_1\!\left(\!\frac34,\frac12 -\frac{\tau}{\pi}\!\right) -\frac1{\pi}\gamma_1\!\left(\!\frac14,\frac12 -\frac{\tau}{\pi}\!\right) \end{align} $$ and the substitution $\tau=\pi/4+i$ gives the desired result.

$\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \Box$


Achille Hui's conjecture is true.

Achille Hui has announced in the comments that the OP integral is equal to $$ \begin{align} \frac{\arctan(\frac{\pi}{2}) - t\log\sqrt{1+\frac{\pi^2}{4}}}{1+t^2}+\frac{\pi^2}4 \sum_{n=0}^{\infty}\frac{ (2n+1)\left(\log\left(n+\frac34\right)-\log\left(n+\frac14\right)\right) }{ \left(1+\pi^2\left(n+\frac14\right)^2\right)\left(1+\pi^2\left(n+\frac34\right)^2\right) } \tag{27} \end{align} $$ with $\displaystyle t := \tanh(1)$.

The first term in $(27)$, with a little algebra is seen to be equal to the sum of the first two terms on the right hand side of $(20)$.

We establish the veracity of the conjecture using Proposition $2$ and using the next result.

Proposition 3. We have $$ \begin{align} &\frac{\pi^2}4 \sum_{n=0}^{\infty}\frac{ (2n+1)\left(\log\left(n+\frac34\right)-\log\left(n+\frac14\right)\right) }{ \left(1+\pi^2\left(n+\frac14\right)^2\right)\left(1+\pi^2\left(n+\frac34\right)^2\right) }\\\\ &=\frac{64 \pi^2\log 3}{(\pi^2+16)(9\pi^2+16)} \\\\ &+\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac34,\frac34 +\frac{i}{\pi}\!\right) -\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac14,\frac34 +\frac{i}{\pi}\!\right)\tag{28}\\\\ &+\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac34,\frac14 -\frac{i}{\pi}\!\right) -\frac{\Im}{2\pi}\gamma_1\!\left(\!\frac14,\frac14 -\frac{i}{\pi}\!\right) \end{align} $$ with the poly-Stieltjes constant $$\gamma_1(a,b) = \lim_{N\to+\infty}\left(\sum_{n=1}^N \frac{\log (n+a)}{n+b}-\frac{\log^2 \!N}2\right).$$

Proof. Observe that the first term of the series on the left hand side of $(28)$, given by $n=0$, is just equal to $$ \frac{64 \pi^2\log 3}{(\pi^2+16)(9\pi^2+16)}. $$ By a partial fraction decomposition, one may check that $$ \begin{align} \frac{\pi^2}4 &\frac{ (2n+1) }{ \left(1+\pi^2\left(n+\frac14\right)^2\right)\left(1+\pi^2\left(n+\frac34\right)^2\right) } =\frac{\Im}{2\pi}\left(\!\frac1{n+\frac34+\frac{i}{\pi}}-\frac1{n+\frac14+\frac{i}{\pi}}\!\right) \tag{29} \end{align} $$ then, multiplying $(29)$ by $\left(\log\!\left(n+\frac34\right)-\log\!\left(n+\frac14\right)\right)$ and summing from $n=1$ to $\infty$ we get, using Theorem $2$ $(16)$, the result $(28)$.

$\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \Box$


Olivier Oloa
  • 118,697
  • 18
  • 195
  • 315
  • 8
    @Lucian I've evaluated your challenging integral :-) – Olivier Oloa Sep 01 '15 at 01:44
  • 26
    Defining enough special functions everything can be written in closed-form. I'm not convinced this is the simplest form one can get. – user 1591719 Jun 20 '16 at 18:40
  • 4
    Je ne l'avais pas encore vu celle-là. Cela m'amuse toujours de voir la qualité de vos réponses et l'aisance qu'il semble s'y dégager même si j'imagine que celle-ci a dû vous prendre au moins trente minutes. :) – ParaH2 Oct 30 '16 at 23:47
  • 11
    @Waiting Then, instead of writing useless comments, work smart and find a better solution. At least he gave a closed form, no matter if they do involve special functions, which by the way are very useful also because of this use. – Laplacian Apr 02 '18 at 10:31
  • @VonNeumann Maybe useless for you, but good to keep in mind for people that are always interested in digging deeper (which obviously doesn't seem to be your case). My inuition keeps me away from being convinced this is the simplest closed-form. That simple. – user 1591719 Apr 02 '18 at 19:20
  • @ Olivier Oloa Another, very compact, form of the integral is $\frac{1}{2}\int_{-1}^1 \text{arctan}(\text{arctan}(z+\frac{\pi}{4}))$ – Dr. Wolfgang Hintze Apr 22 '18 at 05:43
  • @Dr.WolfgangHintze Observe that $\frac{1}{2}\int_{-1}^1 \text{arctan}(\text{arctan}(z+\frac{\pi}{4}))\mathrm dz=0.363033\cdots$ whereas $\int_{0}^{\large\frac{\pi}2}\frac1{(1+x^2)(1+\tan x)}\mathrm dx=0.5973818\cdots$. – Olivier Oloa Apr 22 '18 at 21:35
  • @ Olivier Oloa: no, sorry, Mathematica gives $ \frac{1}{2}\int_{-1}^1 \text{arctan}\left(\text{arctan}(z)+\frac{\pi }{4}\right) \, dz = 0.5973818094518034846131132350908737643064...$. The formula follows from partial integration, leading to $\frac{1}{2} \int_{-\frac{\pi }{4}}^{\frac{\pi }{4}} \text{arctan}\left(y+\frac{\pi }{4}\right) \sec ^2(y) \, dy$, and subsequent substitution $z\to \tan(y)$ – Dr. Wolfgang Hintze Apr 24 '18 at 07:46
  • 2
    @Dr.WolfgangHintze Sorry but, as you can see, you have changed the integrand between the first and the last comment:) – Olivier Oloa Apr 24 '18 at 07:57
  • 1
    @ Olivier Oloa, your are right. I missed the typo in my first comment. What I wanted to point out is the correct formula in the second comment (with the derivation). – Dr. Wolfgang Hintze Apr 24 '18 at 08:53
  • @OlivierOloa What accuracy have you achieved? – Yuri Negometyanov Feb 27 '21 at 01:04
  • 1
    @YuriNegometyanov Thank you. It seems all digits in **Proposition 1** above are correct. – Olivier Oloa Mar 03 '21 at 12:37
  • 1
    @OlivierOloa Thank you too. As it is shown in my answer, tricky series summation via Wolfram Alpha gives near 30 decimal digits. – Yuri Negometyanov Mar 03 '21 at 13:05
37

Too long for a comment: It is known that $\displaystyle\int_0^\frac\pi2\sin(\sin x)dx=\int_0^\frac\pi2\sin(\cos x)dx=\frac\pi2H_0(1)$,

and $\displaystyle\int_0^\frac\pi2\cos(\cos x)dx=\int_0^\frac\pi2\cos(\sin x)dx=\frac\pi2J_0(1)$, where H and J are the Struve and Bessel

functions respectively, so it is not out of the question that the existence of such closed forms, at

least in terms of these special functions, might have been one of the main initial triggers which

determined our anonymous source to investigate the nature of $\displaystyle\int_0^\frac\pi2\!\tan(\tan x)dx$, which turns

out to be $\ldots$ rather difficult, to say the very least. Indeed, the entire interval $\bigg(0,\dfrac\pi2\bigg)$ can be

broken up into an infinite number of sub-intervals, the first one of which is $\bigg(0,~\arctan\dfrac\pi2\bigg)$,

while all others are of the form $\bigg[\arctan\bigg(\dfrac\pi2+k\pi\bigg),~\arctan\bigg(\dfrac\pi2+\big(k+1\big)\pi\bigg)\bigg]$, for $k\in$ N.

The integral diverges towards $+\infty$ on the former, and towards $-\infty$ on the rest, but in such

a manner that $\displaystyle\int_0^{\alpha(k)}\!\tan(\tan x)dx\to\infty$ rather than $-\infty$, where $\alpha(k)=\arctan\bigg(\dfrac\pi2+k\pi\bigg)$.

This can be better visualized by plotting the function's graphic. But determining whether the

limit $\displaystyle\lim_{k\to\infty}\int_0^{\alpha(k)}\!\tan(\tan x)dx$ ultimately converges or diverges is by no means a trivial task

$\big($indeed, it is quite daunting$\big)$, so, discouraged, either by the integral's probable divergence, or

perhaps by its difficulty, or maybe by a bit of both, our anonymous source $\big($let's call him/her

Person X$\big)$ decides to focus its attention now on $\bigg(0,~\arctan\dfrac\pi2\bigg)$, but not before changing the

function into $~\dfrac1{\tan(\tan x)}$ , so as to avoid its divergence in $x=\arctan\dfrac\pi2$ . However, he now

faces another problem: its divergence in $0$. In order to fix this new impediment, the function

is further changed to $~\dfrac1{1+\tan(\tan x)}$ . Then, by a simple substitution, $\displaystyle\int_0^{\alpha(0)}\frac{dx}{1+\tan(\tan x)}$

becomes $\displaystyle\int_0^\frac\pi2\frac{dx}{(1+x^2)(1+\tan x)}$ , as already pointed out by ncmathsadist in the comment

section above. That such an improvised integral would indeed have a meaningful closed form

is no more likelier than for $\displaystyle\int_0^\frac\pi2\frac{dx}{1+\sin(\sin x)}=\int_0^\frac\pi2\frac{dx}{1+\sin(\cos x)}$ or $\displaystyle\int_0^\frac\pi2\frac{dx}{1+\cos(\cos x)}$

$=\displaystyle\int_0^\frac\pi2\frac{dx}{1+\cos(\sin x)}$ to possess one as well.

Lucian
  • 46,778
  • 1
  • 77
  • 148
11

It is clear that the integral cannot be expressed in the form of elementary functions. This is another approach expanding on mwomath's comment. I feel this approach may be useful as it is a bit easier to understand in my opinion, as compared to Olivier Oloa's answer (which is completely fine). Sorry in advance for any steps I miss.

Simplifying the original integral into three integrals:

$$\int_0^{\pi/2} \frac{dx}{(1+x^2)(1+\tan x)}$$ $$=\int_0^{\pi/2} \frac{\cos x dx}{(1+x^2)(\sin x+\cos x)}$$ $$= \int_0^{\pi/2} \frac{\cos x dx}{(1+x^2)(\sin x+\cos x)}.\frac{(\cos x-\sin x)}{(\cos x-\sin x)}$$ $$=\int_0^{\pi/2} \frac{\cos^2 x-\sin x \cos x }{(1+x^2)(\cos^2 x-\sin^2 x)}dx$$ $$=\int_0^{\pi/2} \frac{\cos^2 x-\sin x \cos x }{(1+x^2)(\cos 2x)}dx$$ $$=\int_0^{\pi/2} \frac{1}{2}\frac{(2\cos^2 x-1-2\sin x \cos x+1) }{(1+x^2)(\cos 2x)}dx$$ $$=\int_0^{\pi/2} \frac{1}{2}\frac{(\cos 2x-\sin 2x+1) }{(1+x^2)(\cos 2x)}dx$$

$$=\int_0^{\pi/2}\frac{1}{1+x^2}dx+\int_0^{\pi/2}\frac{\sec 2x}{1+x^2}dx-\int_0^{\pi/2}\frac{\tan 2x}{1+x^2}dx$$


Evaluating $\int_0^{\pi/2}\frac{1}{1+x^2}dx$ :

We know that $\int \frac{1}{1+x^2}dx=\arctan x$

So, $$\int_0^{\pi/2}\frac{1}{1+x^2}dx=\arctan (\pi/2)$$


Evaluating $\int_0^{\pi/2}\frac{\sec 2x}{1+x^2}dx$ :

The infinite sum of $\sec x$ is given as:

$$\sec x =\sum_{n=0}^{\infty} \frac{U_{2n}x^{2n}}{(2n)!}$$ where $U_{n}$ up/down number.

Similarly, $$\int_0^{\pi/2}\frac{\sec 2x}{1+x^2}dx=\int_0^{\pi/2} \sum_{n=0}^{\infty} \frac{2^n.U_{2n}x^{2n}}{(2n)!(1+x^2)}dx= \sum_{n=0}^{\infty} \int_0^{\pi/2} \frac{2^{2n}.U_{2n}x^{2n}}{(2n)!(1+x^2)}dx$$ $$\int \frac{x^{2n}}{1+x^2}dx=\frac{x^{2n+1}}{2n+1}\left( 1+\frac{2n+1}{2n+3}(-x^2)+\frac{2n+1}{2n+5}(-x^2)^2-\frac{2n+1}{2n+7}(-x^2)^6+\cdots\right)$$

We can express the infinite sum in the parenthesis in form of the hyper-geometric function:

$$_2F_1 \left(1, n+\frac{1}{2}; n+\frac{3}{2} ; -x^2 \right)$$

So, $$\int_0^{\pi/2}\frac{\sec 2x}{1+x^2}dx=\sum_{n=0}^{\infty} \int_0^{\pi/2} \frac{2^{2n}.U_{2n}x^{2n}}{(2n)!(1+x^2)}dx$$ $$= \sum_{n=0}^{\infty} \frac{2^{2n}.U_{2n}}{(2n)!}\frac{(\pi/2)^{2n+1}}{(2n+1)}._2F_1 \left(1, n+\frac{1}{2}; n+\frac{3}{2} ; -\pi^2/4 \right)$$


Evaluating $\int_0^{\pi/2}\frac{\tan 2x}{1+x^2}dx$ :

The infinite sum of $\tan x$ is given as: $$\tan x =\sum_{n=0}^{\infty} \frac{U_{2n+1}x^{2n+1}}{(2n+1)!}$$ where $U_{n}$ up/down number.

Similarly, $$\int_0^{\pi/2}\frac{\tan 2x}{1+x^2}dx=\int_0^{\pi/2} \sum_{n=0}^{\infty} \frac{2^{2n+1}.U_{2n+1}x^{2n+1}}{(2n+1)!(1+x^2)}dx= \sum_{n=0}^{\infty} \int_0^{\pi/2} \frac{2^{2n+1}.U_{2n+1}x^{2n+1}}{(2n+1)!(1+x^2)}dx$$ $$\int \frac{x^{2n+1}}{1+x^2}dx=\frac{x^{2n+2}}{2n+2}\left( 1+\frac{2n+2}{2n+4}(-x^2)+\frac{2n+2}{2n+6}(-x^2)^2-\frac{2n+2}{2n+8}(-x^2)^6+\cdots\right)$$

We can express the infinite sum in the parenthesis in form of the hyper-geometric function:

$$_2F_1 \left(1, n+1; n+2 ; -x^2 \right)$$

So, $$\int_0^{\pi/2}\frac{\tan 2x}{1+x^2}dx=\sum_{n=0}^{\infty} \int_0^{\pi/2} \frac{2^{2n+1}.U_{2n+1}x^{2n+1}}{(2n+1)!(1+x^2)}dx$$ $$= \sum_{n=0}^{\infty} \frac{2^{2n+1}.U_{2n+1}}{(2n+1)!}\frac{(\pi/2)^{2n+2}}{(2n+2)}._2F_1 \left(1, n+1; n+2 ; -\pi^2/4 \right)$$


Final expression:

$$\int_0^{\pi/2} \frac{dx}{(1+x^2)(1+\tan x)}$$ $$=\sum_{n=0}^{\infty} \frac{2^{2n}.U_{2n}}{(2n)!}\frac{(\pi/2)^{2n+1}}{(2n+1)}._2F_1 \left(1, n+\frac{1}{2}; n+\frac{3}{2} ; -\pi^2/4 \right)$$ $$+\sum_{n=0}^{\infty} \frac{2^{2n+1}.U_{2n+1}}{(2n+1)!}\frac{(\pi/2)^{2n+2}}{(2n+2)}._2F_1 \left(1, n+1; n+2 ; -\pi^2/4 \right)+\arctan (\pi/2) + C$$

or if you don't want to use hyper-geometric functions (in my opinion they just make the integral look a bit more clean and are a good way of representing certain infinite sums):

$$\int_0^{\pi/2} \frac{dx}{(1+x^2)(1+\tan x)}$$ $$=\sum_{n=0}^{\infty} \left( \frac{2^{2n}.U_{2n}.(\pi/2)^{2n}}{(2n)!}.\sum_{k=0}^{\infty}\frac{(-1)^{k}(\pi/2)^{2k+1}}{2(n+k)+1} \right)$$ $$+\sum_{n=0}^{\infty} \left(\frac{2^{2n+1}.U_{2n+1}(\pi/2)^n}{(2n+1)!} .\sum_{k=1}^{\infty}\frac{(-1)^{k-1}(\pi/2)^{2k}}{2(n+k)}\right) +\arctan (\pi/2) + C$$

Mathphile
  • 2,367
  • 10
  • 34
7

Let us try to understand the computer-based answer of Oliver Oloa.

Rational decomposition.

Is known the rational decomposition of the trigonometric functions in the forms of $$\tan z = \sum\limits_{n=0}^\infty\dfrac{8z}{\pi^2\left(2n+1\right)^2 - 4z^2},\tag{R1}$$ $$\sec z = \sum\limits_{n=0}^\infty (-1)^n\dfrac{4\pi(2n+1)}{\pi^2\left(2n+1\right)^2 - 4z^2},\tag{R2}$$ with the corollaries $$\tanh z =-i\tan(iz) = \sum\limits_{n=0}^\infty\dfrac{8z}{\pi^2\left(2n+1\right)^2 + 4z^2},\tag{R3}$$ $$\operatorname{sech}z = \sec(iz) = \sum\limits_{n=0}^\infty (-1)^n\dfrac{4\pi(2n+1)}{\pi^2\left(2n+1\right)^2 + 4z^2}.\tag{R4}$$

Preparation.

$$I=\int\limits_0^{\Large^\pi/_2}\dfrac{\text dx}{(1+x^2)(1+\tan x)} =\dfrac12\int\limits_0^{\Large^\pi/_2}\left(\dfrac{1+\tan x}{1+\tan x} -\dfrac{\tan x-1}{1+\tan x}\right)\,\dfrac{\text dx}{1+x^2}$$ $$=\dfrac12\int\limits_0^{\Large^\pi/_2}\dfrac{\text dx}{1+x^2} -\dfrac12\int\limits_0^{\Large^\pi/_2}\tan\left(x-\dfrac\pi4\right)\,\dfrac{\text dx}{1+x^2},$$ $$I=\dfrac12\int\limits_0^{\Large^\pi/_2}\dfrac{\text dx}{1+x^2} -\dfrac12\int\limits_0^{\Large^\pi/_2}\sum\limits_{n=0}^\infty g_n(x)\,\text dx,\tag1$$ where, taking in account $(R1),$ $$g_n(x)=\dfrac{2x-\large\frac\pi2}{\pi^2\left(n+\large\frac12\right)^2 - \left(x-\large\frac\pi4\right)^2}\cdot\dfrac1{1+x^2}.\tag2$$

Partial fractions.

The functions $\;g_n(x)\;$ allow decomposition in the form of $$g_n(x)=\dfrac{A_nx+B_n}{1+x^2} + \dfrac {C_n}{\pi n+\frac34\pi-x} + \dfrac {D_n}{\pi n+\frac14\pi+x}.\tag3$$ Then $$C_n=\lim_{\large x\to \pi n+\frac34\pi}\, \left(\pi n+\frac34\pi-x\right)g_n(x) = \dfrac{16}{(4 n\pi+3\pi)^2 +16},$$ $$D_n=\lim_{\large x\to -\pi n-\frac14\pi}\, \left(\pi n+\frac14\pi+x\right)g_n(x) = -\dfrac{16}{(4n\pi+\pi)^2 +16},$$ $$A_n-C_n+D_n=\lim_{\large x\to \infty}\, x g_n(x) = 0,\quad A_n=C_n-D_n,$$ $$B_n+ \dfrac {C_n}{\pi n+\frac34\pi} + \dfrac {D_n}{\pi n+\frac14\pi} =g_n(0) = -\dfrac8{\pi(16n^2+16n+3)},$$ $$B_n = \dfrac4{4\pi n+3\pi} -\dfrac4{4\pi n+\pi} - \dfrac {4C_n}{4\pi n+3\pi} - \dfrac {4D_n}{4\pi n+\pi}.$$ $$B_n = 4(4\pi n+3\pi)C_n + 4(4\pi n+\pi)D_n.$$

Let $$U_k = \dfrac{16}{(2k\pi+\pi)^2+16},$$ then, taking in account $(R3)-(R4),$ $$D_n = -U_{2n},\quad C_n=U_{2n+1},\;$$ $$\sum\limits_{n=0}^\infty A_n = \sum\limits_{n=0}^\infty U_n = \tanh2,\tag4$$ $$\sum\limits_{n=0}^\infty B_n = \sum\limits_{n=0}^\infty (-1)^{n+1}4\pi(2n+1)U_n = -\operatorname{sech}2.\tag5$$

Integration.

$$I=\dfrac12\int\limits_0^{\Large^\pi/_2}\dfrac{\text dx}{1+x^2} -\dfrac12\int\limits_0^{\Large^\pi/_2}\sum\limits_{n=0}^\infty g_n(x)\,\text dx$$ $$ = \dfrac12 \arctan \,\dfrac\pi2-\dfrac12\sum\limits_{n=0}^\infty \left(\dfrac12 A_n \ln\left(\dfrac{\pi^2}4+1\right) +B_n \arctan \,\dfrac\pi2+(C_n+D_n) \ln\dfrac{4n + 3}{4n+1}\right),$$ $$I=-\dfrac14\tanh 2\ln\left(\dfrac{\pi^2}4+1\right) + \dfrac{1+\operatorname{sech}2}2 \arctan \,\dfrac\pi2-\dfrac12 I_1,\tag6$$ where $$I_1=\sum\limits_{n=0}^\infty (C_n+D_n) \ln\dfrac{4n + 3}{4n+1},\tag7$$ with the representations $$I_1=\sum\limits_{n=0}^\infty \dfrac{128\pi^2(2n+1)}{\pi^4((4n+2)^2-1)^2 +32\pi^2((4n+2)^2+1)+256}\,\ln\dfrac{4n+3}{4n+1}\tag{7a}$$

I1-S Sum S

and $$I_1=\sum\limits_{n=0}^\infty \Im\left(-\dfrac4{4\pi n+3\pi+4i}+\dfrac4{4\pi n+\pi+4i}\right) \ln\dfrac{4n + 3}{4n+1}.\tag{7b}$$

The poly-Stieltjes constants using.

The poly-Stieltjjes constants do not belong to the standard special functions, but they are defined in the Oliver Oloa answer as the known specific functions.

In particular, from $(7b)$ and the given definition in the form of $$\gamma_1(a,b) = \lim\limits_{N\to\infty}\left(\sum\limits_{n=1}^N \dfrac{\ln(n+a)}{n+b} - \dfrac{\ln N^2}2\right)\tag{$\large\diamond$}$$ should $$\begin{align} &I_1= \dfrac{16}{16+9\pi^2}\,\ln3 - \dfrac1\pi \Im\left(\gamma_1\left(\small\dfrac34,\frac34+\frac i\pi\right) - \gamma_1\left(\small\dfrac14,\frac34+\frac i\pi\right) \right)\\[4pt] &-\dfrac{16}{16+\pi^2}\,\ln3 + \dfrac1\pi \Im\left(\gamma_1\left(\small\dfrac34,\frac14+\frac i\pi\right) - \gamma_1\left(\small\dfrac14,\frac14+\frac i\pi\right) \right), \end{align}\tag8$$

$$\begin{align} &I=-\dfrac14\tanh 2\ln\left(\dfrac{\pi^2}4+1\right) + \dfrac{1+\operatorname{sech}2}2 \arctan \,\dfrac\pi2 +\dfrac{64\pi^2}{(16+\pi^2)(16+9\pi^2)}\\[4pt] &+\dfrac1{2\pi}\Im\left(\gamma_1\left(\small\dfrac34,\frac34+\frac i\pi\right) - \gamma_1\left(\small\dfrac14,\frac34+\frac i\pi\right) \right)\\[4pt] &- \dfrac1{2\pi} \Im\left(\gamma_1\left(\small\dfrac34,\frac14+\frac i\pi\right) - \gamma_1\left(\small\dfrac14,\frac14+\frac i\pi\right) \right). \end{align}\tag9$$

Formula $(9)$ gives the closed-form representation, which cannot be used in the popular package Wolfram Alpha.

Results.

  • Obtained the alternatiive notation of the poly-Stieltjes closed form $(9)$ for the given integral.
  • Obtained the calculating formulas $(6),(7a)$ via the elementary functions series. Evaluated value

Integral I Integral I, value

corresponds to the numerical calculations of the given integral

Numerical calculations of I.

Yuri Negometyanov
  • 26,151
  • 1
  • 26
  • 55
3

A good fit for $\frac{1}{1+\tan x}$ in $[0,\frac{\pi}{2}]$ is $1-\frac{2}{\pi}x$

So

$$I_{approx}=\int_0^{\frac{\pi}{2}}\frac{1-\frac{2}{\pi}x}{1+x^2}dx=\arctan \frac{\pi}{2}-\frac{1}{\pi}\ln\left (1+ \frac{\pi^2}{4} \right )$$ Absolute error is about $0.011$

Martin Gales
  • 5,965
  • 3
  • 27
  • 42