12

How can I evaluate

$$\frac{1}{2}\int_0^\infty x^n \operatorname{sech}(x)\mathrm dx?$$

I was trying integration by parts but it seemed like it is getting more complicated. $$\int_0^\infty x^n \operatorname{sech}(x)\mathrm dx=\left.2x^n\arctan\left(\tanh(x/2)\right)\right|_0^\infty-2n\int_0^\infty x^{n-1}\arctan(\tanh(x/2))\mathrm dx$$ Herein, it seems like we have to apply integration by parts $n$ times but it is not practically possible.

This question is a more general problem of the integral $\int_0^\infty \frac{x}{e^x+e^{-x}}\mathrm dx$, which I was first solving. Let me know if there's any other method for evaluating this integral. It will be highly appreciated.

I have posted my solution employing a method using Geometric series to which this Wikipedia article helped me in finding the solution. Please see my answer below.

Quanto
  • 97,352
  • 5
    Is there anything wrong with this post? I can see a close vote here. Perhaps 'answer your own question' is controversial in practice as opposed to what was mentioned here. –  May 25 '21 at 05:58
  • 4
    Answering your question is fine. But I don't see the link between your question and your answer. Your answer should have proceeded with the approach given in question. – Paramanand Singh May 25 '21 at 09:11
  • 3
    Or perhaps you should indicate some alternative approach in the question which had some issue and you later resolved the issue and posted that as an answer. – Paramanand Singh May 25 '21 at 09:15
  • 1
    @ParamanandSingh One user commented - 'Still the question should have a context' - that's why I added this. This question cannot be solved by integration by parts or if it can, it is going to be extremely tough. –  May 25 '21 at 09:21
  • 1
    Yes context is important and it need not necessarily consist of an attempt. You should include details like the source of problem too. You have given one approach which you think has hit a dead end. Then you may try to describe your thought process which led to the final solution. – Paramanand Singh May 25 '21 at 09:23
  • Currently your answer seems to appear from out of the blue. – Paramanand Singh May 25 '21 at 09:24
  • 2
    Also adding context just for the sake of formality is not really the spirit here. If someone asks you for a context you need to honestly describe how you stumbled on the problem and what are your own ideas for a solution and perhaps you need to write in such a way that it motivates other users to think about the problem. – Paramanand Singh May 25 '21 at 09:28
  • 1
    I generated this problem on my own while solving another integral $\int_0^\infty \frac{x}{e^x-e^{-x}}$ with the help of This article. –  May 25 '21 at 09:28
  • I have edited the question adding the context yet the downvote! Could I know the reason? –  May 26 '21 at 02:00
  • 1
    I am not the downvoter, but I will try to discuss your question CURED chatroom. – Paramanand Singh May 26 '21 at 02:04
  • Perhaps I shouldn't ask this. One more close vote! If the context is bothering people, I have already added the context after discussion with @ParamanandSingh. –  May 26 '21 at 02:04
  • Please also raise your concern in constructive feedback. – Paramanand Singh May 26 '21 at 02:12
  • 1
    @NikhilKumarSingh I don't know if this has already been covered, but when you do formulate a self answered post, draw attention to the fact you are self-answering in the problem statement. Otherwise casual readers may not notice that it is happening. – rschwieb May 27 '21 at 14:13
  • @rschwieb I have mentioned - 'I have posted my solution employing ...' –  May 27 '21 at 14:15
  • 1
    @NikhilKumarSingh Yes it's there, but a little bit hidden in the paragraph further nested in a block. I mean that it'd be more obvious if the post just ended with "please see my attempted solution below." – rschwieb May 27 '21 at 14:21
  • @rschwieb Added! –  May 27 '21 at 14:23

3 Answers3

14

\begin{align}\mathcal{I}&=\frac{1}{2}\int_0^\infty \frac{x^n}{\cosh(x)}\mathrm dx\\&=\int_0^\infty \frac{x^n}{e^x+e^{-x}}\mathrm dx\\&=\int_0^\infty \frac{x^ne^{-x}}{1+e^{-2x}}\mathrm dx.\end{align}


Proposition: $$\int_0^\infty \frac{x^{s-1}e^{-x}}{1+e^{-2x}}\mathrm dx=\beta(s)\Gamma(s),$$ where $\beta(s)$ is the Dirichlet beta function defined as $\beta(s)=\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^s}$.

Proof:\begin{align}\int_0^\infty x^{s-1}\left(\frac{e^{-x}}{1-(-e^{-2x})}\right)\mathrm dx&=\int_0^\infty x^{s-1}\left(\sum_{k=0}^\infty (-1)^ke^{-(2k+1)x}\right)\mathrm dx \text{, using geometric series}\\&=\sum_{k=0}^\infty (-1)^k\int_0^\infty x^{s-1} e^{-(2k+1)x}\mathrm dx\\&=\sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)^s}\displaystyle\int_0^\infty x^{s-1}e^{-x}\mathrm dx\text{, substituting $(2k+1)x\mapsto x$}\\&=\beta(s)\Gamma(s). \end{align}


Therefore, $$\mathcal{I}=\beta(n+1)\Gamma(n+1).$$

We can evaluate for different values of $n\ge 0$. For $n=1$, $\frac{1}{2}\int_0^\infty x\operatorname{sech}(x)=\beta(2)\Gamma(2)=G$, where $G$ is Catalan's constant. For $n=2$, $\int_0^\infty x^2\operatorname{sech}(x)=2\beta(3)\Gamma(3)=\frac{\pi^3}{8}$

  • 3
    Why did you post your attempt as an answer rather in the main body of the OP? – Martin Ødegaard May 25 '21 at 05:33
  • 10
    @MartinØdegaard Refer here. –  May 25 '21 at 05:35
  • 1
    Do you just want to verify your solution? – VIVID May 25 '21 at 05:44
  • 2
    @VIVID I verified this by Wolfram Alpha. I posted this as 'answer your own question'. –  May 25 '21 at 05:47
  • 2
    Still the question itself should have a context, not be just a problem statement only. – metamorphy May 25 '21 at 06:54
  • @metamorphy I added context to the question. –  May 25 '21 at 07:03
  • 1
    For the one who believes that I have posted my attempt as answer then you are wrong. This is not attempt - This is an answer. –  May 26 '21 at 11:59
  • 5
    @meta, in my opinion, a self-answer obviates the need for context. – Gerry Myerson May 27 '21 at 02:18
  • 3
    Another opinion completely opposite to Gerry's one here – Arctic Char May 27 '21 at 02:54
  • 1
    @Arctic, I don't see it. That link addresses the question of usefulness, my remark addresses the question of context. Not the same thing. – Gerry Myerson May 27 '21 at 12:21
  • 4
    @ArcticChar I've never seen anyone dispute in meta that self-answers should not count toward context. That a self-answer is context-in-a-different-location is sort of a no-brainer. – rschwieb May 27 '21 at 14:11
  • 1
    Gerry's comment implies that no other context is needed for a self-answered question. This is different from what you said (which I agree). Whether this is sufficient was frequently discussed in meta (e.g. here) and the answer suggests that in general it is not sufficient. @rschwieb – Arctic Char May 28 '21 at 07:54
4

Alternatively

\begin{align} \frac{1}{2}\int_0^\infty \frac{x^n}{\cosh x}dx \overset{t=e^{-x}}=&\int_0^1 \frac{(-1)^n\ln^n t}{1+t^2}dt=n!\>\text{Im}\>\text{Li}_{n+1}(i) \end{align}

Quanto
  • 97,352
0

Letting $\tan \theta=e^{-x}$ transforms the integral into

$$ \int_0^{\infty} \frac{x^n}{e^x+e^{-x}}dx=(-1)^n \int_0^{\frac{\pi}{4}} \ln^n (\tan \theta) d \theta $$

By my post, $$\int_{0}^{\frac{\pi}{4}} \ln ^{n}(\tan \theta) d \theta =(-1)^{n} \beta(n+1) \Gamma(n+1)$$ Hence$$\boxed{\int_0^{\infty} \frac{x^n}{e^x+e^{-x}}= \beta(n+1) \Gamma(n+1)}$$

Lai
  • 20,421