What is the expected value of the random variable with the following pdf Let $X$ be a random variable with pdf 
$$f(x \mid \sigma) = \dfrac{1}{2\sigma}\exp\left(-\dfrac{|x|}{\sigma}\right)\text{, } x \in (-\infty, \infty)\text{, }\sigma > 0\text{.}$$
Here are my steps:
$$E(X) = \int^{∞}_{-∞}\frac{xe^\frac{-|x|}{σ}}{2σ}dx = \int^{0}_{-∞}\frac{xe^\frac{x}{σ}}{2σ}dx + \int^{∞}_{0}\frac{xe^\frac{-x}{σ}}{2σ}dx = [\frac{1}{2}(\frac{x}{σ} - 1)e^\frac{x}{σ}]|^{0}_{-∞} - [\frac{1}{2}(\frac{x}{σ} + 1)e^\frac{-x}{σ}]|^{∞}_{0} = \frac{1}{2}(-1) - \frac{1}{2} = -1$$
But this doesn't make sense...
Where did I go wrong? I'm very confused!
 A: Here $f(x) = \frac{1}{2\sigma} e^{-\frac{|x|}{\sigma}};\quad -\infty < x < \infty,\quad \sigma > 0$.
Now, 
$$
\begin{eqnarray}
E(X) &=& \frac{1}{2\sigma} \int_{-\infty}^{\infty} x e^{-\frac{|x|}{\sigma}} dx\\
&=& \frac{1}{2\sigma} \int_{-\infty}^{0} x e^{-\frac{|x|}{\sigma}} dx + \frac{1}{2\sigma} \int_{0}^{\infty} x e^{-\frac{|x|}{\sigma}} dx\\
&=& I_1 + I_2\\
\end{eqnarray}
$$
Note that $$\begin{eqnarray}|x| &=& x; \quad x>0\\ 
&=& -x; \quad x<0\end{eqnarray}$$
First consider $I_1$:
$$
\begin{eqnarray}
I_1 &=& \frac{1}{2\sigma} \int_{-\infty}^{0} x e^{-\frac{|x|}{\sigma}} dx\\
&=& \frac{1}{2\sigma} \int_{-\infty}^{0} x e^{\frac{x}{\sigma}} dx\\
&=& \frac{1}{2\sigma}\left[\left\{x\int e^{\frac{x}{\sigma}}dx\right\}_{-\infty}^0 - \int_{-\infty}^0 \left\{\frac{d}{dx}x \int e^{\frac{x}{\sigma}}dx\right\}dx\right]; \text{by partial integration}\\
&=&0
\end{eqnarray}
$$
Next consider $I_2$:
$$
\begin{eqnarray}
I_2 &=& \frac{1}{2\sigma} \int_{0}^{\infty} x e^{-\frac{|x|}{\sigma}} dx\\
&=& \frac{1}{2\sigma} \int_{0}^{\infty} x e^{-\frac{x}{\sigma}} dx
\end{eqnarray}
$$
Taking $\frac{x}{\sigma} = u$, this integral becomes simply $\frac{\sigma}{2}$. 
Hence the actual expectation is $\frac{\sigma}{2}$.
