Probability density function of transformed variable Suppose $X$ is a random variable that is uniformly distributed, and $f$ is a function such as $f:\mathbb{R}\rightarrow[-a, a]$ where $a$ is some constant.
How do I find the probability density function of $f(X)$? The function $f$ is not monotonic but can be assumed to be continuous and differentiable.
 A: Suppose that for each $z \in [-a.a]$, the equation 
$f(x) = z$ has a finite number
of solutions  in whatever interval $X$ happens to be uniformly distributed on, and that of these solutions, the derivative
$\frac{\mathrm df(x)}{\mathrm dx}$ of $f(x)$ is
nonzero only at $x_1, x_2, \ldots, x_n$. Note that $n$ 
might be different for different $z$'s and there might 
be no solutions at all in some cases.
Then, for each $z$ in $[-a,a]$,
$$f_Z(z) = \sum_{i=1}^n \frac{f_X(x_i)}{\left|\frac{\mathrm df(x)}{\mathrm dx}\right|_{x=x_i}} = \sum_{i=1}^n \frac{c}{\left|\frac{\mathrm df(x)}{\mathrm dx}\right|_{x=x_i}}\tag{1}$$
where $c$ is the common value of the pdf of $X$ at all points in
the interval on which $X$ is uniformly distributed.
It might look like the right side of $(1)$ does not depend on $z$
at all, but it does so depend. Remember that the values of the
$x_i$ (as well as their number!) depends on what $z$ you have chosen
(that is, they are functions of $z$).
A: You've given very general conditions, so I can only offer a very general answer:
If $X \sim P_X$ then we know that 
$$P(f(X)\leq z) = P_X(X \in f^{-1}([0,z]))=\frac{Leb(f^{-1}([0,z]) \cap \mathbf{range}\; X)}{Leb(\mathbf{range}\; X)}$$
Where $Leb$ is the Lebesgue measure, $\mathbf{range}\; X$ is the range of $X$ and $x \in f^{-1}(z)$ is the (possibly non-compact) inverse-image of $f$ applied to the set $[0,z]$.
A: Distribution is uniform. And the range for $x$ is $-a$ to $+a$. And the uniform distribution is defined as $f(x) = 1/(b-a)$ where  $a<x<b$  i.e. upper limit is $b$ and lower limit is $a$. In your situation, lower limit is $-a$ and upper limit is $+a$ so the pdf will be $f(x)=1/(a-(-a)) = 1/(a+a) =1/(2a)$ where $x$ takes value from $-a$ to $+a$. And $f(x) = 0$ otherwise.
