2

I am solving the following integration problem. I got two results when I followed two different methods. But I know one is wrong, but I am not sure where my mistake is. I request someone to help me find the mistake.

$$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}$$


Solution 1: (Incorrect)

$$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}=\int \frac{{\mathrm d}x}{e^x(1+4e^{-2x})}=\int \frac{{e^{-x}\mathrm d}x}{(1+4e^{-2x})}=\int \frac{{e^{-x}\mathrm d}x}{1+\left (2e^{-x}\right )^2}$$ Substituting $u=2e^{-x}$, we obtain ${\mathrm d}u = -2e^{-x}{\mathrm d}x$, and hence we can write

$$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}=\int \frac{{e^{-x}\mathrm d}x}{1+\left (2e^{-x}\right )^2}=-\frac{1}{2}\int \frac{{-2e^{-x}\mathrm d}x}{1+\left (2e^{-x}\right )^2}=-\frac{1}{2}\int \frac{{\mathrm d}u}{1+u^2}=-\frac{1}{2}\tan^{-1}\left(u\right)+C$$ $$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}=-\frac{1}{2}\tan^{-1}\left(2e^{-x}\right)+C=-\frac{1}{2}\tan^{-1}\left(\frac{2}{e^{x}}\right)+C$$


Solution 2: (Correct)

$$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}=\int \frac{{\mathrm d}x}{4e^{-x}\left ( \frac{e^{2x}}{4}+1 \right )}=\frac{1}{4}\int \frac{e^{x}{\mathrm d}x}{ \frac{e^{2x}}{4}+1 }=\frac{1}{4}\int \frac{e^{x}{\mathrm d}x}{\left ( \frac{e^{x}}{2}\right )^2+1 }$$ Substituting $u=\frac{1}{2}e^{x}$, we obtain ${\mathrm d}u = \frac{1}{2}e^{x}{\mathrm d}x$, and hence we can write

$$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}=\frac{1}{4}\int \frac{e^{x}{\mathrm d}x}{\left ( \frac{e^{x}}{2}\right )^2+1 }=\frac{1}{2}\int \frac{{\left( \frac{e^{x}}{2} \right)\mathrm d}x}{\left ( \frac{e^{x}}{2}\right )^2+1}=\frac{1}{2}\int \frac{{\mathrm d}u}{u^2+1}=\frac{1}{2}\tan^{-1}\left(u\right)+C$$ $$\int \frac{{\mathrm d}x}{e^x+4e^{-x}}=\frac{1}{2}\tan^{-1}\left(\frac{e^{x}}{2}\right)+C$$

SKGadi
  • 141
  • 4
    Did you mean $\tan^{-1}$ in place of $\tan$? Trusting that you did, note that $\tan^{-1}(z)+\tan^{-1}\left(\frac 1z\right)$ is a constant. (well, it's singular at $z=0$, but constant on both half-lines). – lulu Jan 04 '22 at 16:23
  • 4
    @lulu In which case the two solutions are the same, because the variable parts differ only by a constant. – Robert Shore Jan 04 '22 at 16:25
  • @RobertShore Absolutely. – lulu Jan 04 '22 at 16:25
  • @lulu What about the negative sign? – SKGadi Jan 04 '22 at 16:29
  • 2
    What do you mean? Your two solutions differ by an additive constant, so both are correct. Note that you really want to stay in one half line or the other, to avoid the singularity. – lulu Jan 04 '22 at 16:30
  • @lulu, I understood now. Thank you. – SKGadi Jan 04 '22 at 16:32
  • @lulu, Yes it is $\tan^{-1}$. I updated it. – SKGadi Jan 04 '22 at 16:35
  • 2
    And, just to stress, $e^z>0$ for all real $z$, so the problem of the singularity does not arise in your original integral. – lulu Jan 04 '22 at 16:37
  • @lulu, Sure, Do you want to write the answer? So that I can mark it solved. – SKGadi Jan 04 '22 at 16:39
  • The following graph demonstrate @lulu 's argument

    https://www.desmos.com/calculator/qtq2d6bqhv

    – SKGadi Jan 04 '22 at 16:40
  • 2
    You did all the work. Feel free to write up the full answer yourself, I'll review it once it is posted. – lulu Jan 04 '22 at 16:46

1 Answers1

2

The assumption that one solution is incorrect is false. Both the solutions are correct.

From the comments to the question given by @lulu and @RobertShore makes it clear that exploiting the fact $\tan^{-1}x+\tan^{-1}\frac{1}{x}$ is a constant, we can conclude both solutions are correct.

Further, it is easy to visualize through the following plot showing both the solutions. First solution is blue, Second solution is Red. Graph showing both the solutions

SKGadi
  • 141