$$\begin{equation} \begin{split} \int\frac{2dx}{e^x+e^{-x}} & = \int\frac{2e^{-x}dx}{1+e^{-2x}} \\ &= \int 2e^{-x} \sum_{k=0}^{\infty}(-1)^ke^{-2kx}\,dx \\ &= 2\sum_{k=0}^{\infty}(-1)^k\int e^{-x(2k+1)}\,dx +c\\ &= -2\sum_{k=0}^{\infty}(-1)^k\frac{ e^{-x(2k+1)}}{(2k+1)}+c \end{split} \end{equation} $$ Note that $\displaystyle \arctan(x)=\sum_{k=0}^{\infty}(-1)^k \frac{x^{2k+1}}{2k+1}$, giving $$\begin{equation} \begin{split} \int\frac{2\,dx}{e^x+e^{-x}} & = -2\arctan(e^{-x})+c \end{split} \end{equation} $$ Wolfram says this integral is $\displaystyle\arctan\left(\tanh(\frac{x}{2})\right)$$\displaystyle=\arctan \left(\frac{1-e^{-x}}{1+e^{-x}}\right)=\arctan(1)+\arctan(-e^{-x})=\frac{\pi}{4}+\arctan(e^x)$

So, is $\displaystyle -2\arctan(e^{-x})=k+\arctan(e^x)$ (if so, why?), or did I do something incorrectly? Normally I'd defer the mistake (if there is one) to my neglect for convergence, but the results are so alike that I think my method must be fundamentally correct.

  • $\begingroup$ That you have a correct answer cannot be an issue, since differentiating $-2\arctan(e^{-x})$ gives you the right thing. $\endgroup$ – André Nicolas Jul 28 '13 at 14:02
  • $\begingroup$ @AndréNicolas Yes, it boiled down to a algebraic error in the end. $\endgroup$ – Meow Jul 28 '13 at 14:03

You made two mistakes:

1/ Wolframalpha gives a factor $2$ that you missed.

2/ And this is the correct version of the difference of $\arctan$'s

$$\arctan \left(\frac{1-e^{-x}}{1+e^{-x}}\right)=\arctan(1)-\arctan(e^{-x})$$

  • $\begingroup$ The second was a typo, sorry. Yes, that helps. $\endgroup$ – Meow Jul 28 '13 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.