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]$
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$