calculate the Probability density function of the absolute difference of two random variable If $X$ and $Y$ are two independent random variables with probability density functions $f$ and $g$, respectively, then the probability density of the difference $Y − X$ is given by the cross-correlation . In contrast, the convolution f * g gives the probability density function of the sum $X + Y$.

what i would like to have is the probability density functions of $|y-x|$ or $(y-x)^2$. Is that possible ? 

is that the equivalent as doing the following with two histogram ?


for (bin b1 in Histogram1)
  for (bin b2: Histogram2)
        prob = b1.probability * b2.probability
        distance += prob * abs(b1.value - b2.value)
As you said, the density of $X-Y$ is the cross-correlation $h(t) = \int_{-\infty}^\infty f(t+y) g(y) \, dy$.  The density of $|X-Y|$ is $f_{|X-Y|}(t) = h(t) + h(-t)$ for $t &gt; 0$, $0$ for $t &lt; 0$.  The density of $(X-Y)^2$ is $f_{(X-Y)^2}(t) = (h(\sqrt{t}) + h(-\sqrt{t}))/(2 \sqrt{t})$ for $t &gt; 0$, $0$ for $t &lt; 0$.
It is a very big question.

Yes you can find the pdf of any combination of variables, there are many ways. 

The one which works most of the time use the characteristic function:

http://en.wikipedia.org/wiki/Characteristic_function_(probability_theory)#Basic_manipulations_of_distributions

You have many complex and exotic tools to exploit the properties of CF.

Anyhow this process greatly depends from the type of variable. E.g.: It is much easier with exponential variables than with non exponential variables.