Q:

Question regarding $\int \frac{e^x}{e^x-2} \,dx$

I tried to solve this integral in the following way:
$$
\text{Let } u = e^x-2 \Rightarrow  du = e^x \, dx \Rightarrow dx = \frac{du}{e^x} \\
\int \frac{e^x}{e^x-2} \,dx = \int \frac{e^x}{u}\, \frac{du}{e^x} = \\
=\int \frac{du}{u} = \ln(u) = \ln(e^x-2)
$$
I think that might be correct but the answer seems to be $\ln(2-e^x)$ which I can obtain by:
$$
\text{Let } u = 2-e^x \Rightarrow du = -e^x \,dx \Rightarrow dx = -\frac{du}{e^x} \\
\int \frac{e^x \cdot (-1)}{(e^x-2) \cdot (-1)} \,dx = -\int \frac{e^x}{2-e^x}\,dx = \\
= -\int \frac{e^x}{u}\cdot (-1) \frac{du}{e^x} = \int \frac{du}{u} =  \\
= \ln(u) = \ln(2-e^x)
$$
Even if I derivate both of the results I get back to what I wanted to integrate, so both solutions might be right. However I plotted both functions to be sure that are different and they are.
I'm kind of lost and I can't really accept by myself that both functions are the solution. I'm still thinking there should be a silly mistake I can't see. Any idea?

A:

Neither function makes sense if you allow $x$ to run over the whole line, as the argument of the logarithm needs to be positive (i.e. the first function makes no sense for $x<\ln2$ and the second one for $x>\ln2$). 
When it is not clear that you are dealing with positive numbers, the antiderivative of $1/u$ is $\ln(|u|)$. And then the ambiguity disappears. 

