I have two random variables ($X$ and $Y$) that are uniformly distributed from 2.16 to 6.81 both. And I need to find $E(|x-y|^2)$.
Is this correct: $\displaystyle\dfrac{\int\limits_{2.16}^{6.81}\int\limits_{2.16}^{6.81} (x^2-2xy+y^2) \;\mathrm{d}x\;\mathrm{d}y}{(6.81-2.16)}$ ?
A good start, but your equation
$\dfrac{\int\limits_{2.16}^{6.81}\int\limits_{2.16}^{6.81} (x^2-2xy+y^2) \;\mathrm{d}x\;\mathrm{d}y}{(6.81-2.16)}$
is not correct and/or the question is not complete. First, you need to assume a probability distribution $f(x,y)$. You only state "Uniform" but there is no "obvious" multivariate uniform distribution. You could build a cumulative distribution $F(x,y) = C(U(x),U(y))$ using a Coppula $C(\cdot,\cdot)$ and then differentiating wrt x and y after each other. Let's say, I assume my variables x,y are independent and identically distributed (iid), aka the Coppula $C(V,W)=VW$, then I get $F(x,y)= U(x)U(y)$ and $f(x,y)= u(x)u(y)$ with uniform distribution
$$u(x)=\mathcal{U}_{2.16,6.81}(x)=\frac{1}{6.81-2.16}\delta(2.16\leq x \leq6.81)=\frac{1}{4.65}\delta(2.16\leq x \leq6.81).$$
Inserting
$\begin{align} E\{|x-y|^2\}&=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}u(x)u(y)|x-y|^2~\mathrm{d}x~\mathrm{d}y\\ &= \int_{2.16}^{6.81}\frac{1}{4.65}~\int_{2.16}^{6.81}\frac{1}{4.65} (x^2 -2xy+y^2)~\mathrm{d}x~\mathrm{d}y \end{align}$
So, your solution is missing a factor of $\frac{1}{4.65}$ as it should have been squared...