I'm trying to solve this integral with absolute values. Wolframalpha shows that $\int\limits^\infty_{-\infty} xe^{-|(x-u)|} dx = 2u$, but when I break the absolute value into two integrals I don't get 2u $$\int\limits^\infty_{-\infty} xe^{-|(x-u)|} dx = \\ \int\limits^0_{-\infty} xe^{(x-u)} dx + \int\limits^\infty_0 xe^{-(x-u)} dx = (e^u-e^{-u})$$
I solve the individual integrals with wolframalpha, am I doing anything wrong here?
To remove the absolute value in the argument of the exponential, you need that argument to be of constant sign. So you need $x-u \geq 0$ or $x-u\leq 0$. Therefore you should break the integral at $u$, not $0$. In other words $$\int_{-\infty}^{+\infty}=\int_{-\infty}^{u}+\int_{u}^{+\infty}$$