How to integrate $\int_{0}^{t}{\frac{\cos u}{\cosh^2 u}du}$?

110 Views Asked by At

How to integrate $\int_{0}^{t}{\frac{\cos u}{\cosh^2 u}du}$?

I'm trying to use the integration by parts but it's impossible...

Is there an other way?

2

There are 2 best solutions below

2
On

If you are just interested in the limit as $t\to +\infty$ (namely $\frac{\pi}{2\sinh\frac{\pi}{2}}$), there are better ways (namely the Fourier transform), but you may notice that $$\begin{eqnarray*}\int_{0}^{t}\frac{\cos u}{\cosh^2 u}\,du&=&\left[\cos(u)\tanh(u)\right]_{0}^{t}+\int_{0}^{t}\tanh(u)\sin(u)\,du\\&=&\cos(t)\tanh(t)+\cos(t)-1+2\int_{0}^{t}\frac{\sin(u)}{1+e^{-2u}}\,du\\&=&-1+\frac{2\cos(t)}{1+e^{-2t}}+2\,\text{Im}\sum_{n\geq 0}(-1)^n\int_{0}^{t}e^{iu-2nu}\,du\\&=&-1+\frac{2\cos(t)}{1+e^{-2t}}+2\sum_{n\geq 0}(-1)^n\frac{1-e^{-2nt}\cos(t)-2ne^{-2nt}\sin(t)}{4n^2+1}\\&=&\frac{\pi}{2\sinh\frac{\pi}{2}}+\frac{2\cos(t)}{1+e^{-2t}}-2\sum_{n\geq 0}(-1)^n e^{-2nt}\frac{\cos(t)+2n\sin(t)}{4n^2+1}.\end{eqnarray*} $$

0
On

If you are concerned by "small" values of $t$, Taylor expansion could be quite good if you are not requiring too much accuracy $$\frac{\cos (u)}{\cosh^2 (u)}=1-\frac{3 }{2}u^2+\frac{29 }{24}u^4-\frac{181 }{240}u^6+\frac{16729 }{40320} u^8-\frac{257161 }{1209600}u^{10}+O\left(u^{12}\right)$$

Integrating from $0$ to $1$, this would lead to $\frac{26373107}{39916800}\approx 0.660702$ while numerical integration would give $\approx 0.666376$

Better could be a Padé approximation $$\frac{\cos (u)}{\cosh^2 (u)}=\frac{1-\frac{127 }{145}u^2+\frac{947 }{3480}u^4}{1+\frac{181}{290} u^2 }=-\frac{413159}{196566}+\frac{947 u^2}{2172}+\frac{88410125}{98283 \left(181 u^2+290\right)}$$ leading to $$\int_0^t\frac{\cos (u)}{\cosh^2 (u)}\,du=-\frac{413159 }{196566}t+\frac{947 }{6516}t^3+\frac{609725 }{98283}\sqrt{\frac{145}{362}}\tan ^{-1}\left(\sqrt{\frac{181}{290}} t\right)$$ which would give, for $t=1$, $\approx 0.668697$.

Edit

For the range $0\leq t\leq 1$, we can do much better using a nonlinear regression to model $$\frac{\cos (u)}{\cosh^2 (u)}=\frac{1+a u^2+b u^4}{1+c u^2 }$$ and rationalize the coefficients. This would lead to $$a=-\frac{3091}{3873}\qquad b=\frac{1694}{9109}\qquad c=\frac{4279}{6059}$$ and $$\int_0^t \frac{1+a u^2+b u^4}{1+c u^2 } \ du=\frac{ (a c-b)}{c^2}t+\frac{b }{3 c}t^3+\frac{(c (c-a)+b) }{c^{5/2}}\tan ^{-1}\left(\sqrt{c} t\right)$$ would give, for $t=1$, $\approx 0.666354$.