Mean of the difference between uniform random variables. I have two uniform random variables $B$ and $C$ distributed between $(2,3)$ and $(0,1)$ respectively. I need to find the mean of $\sqrt{B^2-4C}$. Could I plug in the means for $B$ and $C$ and then solve or is it more complicated than that?
The original question is here: Difference between two real roots with uniformly distributed coefficents
 A: You want to find the mean of $\sqrt{B^2-4C}$. This cannot be done by substituting $E(B)$ and $E(C)$ for $B$ and $C$ in the expression $\sqrt{B^2-4C}$. 
Let $f_B(x)$ be the density function of $B$, and let $f_C(y)$ be the density function of $C$. So $f_B(x)=1$ on the interval $(2,3)$ and $0$ elsewhere, and $f_C(y)=1$ on the interval $(0,1)$ and $0$ elsewhere. 
Then the required mean is 
$$\iint_{\mathbb{R}^2} \sqrt{x^2-4y}\,f_B(x)f_C(y)\,dx\,dy.$$ 
In our case  we are effectively integrating over the rectangle where the densities are non-zero. So we are integrating $\sqrt{x^2-4y}$ over the rectangle.
For the double integral, I would integrate first with respect to $y$, and then with respect to $x$. The first integration is easy. The second is doable but a little messy.
A: Use change of variables:
$$X = \sqrt{B^2-4C}
$$ 
$$Y=C$$
$$B = \sqrt{X^2+4Y}$$
$$C=Y$$
Jacobian: 
$$
 J = det\left( \begin{array}{ccc}
\frac{\partial B}{\partial X} &\frac{\partial C}{\partial X}   \\
\frac{\partial B}{\partial Y} & \frac{\partial C}{\partial Y} \\
 \end{array} \right) =  det \left( \begin{array}{ccc}
\frac{X}{\sqrt{X^2+4Y}} & 0   \\
\frac{2Y}{\sqrt{X^2+4Y}} & 1 \\
 \end{array} \right) = \frac{X}{\sqrt{X^2+4Y}}
$$
Join distribution of (X,Y) is given by:
$$f_{X,Y}(X,Y) = |J|\ f_{B,C}(B,C) = |J|\ f_B(B) f_C(C) $$ where $f_{B,C}(B,C) =  f_B(B) f_C(C)=1$ because $B,C$ are independent.
Thus, $$f_{X,Y}(X,Y) = \frac{X}{\sqrt{X^2+4Y}}$$ where $ 0 \leq X \leq 3$ and $0 \leq Y \leq 1$
We need to find $E[X] = \int_0^3 xf_X(x) dx$
$f_X(x) = \int_0^1 f_{X,Y}(x,y)dy = \int_0^1 \frac{x}{\sqrt{x^2+4y}}dy = \frac{x.\sqrt{x^2+4y}}{2}|_0^1 = \frac{x}{2}(\sqrt{x^2+4}-x)$
Further:
$E[X] = \frac{1}{2}\int_0^{3} x^2(\sqrt{x^2+4}-x)dx$ which probably further requires $x=2\ tan\theta$ substitution.
