Computing Correlation cofficient from joint pdf X and Y have the joint pdf:
$f(x,y)= \frac{2}{x} e^{-2x}$ for $0<x<\infty , 0<y<x$
I'm using the formula: $E(h(x,y))=\int_{0}^{\infty} \int_{0}^{x} h(x,y)\frac{2}{x} e^{-2x} dydx $ . And I'm simply setting $x$,$x^2$, etc. as h(x,y).
Based on this, I got:
$E(XY)=\frac{1}{4} , E(X)=\frac{1}{4} , E(Y)= \frac{1}{4}, E(X^2)=\frac{1}{2}, E(Y^2)=\frac{1}{6}$
$Cov(X,Y)=E(XY)-E(X)E(Y)=\frac{1}{4}, var(X)= E(X^2)-[E(X)]^2=\frac{1}{4}, var(Y)=E(Y^2)-[E(Y)]^2 = \frac{5}{48}$
$ \rho(X,Y)= \frac{Cov(X,Y)}{\sqrt{var(X)var(Y)}}= 1.5492$
But the coefficient cannot exceed 1. So where did I go wrong? Any help would be appreciated!
 A: Here is a useful trick.  Instead of individually computing each moment, consider the generalized expression for nonnegative integers $a, b$
$$\begin{align}
\operatorname{E}[X^a Y^b] &= \int_{x=0}^\infty \int_{y=0}^x x^a y^b \frac{2}{x} e^{-2x} \, dy \, dx \\
&= \int_{x=0}^\infty 2x^{a-1} e^{-2x} \left[ \frac{y^{b+1}}{b+1} \right]_{y=0}^x \, dx \\
&= \frac{2}{b+1} \int_{x=0}^\infty x^{a-1} e^{-2x} x^{b+1} \, dx \\
&= \frac{2}{b+1} \int_{x=0}^\infty x^{a+b} e^{-2x} \, dx. \tag{1}
\end{align}$$
Now recalling the definition of the gamma function
$$\Gamma(z) = \int_{t=0}^\infty t^{z-1} e^{-t} \, dt, \tag{2}$$ this motivates the substitution $$t = 2x, \quad x = \frac{t}{2}, \quad dx = \frac{1}{2} \, dt$$ to yield $$\operatorname{E}[X^a Y^b] = \frac{2}{b+1} \int_{t=0}^\infty \frac{t^{a+b}}{2^{a+b}} e^{-t} \frac{1}{2} \, dt = \frac{\Gamma(a+b+1)}{(b+1)2^{a+b}} = \frac{(a+b)!}{(b+1)2^{a+b}}. \tag{3}$$
Now this lets us compute all desired moments rapidly; e.g.,
$$\begin{array}{c|c|c}
(a,b) & X^a Y^b & \operatorname{E}[X^a Y^b] \\
\hline
(1,0) & X & \frac{1}{2} \\
(0,1) & Y & \frac{1}{4} \\
(1,1) & XY & \frac{1}{4} \\
(2,0) & X^2 & \frac{1}{2} \\
(0,2) & Y^2 & \frac{1}{6}
\end{array} \tag{4}$$
Then $$\operatorname{Var}[X] = \frac{1}{2} - \frac{1}{2^2} = \frac{1}{4}, \\ \operatorname{Var}[Y] = \frac{1}{6} - \frac{1}{4^2} = \frac{5}{48},$$
hence $$\rho = \frac{\frac{1}{4} - \frac{1}{2} \frac{1}{4}}{\sqrt{\frac{1}{4}\frac{5}{48}}} = \sqrt{\frac{3}{5}}.$$
