4
$\begingroup$

This question has been puzzling me for a bit and I'd like an explanation for what I'm doing wrong as my answer doesn't coincide with the correct one.

Let's say we're asked to find:

$$\int \frac{e^{x}}{e^{2x}+1}\mathrm{d}x$$

The way I chose to solve this was factor out an $e^{2x}$ from the denominator and work my way from there. So what I get is:

$$\int \frac{e^{x}}{e^{2x}(1+1/e^{2x})}dx$$

This could be rewritten as:

$$\int \frac{1}{e^{x}(1+(1/e^{x})^2)}dx$$

If we let:

$$u = \frac{1}{e^x}$$ $$du = -e^{-x} dx$$ $$dx = -e^xdu$$

So, now we're at:

$$\int \frac{1}{e^{x}(1+u^2)}(-e^x)du$$

Cancelling out the $e^x$ and removing the minus sign outside of the integral gives us:

$$-\int \frac{1}{1+u^2}du$$

This leaves us with:

$$-\int \frac{1}{1+u^2}du = -\tan^{-1}(\frac{1}{e^x})+c$$

However, I know the answer is wrong because the correct one is $\tan^{-1}(e^x) + c$. Can someone please tell me where I screwed up? Many thanks in advance!

$\endgroup$
  • 9
    $\begingroup$ You didn't screw up. Note that for $x>0$, $\arctan x+\arctan 1/x=\pi/2$. $\endgroup$ – Jean-Claude Arbaut Apr 28 at 19:18
  • 1
    $\begingroup$ why not substituting $u=e^x$ directly from the beginning ? $\endgroup$ – zwim Apr 28 at 19:23
  • 1
    $\begingroup$ It should jump out at you that you have $\int \frac{d(e^x)}{(e^x)^2 + 1}$ $\endgroup$ – MPW Apr 28 at 19:25
5
$\begingroup$

As Jean-Claude Arbaut said, you didn't screw up. We have the identity $$\tan^{-1}(\frac{1}{y})=\frac{\pi}{2}-\tan^{-1}(y).$$ So it follows that $$ -\tan^{-1}(1/e^x)=\tan^{-1}(e^x)-\pi/2=\tan^{-1}(e^x)+c. $$

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ So what @Jean-Claude Arbaut and yourself are saying is that both answers are acceptable based on the above identity? Are we assuming the c is -pi/2 here? I'm sorry if this a really dumb question, but I'm very rusty with integrals at the moment. $\endgroup$ – in123321 Apr 28 at 19:43
  • 3
    $\begingroup$ @in123321 It's not uncommon to have two expressions (or more) for the same primitive, which (necessarily) differ only by a constant: $\int f(x)dx=F_1(x)+C=F_2(x)+C'$. Of course, it's not the same constant $C$. Both $F_1$ and $F_2$ are correct, and neither is "better". $\endgroup$ – Jean-Claude Arbaut Apr 28 at 19:45
  • $\begingroup$ Excellent, that cleared it up. Thanks @Jean-Claude Arbaut and everyone else who answered. $\endgroup$ – in123321 Apr 28 at 19:51
  • $\begingroup$ @in123321 By the way, there is another simple expression for your primitive: $\arctan(\tanh(x/2))$. $\endgroup$ – Jean-Claude Arbaut Apr 28 at 19:57
2
$\begingroup$

You have been messing a little with the signs. $$\int\frac{e^x\,dx}{e^{2x}+1}=\int\frac{d(e^x)}{(e^x)^2+1}=\arctan(e^x)+c.$$

| cite | improve this answer | |
$\endgroup$
2
$\begingroup$

If we directly take $e^x=t$ right at the beginning, we get: $$\int \frac{e^x}{e^{2x}+1} \mathrm{d}x$$ $$=\int \frac{\mathrm{d}t}{t^2+1}$$ $$=\tan^{-1}t+ \mathrm{C}$$ $$=\tan^{-1}(e^x)+\mathrm{C}$$

| cite | improve this answer | |
$\endgroup$
2
$\begingroup$

Your answer is right .. Here is a easier approach

$$e^x=\tan z$$ $$\int \frac{e^{x}}{e^{2x}+1}dx$$ $$\int \frac{\sec^2 z}{\tan^2 z+1}dz$$ $$=z+c=\tan^{-1}e^x+c$$

| cite | improve this answer | |
$\endgroup$
  • 2
    $\begingroup$ I think you wanted to write $\tan^{-1}(e^x)$ at the end. $\endgroup$ – Botond Apr 28 at 19:48
0
$\begingroup$

One of the best thing you can do with indefinite integrals is take the derivative of your result and check if it is the integrand function: $$\frac{\text{d}}{\text{d}x} \left[-\arctan \left (\frac{1}{e^x}\right)+c\right]=\frac{\text{d}}{\text{d}x} \left[-\arctan \left (e^{-x}\right)+c\right]=-\frac{1}{1+e^{-2x}}({-e^{-x}})=\frac{e^{-x}}{1+e^{-2x}}=$$ $$=\frac{\frac{1}{e^x}}{1+\frac{1}{e^{2x}}}=\frac{\frac{1}{e^x}}{\frac{e^{2x}+1}{e^{2x}}}=\frac{1}{\frac{e^{2x}+1}{\frac{1}{e^x}}}=\frac{e^{x}}{e^{2x}+1}$$ So your result is absolutely correct, no matter what (except for calculation mistakes).

Of course it is not always this simple, maybe you'll need some identities to have back the integrand function; but this is for sure better than thinking you're wrong without checking.

| cite | improve this answer | |
$\endgroup$

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.