# How to solve the integral $\int \frac{1}{e^x}\,dx$ step by step? [duplicate]

I'm primitive in integrals and derivatives and I'm trying to solve the integral $\int \frac{1}{e^x}\,dx$, but especially this integral was hard to me to solve it.

So I tried:

\begin{align} \int\frac{1}{e^x}\,dx&=\int \frac{1}{\color{Red}{e^x}}\color{Blue}{e^x\,dx}\\&=\int \frac{1}{\color{Red}{u}}\,\color{Blue}{du}\\&=\ln\left(|u|\right)\\&=\ln \left(|e^x|\right)+C \end{align}

But my solution is wrong while I used the integration by substitution method ?!

\begin{align} \int\frac{1}{e^x}\,dx&=\left(-e^{-x}\right)+C \end{align}

## marked as duplicate by user63181, rschwieb, Dan Rust, Vedran Šego, Lord_FarinAug 24 '13 at 13:10

• Your very first equation is wrong. Look at it again! – TonyK Aug 24 '13 at 11:43
• The substitution you made puts an $e^x$ where there was none to start. You can't just put $e^x$ in from nowhere. – James S. Cook Aug 24 '13 at 11:45

$$\int dx\frac{1}{e^x} = \int e^{-x}dx =$$ With substitution $y=-x$: $$=-\int e^ydy = -e^y +C = -e^{-x} +C$$

Your solution is wrong because the first step is wrong: $$\int dx\frac{1}{e^x}\neq \int dx\frac{1}{e^x}e^x$$ If you apply the substitution $u=e^x$ correctly you get: $$\int dx\frac{1}{e^x} = \int\frac{1}{u^2}du = -u^{-1}+C = -e^{-x}+C$$

• The OP is asking why is his solution wrong – Shobhit Aug 24 '13 at 11:43
• @Shobhit: Edited. – Daniel Robert-Nicoud Aug 24 '13 at 11:48

Indeed, you can use the substitution method for integrating $$\int \frac 1{e^x} \,dx = \int e^{-x} \, dx$$

$$\text{Put}\;\;\color{blue}{\bf u = -x} \implies du = -\,dx \iff \color{red}{\bf -\,du = dx}$$

Substituting then gives us \begin{align} \int e^{\color{blue}{\bf -x}} \,\color{red}{\bf dx} & = \int e^\color{blue}{\bf u} (\color{red}{\bf -\,du}) \\& = -\int e^u\,du \\ \\ & = -e^u + C \\ & = - e^{-x} + C \\ \\ & = \frac{-1}{e^x} + C\end{align}

• Thank you that was more clarification – Mohammad Fakhrey Aug 24 '13 at 12:15
• You're welcome Mohammad. Sorry I couldn't have been of more help. – Namaste Aug 24 '13 at 12:17

You can see the steps, one by one, or all steps at once by inserting the following codes in Maple:

  [> with(Student[Calculus1]):
IntTutor(1/exp(x), x);