Calculating the integral $\int_0^\infty \frac{\cos x}{1+x^2}\, \mathrm{d}x$ without using complex analysis Suppose that we do not know anything about the complex analysis (numbers). In this case, how to calculate the following integral in closed form?
$$\int_0^\infty\frac{\cos x}{1+x^2}\,\mathrm{d}x$$

The method of brackets, which is an extension of Ramanujan's master theorem, can be used to evaluate this classic integral.
The term bracket refers to the assignment of the symbol $\langle a \rangle$ to the divergent integral $\int_{0}^{\infty} x^{a -1} \, \mathrm{d}x$.
You can read about the method in the following papers:
Definite integrals by the method of brackets. Part 1
The method of brackets. Part 2: Examples and applications
Evaluation of entries in Gradshteyn and Ryzhik employing the
method of brackets
On the Method of Brackets: Rules, Examples, Interpretations and Modifications

The hypergeometric representation of the cosine function is $$ \, _0F_{1} \left(; \frac{1}{2}; - \frac{x^{2}}{4} \right) = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{n!} \,  \frac{\Gamma \left( \frac{1}{2} \right)}{\Gamma \left(n+\frac{1}{2} \right)} \left(\frac{x^{2}}{4} \right)^{n} = \sum_{n=0}^{\infty} \phi_{n} \,  \frac{\Gamma \left( \frac{1}{2} \right)}{\Gamma \left(n+\frac{1}{2} \right)} \left(\frac{x^{2}}{4} \right)^{n}. $$
(This representation can be derived from the Maclaurin series of $\cos (x)$ by using the duplication formula for the gamma function).
And according to Rule 3.1 on page 8 of the first paper, the function $   \frac{1}{1+x^{2}}$ is assigned the bracket series $$\sum_{k=0}^{\infty} \sum_{m=0}^{\infty} \phi_{k,m} \, x^{2m}  \langle k+m+1 \rangle. $$
Therefore, the integral $  \int_{0}^{\infty} \frac{\cos x}{1+x^{2}} \, \mathrm{d}x$ corresponds with the bracket series $$ \sum_{k=0}^{\infty} \sum_{m=0}^{\infty} \sum_{n=0}^{\infty} \phi_{k,m,n} \, \frac{\Gamma \left(\frac{1}{2} \right)}{\Gamma \left(n+\frac{1}{2}\right)} \frac{1}{4^{n}} \langle k+m+1\rangle \langle 2m+2n+1 \rangle. \tag{1}$$
To evaluate $(1)$, first let $k$ be a free parameter.
The brackets then vanish if $m=-k-1$ and $n= k + \frac{1}{2}$.
So according to Rule 3.3 in the first paper, the contribution to the integral is
$$\begin{align}\frac{1}{2} \sum_{k=0}^{\infty} \frac{(-1)^{k}}{k!} \frac{\Gamma \left(\frac{1}{2} \right)}{\Gamma (k+1 )} \, \frac{\Gamma (k+1) \Gamma \left(-k-\frac{1}{2} \right)}{4^{k+ 1/2}}  &= \frac{\sqrt{\pi}}{4} \sum_{k=0}^{\infty} \frac{(-1)^{k}}{k!} \frac{1}{4^{k}} \frac{\pi (-1)^{k-1} }{\Gamma \left(k + \frac{3}{2} \right)}  \\ &= - \frac{\pi  \sqrt{\pi} }{4}  \sum_{k=0}^{\infty} \frac{1}{k!} \frac{1}{4^{k}}  \frac{2^{2(k+1)-1} \Gamma(k+1)}{ \sqrt{\pi} \,  \Gamma(2k+2)}  \\ &= -\frac{\pi}{2} \sum_{k=0}^{\infty} \frac{1}{(2k+1)!} \\ &= -\frac{\pi}{2} \, \sinh (1). \end{align}$$
(I used the reflection formula for the gamma function on the first line, and then I used the duplication formula for the gamma function on the second line.)
Now let $m$ be a free parameter.
The brackets then vanish if $k = -m-1$ and $n=-m -\frac{1}{2}$.
So according to Rule 3.3, the contribution to the integral is $$ \frac{1}{2} \sum_{m=0}^{\infty} \frac{(-1)^{m}}{m!} \frac{\Gamma \left(\frac{1}{2} \right)}{{\color{red}{\Gamma (-m)}}} \frac{\Gamma(m+1) \Gamma \left(m+ \frac{1}{2} \right)}{4^{-m-1/2}} =0.$$
Finally let $n$ be a free parameter.
The brackets then vanish if $k = - n - \frac{1}{2}$and $m=  n - \frac{1}{2}$.
So according to Rule 3.3, the contribution to the integral is
$$\begin{align}\frac{1}{2} \sum_{n=0}^{\infty} \frac{(-1)^{n}}{n!} \frac{\Gamma \left(\frac{1}{2} \right)}{\Gamma (n + \frac{1}{2} )} \, \frac{\Gamma \left(n + \frac{1}{2} \right) \Gamma \left(\frac{1}{2}-n \right) }{4^{n}}  &= \frac{\sqrt{\pi}}{2} \sum_{n=0}^{\infty} \frac{(-1)^{n}}{n!} \frac{1}{4^{n}} \frac{\pi (-1)^{n}}{\Gamma \left(n+ \frac{1}{2} \right)} \\ &= \frac{\pi \sqrt{\pi}}{2}  \sum_{n=0}^{\infty} \frac{1}{n!} \frac{1}{4^{n}}  \frac{2^{2(n+1/2)-1} \Gamma(n+1)}{\sqrt{\pi} \,  \Gamma(2n+1)} \\ &= \frac{\pi}{2} \sum_{n=0}^{\infty} \frac{1}{(2n)!} \\ &= \frac{\pi}{2} \, \cosh (1). \end{align}$$
Rule 3.4 in the first paper says that we should add these three contributions to get the value of the integral.
Therefore, $$\int_{0}^{\infty} \frac{\cos(x)}{1+x^{2}} \, \mathrm{d}x = - \frac{\pi}{2} \sinh(1) + 0 + \frac{\pi}{2} \cosh(1) = \frac{\pi}{2e}.$$
