Find the distribution of $|X|$ if $X \sim N(\mu, 1)$
My attempt:
$$P(|X| \leq x) = F_X(x) - F_X(-x)$$
If $F$ denote the cumulative distribution of $X$, then
$$P(|X| = x) = \frac{1}{\sqrt{2\pi}}(\exp(-1/2(x-\mu)^2 + \exp(-1/2(x+\mu)^2).$$
But i am confused if it is correct and about the limits of integration of this variable. Also, can we write it in function of $|X|$?
Thanks!
$F_{\left|X\right|}\left(x\right)=P\left\{ -x\leq X\leq x\right\} =P\left\{ X\leq x\right\} -P\left\{ X<-x\right\} =F_{X}\left(x\right)-F_{X}\left(-x\right)$
This for $x\geq0$. The last equality follows from $P\left\{ X=-x\right\} =0$.
If $x<0$ then $F_{\left|X\right|}\left(x\right)=0$.
Here $X=\mu+U$ where $U$ has standard normal distribution.
So $F_{X}\left(x\right)=P\left\{ U\leq x-\mu\right\} =\Phi\left(x-\mu\right)$ where $\Phi$ denotes the CDF of the standard normal distribution.
We end up with:
$F_{\left|X\right|}\left(x\right)=\Phi\left(x-\mu\right)-\Phi\left(-x-\mu\right)$ if $x\geq0$ and $F_{\left|X\right|}\left(x\right)=0$ otherwise.
Here $$\Phi\left(u\right):=\int_{-\infty}^{u}\phi\left(y\right)dy=\left(2\pi\right)^{-\frac{1}{2}}\int_{-\infty}^{u}e^{-\frac{1}{2}y^{2}}dy$$ and: $$\Phi'\left(u\right)=\phi\left(u\right)$$
This enables us to find the PDF of $\left|X\right|$. Denoting it by $f_{\left|X\right|}$ we can take $f_{\left|X\right|}\left(x\right)=0$ on interval $\left(-\infty,0\right]$. On interval $\left(0,+\infty\right)$ we find $f_{\left|X\right|}$ as derivative of $F_{|X|}$ :
$$f_{\left|X\right|}\left(x\right)=\phi\left(x-\mu\right)+\phi\left(-x-\mu\right)=\left(2\pi\right)^{-\frac{1}{2}}\left[e^{-\frac{1}{2}\left(x-\mu\right)^{2}}+e^{-\frac{1}{2}\left(x+\mu\right)^{2}}\right]$$