# An interesting integral $I = \int\limits_{-1}^{1} \arctan(e^x)dx$

I solved this interesting integral online: $$I = \int\limits_{-1}^{1} \arctan(e^x)dx$$ Now I tried the substitution $u=e^x$ but it lead me nowhere. I was looking at the following post which was solved in a beautiful way Integrate $\int_0^{\pi/2} \frac{1}{1+\tan^\alpha{x}}\,\mathrm{d}x$. From there I found this very interesting article http://www.maa.org/sites/default/files/pdf/mathdl/CMJ/Nelsen39-41.pdf which has the integral I posted at the end as a question to the reader.

Looking at the graph of $\arctan(e^x)dx$ on the interval $-1 \leq x \leq 1$ I conjectured that $I=\frac{\pi}{2}$. I used the following method to prove it: \begin{eqnarray} -e^{-x}&=&\frac{-1}{e^x}\\&=& \frac{-1}{\tan\{ \arctan(e^x) \} }\\&=&-\cot\{ \arctan(e^x) \}\\ &=& \tan \left\{\arctan(e^x)-\frac{\pi}{2} \right\}\\ \end{eqnarray} For the last equality I used the fact that $\cot(\theta) =-\tan\left(\theta -\frac{\pi}{2}\right)$. Now we take the arctan of both sides to obtain: $$\arctan(-e^{-x}) = \arctan(e^x)-\frac{\pi}{2}$$

Finally I use the fact that $\arctan(-\theta)=-\arctan(\theta)$ and add $\frac{\pi}{4}$ to both sides of the last equation to obtain: $$-\arctan(e^{-x}) +\frac{\pi}{4}= \arctan(e^x)-\frac{\pi}{4}$$ So it is established that the function $f(x) = \arctan(e^x)-\frac{\pi}{4}$ is an odd function. Thus $$I_2 = \int\limits_{-1}^{1} \left[ \arctan(e^x)-\frac{\pi}{4} \right]dx = 0$$ Now $$I = \int\limits_{-1}^{1} \arctan(e^x)dx = I_2 + \int\limits_{-1}^{1} \frac{\pi}{4}dx =\frac{\pi}{2}$$ I thought this integral was really interesting and I was wondering if anyone else has any different ways of solving it, possibly with a clever substitution. I was especially amazed at how easily it could be solved because integrals with arctan usually give me a lot of trouble.

Also, I think we can extend this to a broader result where we replace $x$ by any arbitrary odd function $g(x)$ and show that $$I = \int\limits_{-a}^{a} \arctan(e^{g(x)})dx = \frac{a \pi}{2}$$ for any odd function $f(x): (-a,a) \to\Bbb R$. Essentially the proof for this would follow the exact same reason as above right?

So if anyone has another method of computing the original integral I am definitely interested in reading your solutions! Thanks in advance for any input and ideas! Also thanks to Ron Gordon for his nice answer on the question I linked, the answer given there inspired me to look for different ways of trying to solve this integral that I normally would have given up on.

$g(x)$ need to be an odd function, otherwise $f(x)=\arctan(e^{g(x)})-\pi/4$ is not an odd function.

One simple test is at least $f(x=0)$ should be $0$, which is not satisfied by your choice of $g(x)=1$.

• Yes you are right! Thanks, I see that it is necessary now. I am still interested in anyone having another derivation for the original integral $I$ though! – Slugger Dec 16 '13 at 3:08
• As far as I know, without that "odd function" technique, there is no simple ways to calculate this. The [indefinite integral][1] is really messy. [1]: wolframalpha.com/input/?i=integrate%5Barctan%5Be%5Ex%5D%2Cx%5D – MoonKnight Dec 16 '13 at 3:29

was working on something similar

integration by parts, noticing the initial integral is related to a form of the integral of sech

$I = \int\limits_{-1}^{1} \arctan(e^x)dx$

$= [x \arctan(e^x)] - \int\limits_{-1}^{1} x e^x / (1 + e^{2x})dx$

$= [x \arctan(e^x)] - \int\limits_{-1}^{1} x / (e^{-x} + e^{x})dx$

$= [x \arctan(e^x)] - (1/2)\int\limits_{-1}^{1} x sech(x)dx$

is then odd i think and equals $[x \arctan(e^x)]$

I got Nelsen's answer of pi/2, not sure why the x arctan part works out as that yet, but numerically it did

• actually you proved that last part, it was what I was looking for in the first place thanks! – Cato Mar 20 '17 at 18:16

I have found another way to integrate this integral,first you have to know this identity, very useful for integrals with arctan $$\arctan(y)+arctan(1/y) =\frac{\pi}{2}\qquad (1)$$ with x positive or equal to 0, and $$\arctan(y)+arctan(1/y) =\frac{-\pi}{2}$$ for y negative. The first step is separate the integral

$$\int\limits_{-1}^{1} \arctan(e^x)dx=\int\limits_{0}^{1} \arctan(e^x)dx+\int\limits_{-1}^{0} \arctan(e^x)dx\qquad (2)$$ after that in the seconnd integral use this substitution (x=-y) and we get

$$\int\limits_{-1}^{0} \arctan(e^x)dx=\int\limits_{0}^{1} \arctan(e^-y)$$ then wecan use this and put it in (1) (and replace x=y because is the same what variable we use) and we get $$\int\limits_{0}^{1} \arctan(e^x)dx+\int\limits_{0}^{1} \arctan(e^-x)dx$$ after we use (2) and we get $$\int\limits_{0}^{1} \frac{\pi}{2}dx$$=\frac{\pi}{2} Then i tryed to generalize and I resolved the same first integral with x=x^3, if you want you can try to prove it. Finally we can generalize for g(x) if this function is odd

$$\int\limits_{-1}^{1} \arctan(e^{g(x)})dx=\int\limits_{0}^{1} \arctan(e^{g(x)})dx+\int\limits_{-1}^{0} \arctan(e^{g(x)})dx$$ we subtitue (x=-y) in the second integral and omitting steps we get $$\int\limits_{-1}^{1} \arctan(e^{g(x)})dx=\int\limits_{0}^{1} \arctan(e^{g(x)}-e^{g(-x)})dx=\int\limits_{0}^{1} \frac{\pi}{2}dx=\frac{\pi}{2}$$

for a and -a in the limits we can use the same method, if you can´t do it i will explain it,thank you for reading and goodbye.