$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\Li}[1]{\,{\rm Li}_{#1}} \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ $\ds{\int_{-\pi/2}^{\pi/2}\arctan\pars{a + \tan\pars{x}}\,\dd x =\pi\arctan\pars{a \over 2}:\ {\large ?}\,,\qquad a \in {\mathbb R}}$ .
Tenga en cuenta que \begin{align}&\color{#66f}{\large% \int_{-\pi/2}^{\pi/2}\arctan\pars{a + \tan\pars{x}}\,\dd x} =\Im\int_{-\pi/2}^{\pi/2}\ln\pars{1 + \bracks{a + \tan\pars{x}}\ic}\,\dd x \end{align} que nos permite evitar el "doble $\ds{\tt arctan}$ -corte de la rama a lo largo de $\ds{\braces{y\ic\ \mid\ \verts{y} \geq 1\,,\ y \in {\mathbb R}}}$ . Con el cambio de variables $\ds{\dsc{t} \equiv \dsc{1 + \bracks{a + \tan\pars{x}}\ic}\ \imp\ \dsc{x}=\dsc{\arctan\pars{-a + \bracks{1 - t}\ic}}}$ \begin{align}&\color{#66f}{\large% \int_{-\pi/2}^{\pi/2}\arctan\pars{a + \tan\pars{x}}\,\dd x} =\Im\int_{1 - \infty\ic}^{1 + \infty\ic}\ln\pars{t}\, {-\ic\,\dd t \over \bracks{-a + \pars{1 - t}\ic}^{\,2} + 1} \\[5mm]&=\Re\int_{1 - \infty\ic}^{1 + \infty\ic} {\ln\pars{t}\, \over t^{2} - 2\pars{1 + a\ic}t - a^{2} + 2a\ic}\,\dd t =\Re\int_{1 - \infty\ic}^{1 + \infty\ic} {\ln\pars{t}\, \over \pars{t - t_{-}}\pars{t - t_{+}}}\,\dd t \\[5mm]&\mbox{where}\quad t_{-} \equiv a\ic\,,\quad t_{+} \equiv 2 + a\ic. \end{align}
Podemos elegir el ${\tt ln}$ -corte de la rama de tal manera que no "cruce" la línea $\ds{x = 1}$ . Por ejemplo $$ \ln\pars{z}=\ln\pars{\verts{z}} + \,{\rm Arg}\pars{z}\ic\,,\qquad \verts{\,{\rm Arg}\pars{z}} < \pi\,,\quad z \not= 0 $$ Cerramos el contorno con un semicírculo $\ds{\pars{~\mbox{of radius}\ R > \root{a^{2} + 1}~}}$ a la "derecha" del plano complejo tal que: \begin{align}\color{#66f}{\large% \int_{-\pi/2}^{\pi/2}\arctan\pars{a + \tan\pars{x}}\,\dd x} &=\Re\bracks{-2\pi\ic\,{\ln\pars{t_{+}}\, \over t_{+} - t_{-}}} =\pi\,\Im\ln\pars{2 + a\ic} \\[5mm]&=\left\{\begin{array}{lcl} \pi\bracks{-\arctan\pars{-\,{a \over 2}}} & \mbox{if} & a \leq 0 \\[2mm] \pi\arctan\pars{a \over 2} & \mbox{if} & a > 0 \end{array} \derecha. \fin{align} La contribución de dicho semicírculo se desvanece cuando $\ds{R \to \infty}$ : Su magnitud es $\ds{\sim\pi\,{\ln\pars{R} \over R}}$ cuando $\ds{R \gg \root{a^{2} + 1}}$ .
Entonces, $$ \color{#66f}{\large% \int_{-\pi/2}^{\pi/2}\arctan\pars{a + \tan\pars{x}}\,\dd x} =\color{#66f}{\large\pi\arctan\pars{a \over 2}} $$