# How to solve the definite integral $\int_{-4}^{-2}e^{-x}\,dx$?

I'm trying to find the value of the integral $\int_{-4}^{-2}e^{-x}\,dx$ but I just couldn't solve it.

Actually I found in a List of integrals that $\int e^x\,dx=e^x+C$ so I concluded:

\begin{align} \int e^{-x}\,dx=&\int\frac{1}{e^x}\,dx\\=&\ln|e^x|\\\\\int_{-4}^{-2}e^{-x}\,dx=&\left(\ln|e^{-2}|\right)-\left(\ln|e^{-4}|\right)\\=&-2+4\\=&2 \end{align}

I know the solution is wrong, but how can I solve this integral or any another integral like this.

-
Substitute $y = -x$ if you don't see the primitive of $e^{-x}$. –  Daniel Fischer Aug 23 at 23:23
Careful! It is true that $$\int u^{-1}du=\log u$$ but in order to let $u$ be any function, you need to incorporate the $f'(u) du$ term, that is $$\int \frac{f'(u)}{f(u)}du=\log |f(u)|$$ Note that by what you wrote, you're saying that $e^{-x}=\frac d{dx} x=1$ for all $x$. This is certainly not the case! –  Pedro Tamaroff Aug 23 at 23:25
@PeterTamaroff Don't forget the constant of integration. –  Fly by Night Aug 23 at 23:38
You are probably pretty good at differentiation. For a while at least, whenever you have calculated an indefinite integral (aka antiderivative, aka primitive), it is a good idea to check by differentiating whether you are right. –  André Nicolas Aug 23 at 23:41
@FlybyNight: the matter of a constant of integration is tangential to Peter's description of what is wrong with the OP's solution. Since it is was too late for Peter to add the constant when you commented, I will add the constants to his answer, but I will remove them if he requests. It was so requested, but let's avoid a thread about it here. If this needs discussion, take it to chat, please. –  robjohn Aug 24 at 10:23

$$\int_{-4}^{-2} e^{-x} dx = \left . \left ( -e^{-x}\right ) \right |_{-4}^{-2} = -e^2+e^4 = e^2 \left ( e^2-1\right )$$

-
Can you just explain to me how does $\int e^{-x}\,dx=(-e^{-x})$ –  Mohammad Fakhrey Aug 24 at 0:12
@MohammadFakhrey see my answer. Also, take the derivative of $-e^{-x}$ and you'll confirm that it's the anti-derivative of $e^{-x}$. –  Ataraxia Aug 24 at 0:28
Thanks a lot :) –  Mohammad Fakhrey Aug 24 at 0:49

Hint:

$$u=-x$$

$$dx=-du$$

Can you figure out what to do from here?

-
Ataraxia I'm sure that your answer (hint) is very helpful but because of my limited knowing about integrals and derivatives I just couldn't "figure out what to do from here?". –  Mohammad Fakhrey Aug 24 at 10:36
@MohammadFakhrey Replace $-x$ with $u$ and $dx$ with $-du$ in the integral. Then the integral will look like something more familiar. Do you still need help? –  Ataraxia Aug 24 at 12:02
Thank you Ataraxia this was helpful. –  Mohammad Fakhrey Aug 24 at 12:12
Isn't easy to see (think to the derivative) that if $\alpha\neq 0$ $$\int e^{\alpha x}=\frac{1}{\alpha} e^{\alpha x}+C \ ?$$
Why? If we know that $(e^{\alpha x})'=\alpha (e^{\alpha x})$ then we can see the result, ditto if we know that $(x^n)'=n x^{n-1}$ we can see that $\int x^n dx=\frac{1}{n+1} x^{n+1}$ etc I want say that this is a very common method: think to the correspondance between derivative and anti derivative. Isn't it? –  Sami Ben Romdhane Aug 24 at 1:01