Consider the problem of calculating the covariance of 2 variables $X$ and $Y$ such that
$$f_{X,Y}(x,y) = \frac{2}{x}\exp(-2x) I_{(0, \infty)}(x) I_{(0,x)}(y)$$
Note that we can't find the pdf of $Y$ since the integral of thi functin over $x$ cannot be expressed as a sum of elementary functions. But I think we can evaluate its expectation as:
$E(Y) = \int_{-\infty}^{\infty} y \left(\int_{y}^{\infty} f_{X,Y}(x,y) dx \right) dy = \int_{0}^{\infyt} \int_{0}^{x} y f_{X,Y}(x,y) dydx$$
since we can see $Y$ as $g(X,Y)=Y$. Am I correct using it?
Thanks in advance!