# Evaluating $\int_1^2\frac{\arctan(x+1)}{x}\,dx$

Evaluate the following integral $$\int_1^2\frac{\arctan(x+1)}{x}\,dx$$ with $$0\leq\arctan(x)<\pi/2$$ for $$0\leq x<\infty.$$

I proceeded the following way

\begin{aligned} &\int_1^2\frac{\arctan(x+1)}{x}\,dx\to {\small{\begin{bmatrix}&u=x+1&\\&du=dx&\end{bmatrix}}} \to\int_2^3\frac{\arctan(u)}{u-1}\,du=\\ &\ln(2)\arctan(3)-\int_2^3\frac{\ln(u-1)}{u^2+1}\,du\to {\small{\begin{bmatrix}&u=\tan(\theta)&\\&du=\sec^2(\theta)d\theta&\end{bmatrix}}} \to\\ &\ln(2)\arctan(3)-\int_\alpha^\beta\ln\left(\tan(\theta)-1\right)\,d\theta=\ln(2)\arctan(3)-\int_\alpha^\beta\ln\left(\sin(\theta)-\cos(\theta)\right)\,d\theta+\\ &+\int_\alpha^\beta\ln\left(\cos(\theta)\right)\,d\theta. \end{aligned} But $$\int_\alpha^\beta\ln\left(\sin(\theta)-\cos(\theta)\right)\,d\theta\to {\small{\begin{bmatrix}&\theta=s+3\pi/4&\\&d\theta=ds&\end{bmatrix}}} \to\int_{\alpha-3\pi/4}^{\beta-3\pi/4}\ln\left(\sqrt2\cos(s)\right)\,ds$$ so \begin{aligned}\int_1^2\frac{\arctan(x+1)}{x}\,dx&=\ln(2)\arctan(3)+\ln(\sqrt{2})(\alpha-\beta)\\ &\phantom{aaaaa}-\int_{\alpha-3\pi/4}^{\beta-3\pi/4}\ln\left(\cos(s)\right)\,ds+\int_\alpha^\beta\ln\left(\cos(s)\right)\,ds. \end{aligned} Here $$\alpha=\arctan(2)$$ and $$\beta=\arctan(3)$$.

The problem here is that I am not able to find a way to cancel the last two integrals on the RHS of the latter equality.

Using Mathematica 11.3 I found that the answers is $$\frac{3}{8} \pi \ln(2)\approx0.81659478386385079894.$$

In my equality, if we assume the integrals that involve cosines cancel, we have that the result of the integral is $$\frac{1}{2} \ln (2) \left(\arctan(2)-\arctan(3)\right)+\ln (2) \arctan(3)\approx 0.81659478386385079894$$.

Which are exactly equal up to $$20$$ decimal places! How would I go about canceling the integrals involving cosines (if they actually do cancel)?

• Hint: Show that $\alpha + \beta = 3\pi/4.$ At this point you can invoke the relation $\int_{a}^{b} f(x) = \int_a^b f(a+b - x)$ and then utilise some symmetries of the cosine. Also, a nice way to write $\ln(2) \arctan(3) + \ln(\sqrt{2}) (\alpha - \beta)$ is $\ln(2) \beta + \frac{\ln(2)}{2} (\alpha - \beta) = \frac{\ln(2)}{2} (\alpha + \beta),$ which yields the mathematica result directly. Nov 1 '18 at 3:19

### Related Integral

First, let me tackle another integral which will come in useful later:

$$J=\int_{\arctan 2}^{\arctan 3}\ln(\tan u-1)du$$

$$\tag 1=\int_{\frac{3\pi}4-\arctan 2}^{\frac{3\pi}4-\arctan 3}\ln\Biggl(\tan\left(\frac{3\pi}4-u\right)-1\Biggr)(-du)$$

$$\tag 2=-\int_{\arctan 3}^{\arctan 2}\ln\left(\frac{\tan \frac{3\pi}4-\tan u}{1+\tan\left(\frac{3\pi}4\right)\tan u}-1\right)du$$

$$\tag 3=\int_{\arctan 2}^{\arctan 3}\ln\left(\frac{-1-\tan u}{1-\tan u}-1\right)du$$

$$=\int_{\arctan 2}^{\arctan 3}\ln\left(\frac{-1-\tan u-(1-\tan u)}{1-\tan u}\right)du$$

$$=\int_{\arctan 2}^{\arctan 3}\ln\left(\frac{-2}{1-\tan u}\right)du$$

$$=\int_{\arctan 2}^{\arctan 3}\ln\left(\frac{2}{\tan u-1}\right)du$$

$$=\int_{\arctan 2}^{\arctan 3}\ln 2 - \ln(\tan u-1)du$$

$$\tag 4=\ln 2\int_{\arctan 2}^{\arctan 3}du-\int_{\arctan 2}^{\arctan 3}\ln(\tan u-1)du$$

$$=(\arctan 3-\arctan 2)\ln 2-J$$

$$\tag 5=(2\arctan 3-\frac{3\pi}4)\ln 2-J$$

$$\therefore2J=\left(2\arctan 3-\frac{3\pi}4\right)\ln 2$$

$$\boxed{J=\int_{\arctan 2}^{\arctan 3}\ln(\tan u-1)du=\arctan 3\ln 2 - \frac{3\pi\ln2}8}$$

### Main Integral

Now, onto the main integral:

$$I=\int_1^2 \frac{\arctan(x+1)}x dx$$

$$\tag 6=\int_2^3 \frac{\arctan x}{x-1}dx$$

$$\tag 7=\int_{\arctan 2}^{\arctan 3} \frac{u\sec^2u}{\tan u-1}du$$

$$\tag 8=[u\ln(\tan u-1)]_{\arctan 2}^{\arctan 3}-\int_{\arctan 2}^{\arctan 3}\ln(\tan u-1)du$$

$$=\arctan3\ln2-\int_{\arctan 2}^{\arctan 3}\ln(\tan u-1)du$$

$$=\arctan3\ln2-\left(\arctan 3\ln 2 - \frac{3\pi\ln2}8\right)$$

$$\boxed{I=\frac{3\pi\ln2}8}$$

### Elaboration

Elaboration for numbered equations:

(1) Substitute $$u\rightarrow\frac{3\pi}4-u, du\rightarrow -du$$

(2), (5) $$\arctan 2+\arctan 3=\frac{3\pi}4 \because\tan(\arctan 2+\arctan 3)=\frac{2+3}{1-2*3}=-1$$

(3) $$\tan\frac{3\pi}4=-1$$ and $$-\int_b^a=\int_a^b$$

(4) $$\ln\frac{a}b=\ln a-\ln b$$

(6) Substitute $$x\rightarrow x-1, dx\rightarrow dx$$

(7) Substitute $$x=\tan u -1, dx=\sec^2 udu$$

(8) Integration by parts

• Very nice! And formatting as well +1 Nov 5 '18 at 6:37

Although I am late to the party, I hope this solution will be helpful.$$I=\int_1^2 \frac{\arctan(\color{blue}{1+x})}{x}dx\overset{x=\frac{2}{t}}=\int_1^2 \frac{\arctan\left(\color{red}{1+\frac{2 }{t}}\right) } {\frac{2} {t}} \frac{2} {t^2} dt=\int_1^2 \frac{\arctan\left(\color{red}{1+\frac{2 }{t}}\right) } {t}dt$$ $$2 I=\int_1^2 \frac{\arctan(\color{blue}{1+t})+\arctan\left(\color{red}{1+\frac{2 }{t}}\right) } {t }dt$$

$$\because \, \arctan(\color{blue}{1+t})+\arctan\left(\color{red}{1+\frac{2 }{t}}\right)=\pi - \arctan(1)=\frac{3 \pi} {4}$$

$$\Rightarrow I=\frac{3 \pi} {8}\int_1^2 \frac{dt} {t} =\frac38 \pi \ln 2$$ His brother might also be of one's interest.

Generalization: By the same methods we have: $$\int_1^{1+a^2} \frac{\arctan(a+x)}{x}dx=\frac12 \left(\pi-\arctan\left(\frac{1}{a}\right)\right)\ln(1+a^2)$$ Which gives, for example: $$\int_1^4 \frac{\arctan(\sqrt 3 + x)}{x}dx=\frac{5\pi}{6}\ln 2$$

Just for the beauty of it, here is a way to evaluate the last integral in Yuriy's answer, namely: $$J=\int_0^1 \frac{\color{blue}{\ln(1+x)}}{x^2+4x+5}dx$$ Substituting $$\displaystyle{x=\frac{1-t}{1+t}\Rightarrow dx=-\frac{2}{(1+t)^2}dt},\,$$ and simplifying we get: $$J=\int_0^1 \frac{\color{red}{\ln\left(1+\frac{1-t}{1+t}\right)}}{\left(\frac{1-t}{1+t}\right)^2+4\left(\frac{1-t}{1+t}\right)+5}\frac{2}{(1+t)^2}dt=\int_0^1 \frac{\color{red}{\ln\left(\frac{2}{1+t}\right)}}{t^2+4t+5}dt$$ $$2J=\int_0^1 \frac{\color{red}{\ln 2 -\ln(1+x)}+\color{blue}{\ln(1+x)}}{x^2+4x+5}dx\Rightarrow J=\frac{\ln 2}{2}\int_0^1 \frac{dx}{x^2+4x+5}$$ $$J=\frac{\ln 2}{2} \arctan(x+2)\bigg|_0^1 =\frac{\ln2}{2} (\arctan 3 -\arctan 2)=\frac12 \ln 2 \operatorname{arccot}(7)$$ A more general form of this integral is found here.

• Thanks for salvaging my attempt! Dec 13 '18 at 12:25
• @Zacky Awesome... can it be generalized? :D Dec 18 '18 at 0:46

My attempt at another way of evaluating the integral:

$$\int_1^2\frac{\arctan(x+1)}{x}\,dx=\int_2^3 \frac{\arctan x}{x-1}dx=\int_2^3 \frac{dx}{x-1} \int_0^1 \frac{xdy}{1+x^2 y^2}=$$

$$= \int_2^3 \int_0^1 \frac{xdydx}{(x-1)(1+x^2 y^2)}=$$

$$t=\frac{y}{1-y}$$

$$y=\frac{t}{1+t}$$

$$dy=\left(\frac{1}{1+t}-\frac{t}{(1+t)^2} \right) dt=\frac{dt}{(1+t)^2}$$

$$\\ = \int_2^3 \int_0^\infty \frac{xdtdx}{(x-1)((1+t)^2+x^2 t^2)}=\int_2^3 \int_0^\infty \frac{xdtdx}{(x-1)(1+2t+(1+x^2) t^2)}$$

$$1+2t+(1+x^2) t^2=(1+x^2) \left(t^2+\frac{2}{1+x^2} t+\frac{1}{1+x^2} \right)= \\ = (1+x^2) \left(t+\frac{1}{1+x^2}\right)^2 +\frac{x^2}{1+x^2}$$

$$\int_0^\infty \frac{dt}{1+2t+(1+x^2) t^2}=\int_0^\infty \frac{dt}{(1+x^2) \left(t+\frac{1}{1+x^2}\right)^2 +\frac{x^2}{1+x^2}}= \\ =\frac{1+x^2}{x^2} \int_0^\infty \frac{dt}{\frac{(1+x^2)^2}{x^2} \left(t+\frac{1}{1+x^2}\right)^2 +1}=\frac{1}{x} \int_{1/x}^\infty \frac{dz}{z^2 +1}=\frac{1}{x} \left(\frac{\pi}{2}-\arctan \frac{1}{x} \right)$$

$$\int_2^3 \int_0^\infty \frac{xdtdx}{(x-1)(1+2t+(1+x^2) t^2)}=\frac{\pi}{2} \int_2^3 \frac{dx}{x-1}-\int_2^3 \frac{\arctan \frac{1}{x} dx}{x-1}=$$

$$=\frac{\pi}{2} \ln 2-\int_2^3 \frac{\arctan \frac{1}{x} dx}{x-1}$$

For $$x>1$$ we can use the series expansion:

$$\arctan \frac{1}{x}=\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)x^{2n+1}}$$

So we need to evaluate:

$$\int_2^3 \frac{dx}{x^{2n+1}(x-1)}=\int_{1/3}^{1/2} \frac{u^{2n}du}{(1-u)}= \sum_{k=0}^\infty \int_{1/3}^{1/2} u^{2n+k} du=\sum_{k=0}^\infty \frac{1}{2n+k+1} \left(\frac{1}{2^{2n+k+1}}-\frac{1}{3^{2n+k+1}} \right)$$

Kind of complicated, I don't see any simple way to prove:

$$\int_2^3 \frac{\arctan \frac{1}{x} dx}{x-1}=\sum_{k,n=0}^\infty \frac{(-1)^n}{(2n+1)(2n+k+1)}\left(\frac{1}{2^{2n+k+1}}-\frac{1}{3^{2n+k+1}} \right)=\frac{\pi}{8} \ln 2$$

Using integration by parts, we can transform the integral to: $$\arctan \frac{1}{3} \ln 2+\int_2^3 \frac{\ln (x-1)~dx}{1+x^2}$$

The latter integral can be transformed to:

$$\int_0^1 \frac{\ln(1+x) dx}{5+4x+x^2}=\int_0^1 \frac{\ln(1+x) dx}{(x+2+i)(x+2-i)}$$