# Integration problem

## Homework Statement

integrate 1/(1+e^x) dx

## The Attempt at a Solution

firstly i let t=1+e^x
and then i come to : integrate 1/(t^2-1)
and then i put t=secx
.
.
.
but then the final ans is -1/2 ln | 2/e^x +1 |

it should be 1 instead of 2, i hv checked for the steps for so many times, but found nothing wrong

HallsofIvy
Homework Helper
You have done the substitution wrong.

If $t= 1+ e^x$ then $dt= e^xdx= (t- 1)dx$ so that $\frac{1}{t- 1}= dx$.

$$\int \frac{1}{1+ e^x}dx= \int \frac{1}{t} \frac{dt}{t- 1}= \int \frac{1}{t(t- 1)} dt$$

NOT $\int \frac{1}{t^2- 1} dt$

STEMucator
Homework Helper
Perhaps you should multiply the top and bottom of the expression by ##e^{-x}## and see what happens when you substitute ##u = e^{-x}##.

You have done the substitution wrong.

If $t= 1+ e^x$ then $dt= e^xdx= (t- 1)dx$ so that $\frac{1}{t- 1}= dx$.

$$\int \frac{1}{1+ e^x}dx= \int \frac{1}{t} \frac{dt}{t- 1}= \int \frac{1}{t(t- 1)} dt$$

NOT $\int \frac{1}{t^2- 1} dt$
then you can use partial fraction i.e. create (t)- (t-1) in the numerator