# Integral of absolute e-function

I have to integrate the following function:

$$\int e^{-|x|}~dx$$

I tried this and I don't think, that this is right. So can you tell me, where my fault is? $$\int e^{-|x|}~dx=\int_{-\infty}^\infty e^{-|x|}~dx=\int_{-\infty}^0e^{-(-x)}~dx+\int_0^\infty e^{-x}~dx=e^x-e^{-x}$$

The problem is, that $e^{-|x|}$ has no root. $e^{-|x|} \in (0,1]$

-
The calculations are correct, but you have to plug in the boundary values, i.e. $e^x\big|_{-\infty}^0-e^{-x}\big|_{0}^\infty=1+1=2$ – user8 Jan 15 '13 at 12:23
Thx for advice.. i got it – Link Jan 15 '13 at 12:31
Are you trying to compute a definite integral, such as $\int_{-\infty}^\infty \exp(-|x|)\,\mathrm dx$, or a primitive of the function $x\mapsto\exp(-|x|)$? – jathd Jan 15 '13 at 12:32
@Giesi If you want to calculate the indefinite integral, i.e. $\int\exp{(-|x|)}dx$ the result would be $\exp{(x)}-\exp{(-x)}$ as you calculated. But then you have to cancelt the boundaries of the integral! – user8 Jan 15 '13 at 12:35
No, $\exp(x)−\exp(−x)$ is not an indefinite integral. Differentiate it to check. – GEdgar Jan 15 '13 at 14:09

I'm not sure why you turn your indefinite integral into a definite one. What you should do (as I think you attempted) is consider when $x$ is in certain intervals.
For $-\infty<x\le 0$, $e^{-|x|}=e^{x}$, so $\int e^{-|x|}dx=\int e^{x}dx=e^{x}+C=e^{-|x|}+C$
For $0\le x < \infty$, $e^{-|x|}=e^{-x}$, so $\int e^{-|x|}dx=\int e^{-x}dx=-e^{-x}+C=-e^{-|x|}+C$

-
Your result has problem, since $-\text{sgn}(x)e^{-|x|}$ is discontinuous at $x=0$ . – Harry Peter Nov 23 '15 at 12:19

$\int e^{-|x|}~dx$

$=\int e^{-x~\text{sgn}(x)}~dx$

$=\int_0^xe^{-x~\text{sgn}(x)}~dx+C$

$=\text{sgn}(x)[-e^{-x~\text{sgn}(x)}]_0^x+C$

$=\text{sgn}(x)(1-e^{-|x|})+C$

-