# Evaluate ∫π/201+tanhx1+tanxdx \int_{0}^{\pi/2}\frac{1+\tanh x}{1+\tan x}dx

I need the method to evaluate this integral (the closed-form if possible).

I used the relationship between $\tan x$ and $\tanh x$ but it didn’t work. Any help?

$$I=∫π/201+tanh(x)1+tan(x)dx=π4+∫π/20tanh(x)1+tan(x)dxI=\int_0^{\pi/2}\frac{1+\tanh(x)}{1+\tan(x)}dx=\frac\pi 4+\int_0^{\pi/2}\frac{\tanh(x)}{1+\tan(x)}dx$$

$$I1=∫π/20tanh(x)1+tan(x)dxI_1=\int_0^{\pi/2}\frac{\tanh(x)}{1+\tan(x)}dx$$

$$tanh(x)=sinh(x)cosh(x)=ex−e−xex+e−x=1−2e−xex+e−x\tanh(x)=\frac{\sinh(x)}{\cosh(x)}=\frac{e^x-e^{-x}}{e^x+e^{-x}}=1-2\frac{e^{-x}}{e^x+e^{-x}}$$
so:
$$I1=π4−2∫π/2011+tan(x)e−xex+e−xdxI_1=\frac{\pi}{4}-2\int_0^{\pi/2}\frac{1}{1+\tan(x)}\frac{e^{-x}}{e^x+e^{-x}}dx$$
$$I2=∫π/2011+tan(x)e−xex+e−xdxI_2=\int_0^{\pi/2}\frac{1}{1+\tan(x)}\frac{e^{-x}}{e^x+e^{-x}}dx$$

$$e−xex+e−x=e−2x1−(−e−2x)=e−2x∞∑n=0(−1)ne−2nx=∞∑n=0(−1)ne−2(n+1)x\frac{e^{-x}}{e^x+e^{-x}}=\frac{e^{-2x}}{1-(-e^{-2x})}=e^{-2x}\sum_{n=0}^\infty(-1)^ne^{-2nx}=\sum_{n=0}^\infty(-1)^ne^{-2(n+1)x}$$
and so:
$$I2=∫π/2011+tan(x)∞∑n=0(−1)ne−2(n+1)xdx=∞∑n=0(−1)n∫π/20e−2(n+1)x1+tan(x)dxI_2=\int_0^{\pi/2}\frac{1}{1+\tan(x)}\sum_{n=0}^\infty(-1)^ne^{-2(n+1)x}dx=\sum_{n=0}^\infty(-1)^n\int_0^{\pi/2}\frac{e^{-2(n+1)x}}{1+\tan(x)}dx$$
as for this integral its quite messy and I’m not sure what to do from here, It would be easier for $$00$$ to $$π/4\pi/4$$ I think. I will say that as $$nn$$ increases the terms get smaller very quickly so an approximation of the first few would be quite accurate if possible.

One possible way I have noticed is that:
$$e−2.5(n+1)x≤e−2(n+1)x1+tan(x)≤e−2.4(n+1)xe^{-2.5(n+1)x}\le\frac{e^{-2(n+1)x}}{1+\tan(x)}\le e^{-2.4(n+1)x}$$
so if:
$$J(a)=∫π/20e−axdx=1−e−aπ/2aJ(a)=\int_0^{\pi/2}e^{-ax}dx=\frac{1-e^{-a\pi/2}}{a}$$
so we have:
$$∞∑n=0(−1)n1−e−2.5(n+1)π/22.5(n+1)≤I2≤∞∑n=0(−1)n1−e−2.4(n+1)π/22.4(n+1)\sum_{n=0}^\infty(-1)^n\frac{1-e^{-2.5(n+1)\pi/2}}{2.5(n+1)}\le I_2\le \sum_{n=0}^\infty(-1)^n\frac{1-e^{-2.4(n+1)\pi/2}}{2.4(n+1)}$$
and according to wolfram alpha these sums converge and arent too ugly, and we know that:
$$I=π/2−2I2I=\pi/2-2I_2$$
thats the best I can do at the moment I’ll take another look sometime. It is also worth noting that:
$$∞∑n=0(−1)nn+1=ln(2)\sum_{n=0}^\infty\frac{(-1)^n}{n+1}=\ln(2)$$
and the second part of the sum could be expanded into a double summation

Back to add a little to this answer, so far we know:
$$ln22.5+12.5∞∑n=11ne−2.5nπ/2≤I2≤ln22.4+12.4∞∑n=11ne−2.4nπ/2\frac{\ln2}{2.5}+\frac 1 {2.5}\sum_{n=1}^\infty \frac 1ne^{-2.5n\pi/2}\le I_2\le \frac{\ln2}{2.4}+\frac 1 {2.4}\sum_{n=1}^\infty \frac 1ne^{-2.4n\pi/2}$$
we will try and focus on sums of the form:
$$S(α)=∞∑n=1exp(−αn)n=−ln(e−α(eα−1))S(\alpha)=\sum_{n=1}^\infty\frac{\exp(-\alpha n)}{n}=-\ln(e^{-\alpha}(e^\alpha-1))$$
according to wolfram alpha, which we are able to simplify to:
$$S(α)=α−ln(eα−1)S(\alpha)=\alpha-\ln(e^\alpha-1)$$
$$S(α)α=1−ln(eα−1)α\frac{S(\alpha)}{\alpha}=1-\frac{\ln(e^\alpha-1)}{\alpha}$$