1

I am trying to compute by hand this integral:

$$ \int_{-\infty}^{\infty} \operatorname{sech}(x) \tanh(x)\cos(x+x_0) \,\mathrm dx =\int_{-\infty}^{\infty} \frac{\cos (x+x_0)}{\cosh x} \,\mathrm dx \\ =\int_{-\infty}^{\infty} \frac{e^{ix_0}\ e^{ix}+e^{-ix_0}\ e^{-ix}} {e^{x}+e^{-x}} \,\mathrm dx =\int_{-\infty}^{\infty} \frac{e^{ix_0}\ e^{(1+i)x}+e^{-ix_0}\ e^{(1-i)x}} {e^{2x}+1} \,\mathrm dx $$
Then we subsitute $t=\ e^{2x} ,\mathrm dx=\frac{1}{2t}\,\mathrm dt$ so we get:

$$=\frac{1}{2}\int_{0}^{\infty} \frac{e^{ix_0}\ t^{1/2(1+i)}+e^{-ix_0}\ t^{1/2(1-i)}}{t+1}\ x^{-1} \,\mathrm dt \\ =\frac{1}{2}\int_{0}^{\infty}\frac{e^{ix_0}\ t^{1/2(-1+i)}}{t+1}\,\mathrm dt\,+ \frac{1}{2}\int_{0}^{\infty}\frac{e^{-ix_0}\ t^{1/2(-1-i)}}{t+1}\,\mathrm dt $$

It's true that: $\int_{0}^{\infty}\frac{x^n}{x+1}\,\mathrm dx= \frac{-\pi}{\sin(n\pi)}$, so our integral is:

$$=\frac{1}{2}\left[e^{ix_0}\ \frac{-\pi}{\sin (-\frac{\pi}{2}\, +i\ \frac{\pi}{2})}\,+e^{-ix_0}\ \frac{-\pi}{\sin (-\frac{\pi}{2}\, -i\ \frac{\pi}{2})}\right]\\ =\frac{\pi}{2\cosh(\frac{\pi}{2})}(e^{ix_0}+e^{-ix_0})\\ =\pi \operatorname{sech}(\pi /2)\cos x_0$$

However, in bibliography I find it equal to

$$-\pi \operatorname{sech}(\pi /2)\sin(x_0).$$

What am I doing wrong?.

Thanks in advance.

Frank W
  • 5,897
  • 3
    It's hard to see if you made a mistake or where you make it if you don't show your calculations... – jjagmath Jul 06 '22 at 21:21
  • Welcome to math.SE: since you are new, I wanted to let you know a few things about the site. In order to get the best possible answers, it is helpful if you say in what context you encountered the problem, and what your thoughts on it are; this will prevent people from telling you things you already know, and help them give their answers at the right level. Please take moment to give this posting a read to learn how to ask a good question. – Sangchul Lee Jul 06 '22 at 21:34
  • $$\int_{-\infty}^{\infty}\operatorname{sech}(x)\tanh(x)\cos(x+x_0),dx =-\pi\sin x_0 \text{sech}\frac\pi2$$ – Quanto Jul 06 '22 at 22:01
  • 1
    @Quanto, would you be kind enough to sketch a derivation? I’m guessing a clever contour. – A rural reader Jul 07 '22 at 00:26
  • @Aruralreader See https://math.stackexchange.com/a/4243247/686284 – Quanto Jul 07 '22 at 20:16

1 Answers1

4

$\newcommand{\sech}{\operatorname{sech}}$Use integration by parts with $u=\cos(x+x_0)$ and $v=-\sech x$ to get

$$\int\limits_{-\infty}^{+\infty}\sech x\tanh x\cos(x+x_0)\,\mathrm dx=-\int\limits_{-\infty}^{+\infty}\frac {\sin(x+x_0)}{\cosh x}\,\mathrm dx$$

Next, use the expansion of $\sin(x+x_0)$ to rewrite the integral as

$$\int\limits_{-\infty}^{+\infty}\frac {\sin x\cos x_0+\sin x_0\cos x}{\cosh x}\,\mathrm dx=\cos x_0\int\limits_{-\infty}^{+\infty}\frac {\sin x}{\cosh x}\,\mathrm dx+\sin x_0\int\limits_{-\infty}^{+\infty}\frac {\cos x}{\cosh x}\,\mathrm dx$$

The first integral contains an odd function since $\cosh(-x)=\cosh x$ and $\sin(-x)=-\sin x$. Hence, the first integral vanishes leaving behind only the second integral. Using the definition of $\cosh x$, rewrite the integrand as an infinite sequence and term-wise integrate

$$\begin{align*}\int\limits_{-\infty}^{+\infty}\frac {\cos x}{\cosh x}\,\mathrm dx & =4\sum\limits_{n=0}^{+\infty}(-1)^n\int\limits_0^{+\infty} e^{-x(2n+1)}\cos x\,\mathrm dx\\ & =4\sum\limits_{n=0}^{+\infty}(-1)^n\frac {2n+1}{1+(2n+1)^2}\\ & =\pi\sech\left(\frac {\pi}2\right)\end{align*}$$

Thus

$$\int\limits_{-\infty}^{+\infty}\sech x\tanh x\cos(x+x_0)\,\mathrm dx=-\pi\sin x_0\sech\left(\frac {\pi}2\right)$$


There exists an elegant proof of the result

$$\sum\limits_{n=0}^{+\infty}(-1)^n\frac {2n+1}{1+(2n+1)^2}=\frac {\pi}4\sech\left(\frac {\pi}2\right)$$

That I found a while back - I'll try to see if I can figure out where I found it from. Use partial fraction decomposition to expand the sum into two separate components and employ the infamous identity

$$\sum\limits_{n=-\infty}^{+\infty}\frac {(-1)^n}{a+n}=\pi\csc\pi a$$

To get

$$\begin{align*}\sum\limits_{n=0}^{+\infty}(-1)^n\frac {2n+1}{1+(2n+1)^2} & =\frac 12\sum\limits_{n=0}^{+\infty}(-1)^n\left(\frac 1{2n+1+i}-\frac 1{-2n-1+i}\right)\\ & =\frac 14\sum\limits_{n=0}^{+\infty}\frac {(-1)^n}{n+(1+i)/2}+\frac 14\sum\limits_{n=-\infty}^{-1}\frac {(-1)^n}{n+(1+i)/2}\\ & =\frac 14\sum\limits_{n=-\infty}^{+\infty}\frac {(-1)^n}{n+(1+i)/2}\\ & =\frac {\pi}4\csc\left(\frac {\pi(1+i)}2\right)\\ & =\frac {\pi}4\sech\left(\frac {\pi}2\right)\end{align*}$$

Frank W
  • 5,897
  • Which identity tells you $\sum_{n\ge0}\frac{(-1)^n(2n+1)}{1+(2n+1)^2}=\frac{\pi}{4}\operatorname{sech}\frac{\pi}{2}$? – J.G. Jul 07 '22 at 10:22
  • I modified the question. What's wrong with my evaluation? – xristos geo Jul 07 '22 at 17:51
  • @J.G. Added proof – Frank W Jul 07 '22 at 20:07
  • @xristosgeo I might be dense, but how did you arrive at$$\int\limits_{-\infty}^{+\infty}\operatorname{sech}x\tanh x\cos(x+x_0),\mathrm dx=\int\limits_{-\infty}^{+\infty}\frac {\sinh x \cos(x+x_0)}{\cosh^2 x},\mathrm dx=\int\limits_{-\infty}^{+\infty}\frac {\cos(x+x_0)}{\cosh x},\mathrm dx$$ – Frank W Jul 07 '22 at 20:07
  • @Frank W Sorry, just a silly mistake. You're right. – xristos geo Jul 08 '22 at 13:59