# Help with this integral

1. Jun 27, 2010

### akbar786

1. The problem statement, all variables and given/known data

integral of (1+e^x)/(1-e^x) dx

2. Relevant equations

3. The attempt at a solution
The TA said to make u = e^x
So, du = e^x dx. dx = du/e^x.
Since e^x = u

The integral now is (1+u)/(1-u)u
I am confused as to what to do after distribute the u in the bottom.

2. Jun 27, 2010

### vela

Staff Emeritus
Use partial fractions.

3. Jun 27, 2010

### akbar786

alright so i got A = 1 and B = 2 so now i have the integral of 1/u + 2/(1-u). Which i end up getting ln |u| - 2ln|1-u| + c. Now replacing the u for e^x i get ln e^x - 2 ln(1-e^X). Which is x-2 ln (1-e^x) + c. Is that the right answer?

4. Jun 27, 2010

### vela

Staff Emeritus
Here's an alternate method you can use to solve this problem.

Whenever I see combinations of $1\pm e^x$, I look at what happens if I pull out a factor of $e^{x/2}$ to restore symmetry to the quantities. In this case, the integrand becomes

$$\frac{1+e^x}{1-e^x} = \frac{e^{x/2}(e^{-x/2}+e^{x/2})}{e^{x/2}(e^{-x/2}-e^{x/2})} = \frac{e^{-x/2}+e^{x/2}}{e^{-x/2}-e^{x/2}}$$

You might notice that the top and bottom can be written in terms of hyperbolic trig functions or that they are derivatives of each other to within a constant factor. In either case, with the appropriate substitution, integrating is straightforward.

5. Jun 27, 2010

### Staff: Mentor

6. Jun 27, 2010

### vela

Staff Emeritus
It's easy enough to check. Try differentiating your answer and see if you recover what you started with.

7. Jun 27, 2010

### akbar786

wow that makes is so much simpler..thanks so much!