47

I need the method to evaluate this integral (the closed-form if possible). $$ \int_{0}^{\pi/2}\frac{1+\tanh x}{1+\tan x}\,dx $$ I used the relationship between $\tan x$ and $\tanh x$ but it didn't work. Any help?

C Squared
  • 3,679
E.H.E
  • 23,590
  • 3
    The numerical value is $1.137333875921470087298597734$. – Lucian Nov 02 '14 at 12:33
  • 1
    If you "used the relationship between $\tan x$ and $\tanh x$", you should include the details in your post. That will help to inform suitable Answers. – hardmath Nov 02 '14 at 20:05
  • 9
    $$ \int_{0}^{\pi/2}{{\rm d} x \over 1 + \tan\left(, x,\right)} ={\pi \over 4} $$ So, you can avoid the $1$ in the numerator. – Felix Marin Nov 07 '14 at 19:58
  • 14
    $\dfrac\pi2$ is a meaningless argument to pass to the $\tanh$ function, so I don't expect the integral to have a closed form. – Lucian Nov 10 '14 at 01:00
  • @Lucian I don't follow. Why should the particular value of $\tanh$ at $\pi/2$ affect anything here? – epimorphic Nov 11 '14 at 22:32
  • @epimorphic: Speaking from my own experience, $($and it's just a simple heuristic, not a theorem or anything$)$, this kind of definite integrals, whose anti-derivative cannot be expressed in terms of elementary functions, seem only then to possess a closed form themselves, when the limits of integration are “meaningful” to the integrand. In this case, $\tanh\dfrac\pi2$ is a “meaningless” quantity. $($If we could at least get rid of it, but we cannot: the integrand is as simple as can be$)\ldots$ – Lucian Nov 11 '14 at 22:53
  • Perhaps we might have better luck if the upper limit were $\infty$ instead of $\dfrac\pi2$, but computing the principal value of an integral with quite literally an infinite number of poles looks rather daunting, to say the least. – Lucian Nov 11 '14 at 22:53
  • @Lucian Is the integral even finite frmo $0$ up to $3\pi/4$ ? –  Nov 12 '14 at 10:44
  • @Raphael: No. But divergence over $(0,3\pi/4)$ does not necessarily imply the divergence of its principal value over $(0,\infty)$. – Lucian Nov 12 '14 at 11:06
  • 2
    For large $x$ we have that $\tanh(x) \approx 1$ so the integral will be close to that of $2/(1+\tan(x))$. If we integrate from one zero of $\tan(x)$ to the next one we pass through a pole. The principal value will be $\pi$. Therefore, if we look at the P.V. of the original integral from 0 to $\infty$ we get a divergent integral, with or without the 1 in the numerator. – Alexander Vlasev Nov 13 '14 at 08:37
  • As Felix Martin said, $\int_{0}^{\pi/2}{{\rm d} x \over 1 + \tan\left(, x,\right)} ={\pi \over 4}$. So we can divide the numerator of $\int_{0}^{\pi/2}\frac{1+\tanh x}{1+\tan x},dx$ into $\int_{0}^{\pi/2}\frac{1}{1+\tan x},dx$ + $\int_{0}^{\pi/2}\frac{\tanh x}{1+\tan x},dx$. The indefinite integral of the left integral is $\frac{x}{2}+\frac{1}{2}\ln(\sin x+\cos x)$) which when evaluated is $\frac\pi4$ and see this link for the indefinite integral of the right and then plug away: http://www.wolframalpha.com/input/?i=integrate%20by%20parts%20%28tanh%28x%29%29%2F%281%2Btan%28x%29%29&lk=2 – Gabriel Dec 26 '14 at 21:06
  • 20
    As usual, it seems the best way to get votes for a question on MSE is to ask for a closed form solution to a difficult integral. – SDiv Jan 13 '15 at 09:10

3 Answers3

5

$$I=\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$$

$$I_1=\int_0^{\pi/2}\frac{\tanh(x)}{1+\tan(x)}dx$$


$$\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: $$I_1=\frac{\pi}{4}-2\int_0^{\pi/2}\frac{1}{1+\tan(x)}\frac{e^{-x}}{e^x+e^{-x}}dx$$ $$I_2=\int_0^{\pi/2}\frac{1}{1+\tan(x)}\frac{e^{-x}}{e^x+e^{-x}}dx$$


$$\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: $$I_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 $0$ to $\pi/4$ I think. I will say that as $n$ 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}\le\frac{e^{-2(n+1)x}}{1+\tan(x)}\le e^{-2.4(n+1)x}$$ so if: $$J(a)=\int_0^{\pi/2}e^{-ax}dx=\frac{1-e^{-a\pi/2}}{a}$$ so we have: $$\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=\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: $$\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: $$\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(\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(\alpha)=\alpha-\ln(e^\alpha-1)$$ $$\frac{S(\alpha)}{\alpha}=1-\frac{\ln(e^\alpha-1)}{\alpha}$$

Henry Lee
  • 12,554
1

Starting from @Henry Lee's answer $$I_2=\sum_{n=0}^\infty(-1)^n\int_0^{\pi/2}\frac{e^{-2(n+1)x}}{1+\tan(x)}\,dx$$ Using Euler representation of trigonometric functions and hypergeometric functions

$$J_n=\int\frac{e^{-2(n+1)x}}{1+\tan(x)}\,dx$$ $$J_n=\frac{e^{-2 (n+1) x}}{4 (n+1)}\Bigg(2 i \, _2F_1\left(1,i (n+1);i (n+1)+1;i e^{2 i x}\right) -(1+i) \Bigg)$$ gives the definite integral $$K_n=\int_0^{\frac \pi 2}\frac{e^{-2(n+1)x}}{1+\tan(x)}\,dx$$ Asymptotically $$\frac {K_{n+1}}{K_n} \sim 1-\frac{1}{n}+\frac{3}{2 n^2}-\frac{3}{4 n^3}+O\left(\frac{1}{n^4}\right) \tag 1$$ The convergence is quite slow (because of $(1)$).

Using acceleration $$I_2=\color{red}{0.216731}37$$ and then the result using $$I=\frac \pi 2-2I_2$$

0

Considera la Serie de Fourier de $$\frac1{1+\tan x}$$ en $$(0,\pi/2)$$ en armónicos pares

$$ \frac1{1+\tan x} = \sum_{n=0}^\infty A_n\cos(2n x) + B_n\sin(2n x), $$

con

$$ A_0=\tfrac12, \quad A_n=\frac{(-1)^n}{4n^2-1}, \quad B_n=-\frac{2n(-1)^n}{4n^2-1}, \quad n\ge1. $$

Entonces haz integración término a término

$$ \int_0^{\pi/2}(1+\tanh x)\sum_{n=0}^\infty\bigl(A_n\cos(2n x)+B_n\sin(2n x)\bigr)\,dx = \sum_{n=0}^\infty \int_0^{\pi/2}(1+\tanh x)\bigl(A_n\cos(2n x)+B_n\sin(2n x)\bigr)\,dx $$

con resultado final

$$ \boxed{ \frac{\pi}{4} + \sum_{n=1}^{\infty} \frac{(-1)^n}{4n^2-1} \Bigl[ \frac{1-(-1)^n}{2n} + \frac{i}{2}\bigl(\psi(\tfrac12+in)-\psi(\tfrac12-in)\bigr) - \frac{n\,[1-(-1)^n]}{2n(4n^2-1)} - \tfrac12\bigl(\psi(in+\tfrac12)-\psi(-in+\tfrac12)\bigr) \Bigr] }. $$

$$ \psi(z)=\frac{d}{dz}\ln\bigl(\Gamma(z)\bigr)=\frac{\Gamma'(z)}{\Gamma(z)} $$

donde $$\Gamma(z)$$ es la función Gamma de Euler.

Nota sobre convergencia

La serie

$$ \sum_{n=1}^\infty\bigl(A_n\cos(2n x)+B_n\sin(2n x)\bigr) $$

en $$[0,\tfrac{\pi}{2}]$$ converge absolutamente y uniformemente porque

$$ \bigl|A_n\cos(2n x)+B_n\sin(2n x)\bigr|\le |A_n|+|B_n|=\mathcal{O}(n^{-2}), $$

y $$\sum_{n=1}^\infty n^{-2}$$ es convergente. Por el criterio de Weierstrass se intercambia suma e integral.

Valor numérico de la suma infinita

La integral completa converge numéricamente a aproximadamente

$$ 1.137334 $$