Integration using substitution

physics604
Messages
92
Reaction score
2
1. $$\int \frac{1}{1+e^x}\,dx$$

Homework Equations



Substitution

The Attempt at a Solution



$$u=1+e^x$$ $$du=e^xdx$$
$$\int \frac{1}{u}\frac{1}{e^x}\,du$$ $$\int \frac{1}{u}\frac{1}{u-1}\,du$$ $$\int \frac{1}{u(u-1)}\,du$$
$$= \ln {|u^2-u|} = \ln {|(1+e^x)-(1+e^x)|} = \ln {|1+2e^x+e^{2x}-1-e^x|} = \ln {|e^2|}$$

There is something obviously wrong with my answer but I don't know what. The answer key says $$x-\ln {(1+e^x)}+C$$ Any help is greatly appreciated!
 
Physics news on Phys.org
physics604 said:
$$u=1+e^x$$ $$du=e^xdx$$
$$\int \frac{1}{u}\frac{1}{e^x}\,du$$ $$\int \frac{1}{u}\frac{1}{u-1}\,du$$ $$\int \frac{1}{u(u-1)}\,du$$
$$= \ln {|u^2-u|} $$

The item in red is wrong .

Write 1/u(u-1) = 1/(u-1) - 1/u .
 
To expand on what Tanya Sharma said,
$$\int \frac{dx}{f(x)} \neq ln|f(x)| + C$$
unless f(x) just happens to be x.
 
Mark44 said:
unless f(x) just happens to be x.

or, to be more precise f(x) happens to be of the form ax+b ,where a and b are constants.
 
Last edited:
Yes subbing u = 1+e^x would work, but for this question you do not need to figure out du. So
∫1/(1+e^x) dx

so 1 = u-e^x

∫(u-e^x)/u dx

from here you can see how it would work.
You could also do it your way but you have to use partial fraction decomposition.
 
A better approach is to do this:
$$\int \frac{1}{1+e^{x}}\,dx=\int \frac{e^{-x}}{1+e^{-x}}\,dx$$
Use ##e^{-x}=u## to get:
$$\int \frac{-du}{1+u}\,du=-\ln|1+u|+C=-\ln|1+e^{-x}|+C$$
 
Last edited:
Or another: $$\int \frac{1}{1+e^x}\,\text{d}x = \int \frac{1+e^x}{1+e^x}\,\text{d}x - \int \frac{e^x}{1+e^x}\,\text{d}x$$The second integral on the right can be evaluated by a simple substitution.
 
Tanya Sharma said:
or, to be more precise f(x) happens to be of the form ax+b ,where a and b are constants.
No, that wouldn't work.
$$\int \frac{dx}{ax + b} = \frac 1 a ln|ax + b| + C$$
So ∫dx/f(x) ≠ ln|f(x)| + C. There's that pesky factor of 1/a.
 
Pranav-Arora said:
Use ##e^{-x}=u## to get:
$$\int \frac{-du}{1+u}\,du=-\ln|1+u|+C=-\ln|1+e^{-x}|+C$$

How was she able to ln the instead like that? I thought there was a factor of \frac{1}{a} to deal with?
 
  • #10
physics604 said:
How was she able to ln the ____ instead like that? I thought there was a factor of \frac{1}{a} to deal with?

... ln the WHAT instead ...


What part of Pranav-Arora's post don't you get?
 
  • #11
Mark44 said:
$$\int \frac{dx}{ax + b} = \frac 1 a ln|ax + b| + C$$
So ∫dx/f(x) ≠ ln|f(x)| + C. There's that pesky factor of 1/a.

I'm assuming they did something like this?

$$\int \frac{-du}{u+1} = -\frac{1}{1}\ln {|u+1|} +C$$
 
Back
Top