I have:
$f(x) = 0.1\delta(x-2) +0.4\delta(x-1) +{1 \over 4}e^{-|x|}$
$Y=g(x)=0, x\le0$
$g(x)=x^2, 0<x<1$
$g(x)=1, x\gt1$
The task is to find the pdf (density function) of y.
$P(Y=0)=P(X<0)=\int_{-\infty}^0f(x)dx=\int_{-\infty}^0{1 \over 4}e^{x}$
Since the diracs are all zero in the interval and -|x|=x in the interval.
thus $f(y)= {1 \over 4}\delta(y)$ is one component of the resulting f(y)
$P(Y=1)=\int_1^{\infty}f(x)dx=\int_1^{\infty}0.1\delta(x-2) +\int_1^{\infty}0.4\delta(x-1)+\int_1^{\infty}{1 \over 4}e^{-x}$
$=0.1+0.4+{1 \over 4}e^{-1}=0.5919698603$
thus $f(y)= (0.5+{1 \over 4}e^{-1})\delta(y-1)$ is one component of the resulting f(y)
finally i evaluate the problem for $0<x<1$
if find fy by the formula:
$f(y)=\Sigma_0^1 {f(xi) \over |g'(x_i)|}$
$g'(x)=2x$
$x_i=y-g(x)$
$x_1=\sqrt y$
$x_2=-\sqrt y$
$f(y)={1 \over {4 |2*-\sqrt y|}}e^{-|-\sqrt y |}+{1 \over {4 |2\sqrt y|}}e^{-|\sqrt y |}$
$={2 \over {4 |2\sqrt y|}}e^{-|\sqrt y |}={1 \over {4 |\sqrt y|}}e^{-|\sqrt y |}$
thus the pdf of y is ${1 \over {4 |\sqrt y|}}e^{-|\sqrt y |}$ for $0<y<1$
evaluating $\int_0^1f(y)dy$ yields:
$-{1 \over 2}e^{-|1|}-(-{1 \over 2}e^{-|0|})=0.31606$
If we add the areas under the full pdf f(y) together, we get an area under the whole pdf that is:
$0.5919698603+0.31606+0.25=1.15$
As one can see this does not add up to one, and i clearly has misunderstood something in the definition of how to calculate Y=g(x).
Edit:
The pdf, of y, that i find is:
$f(y)={1 \over {4 |\sqrt y|}}e^{-|\sqrt y |}+(0.5+{1 \over 4}e^{-1})\delta(y-1)+{1 \over 4}\delta(y)$
But the integral $\int_{-\infty}^{\infty}f(y)dy \ne 1$
Since i have checked my calculations several times, i must have misunderstood something about how to find the pdf of y for the given pdf of x, f(x), and the given Y= g(x).
Edit 2:
Could it be that the root $x_2=-\sqrt y$ is not valid in the interval so the result
$f(y)={1 \over {4 |2*-\sqrt y|}}e^{-|-\sqrt y |}+{1 \over {4 |2\sqrt y|}}e^{-|\sqrt y |}$ should actually be:
$f(y)={1 \over {4 |2\sqrt y|}}e^{-|\sqrt y |}$