Help in understanding integrating a function with an absolute value My math is rusty, and although I initially thought I understand the solution, upon further examination I think I don't:
That's the original function:
$$  \Psi(x,t) = A \mathrm{e}^{-\lambda|x|} \mathrm{e}^{-\mathrm{i} \omega t}  $$
\begin{align*}  \langle x^2 \rangle &= 2|A|^2 \int_0^\infty x^2 \mathrm{e}^{-2\lambda x}\,\mathrm{d}x  \\
&= 2 \lambda \left[ \frac{2}{(2\lambda)^3} \right]  \\
&= \frac{1}{2\lambda^2}  \text{.}  
\end{align*}
What I don't understand is why there's 2 in front of A square, why parameters of integration changed from minus infinity-plus infinity to 0-plus infinity, and why x lost its absolute value. At first I thought that he's using the symmetry of the function and calculating the integral from 0 to infinity, where |x| = x, then multiplying it by two. But after checking how to integrate absolute value functions I'm not sure my reasoning is correct.
Sorry if the question is messed up, but I cannot imbed images directly, and have to use links.

By symmetry, the integral of an even function from $-\infty$ to $\infty$ is twice the integral from $0$ to $\infty$.
