Well, I expected this to be a fairly simple task, but in the online portal of my uni it is stated I got zero points for it, although I recall pretty clearly this is exactly what I did. Where is my mistake then?
Task: $\int \frac{e^x}{e^x - 2}dx$
First I applied a substitution, as I always find it nice to have just a lone variable below fraction to see possible connections to standard integrals.
So I used u = $e^x - 2$. This also requires u' or $\frac{du}{dx}$ which = $e^x$. Rearranging this gives dx = $\frac{du}{e^x}$ which we then insert. So now we have:
$\int \frac{u + 2}{u} * \frac{du}{e^x}$
{I am expressing the $e^x$ in numerator with my substitution too, is this good practice? Or should I leave it as just $e^x$ next time? In next step it is seen that it wasn't so smart here, but what about a general rule?}
I now see that I can shorten ${e^x}$ if I undo the substitution in the numerator again:
$\int \frac{e^x -2 + 2}{u} * \frac{du}{e^x}$
{I now shorten ${e^x}$ by crossing it out in denominator of $\frac{du}{e^x}$ and cross out the whole numerator of $\frac{e^x -2 + 2}{u}$ and replace it with 1. Or would further explanations be needed here?} This leaves:
$\int \frac{1}{u}du$
which is a standard integral = ln(u). At last I undo the substitution: u = $e^x -2$ which leaves as our result:
ln($e^x -2$)
I then add the absolute value due to the behaviour of ln: Final solution:
ln($|e^x -2|$) + C
As others have said, the result was correct but you took the long way to get there. Where could you have saved time.
$u = e^x - 2$ is a good substitution
$du = e^x dx$
here you could have saved a few steps:
$\int \frac {e^x}{e^x - 2} \ dx = \int \frac {(e^x dx)}{e^x - 2} = \int \frac {du}{u}$
And you could even drop the intermediate step.
It is cleaner than what you have.