# Need help with the integral of marginal density function

The joint density of random variables X and Y is given by $$f(x,y)= \begin{cases} \frac{2e^{-2x}}{x} , & 0\le x \lt \infty \ , \ 0\le y \le x \\ 0\quad , & \text{otherwise} \end{cases}$$ Compute $$\text{Cov}(X ,Y)$$.

So in order to get the covariance, I need to find the marginal density function for $$x$$ and $$y$$ first, then compute $$E(X)$$ and $$E(Y)$$.

I am able to get the marginal density function for $$x$$ but I am stucked with the marginal density function for $$y$$: $$f_Y(y)=\int_{-\infty}^{\infty}f(x,y)\:dx=\int_{0}^{\infty}\frac{2e^{-2x}}{x}\:dx$$ The integral does not converge at $$0$$.

Or should I use $$\int_{y}^{\infty}\frac{2e^{-2x}}{x}\:dx$$ instead of $$\int_{0}^{\infty}\frac{2e^{-2x}}{x}\:dx$$ , since $$0\le y \le x\lt \infty$$ ?

But I am also not sure how to deal with $$\int_{y}^{\infty}\frac{2e^{-2x}}{x}\:dx$$...

Any help is highly appreciated! Thanks.

Note the domain is the infinite triangle region under the line $$y=x$$ and above the x-axis. So when you find the marginal function, your integration limit for $$x$$ is from $$y$$ to $$\infty$$

$$f_Y(y)=\int_y^\infty f(x,y) dx$$

This is exponential integral, see here: https://en.wikipedia.org/wiki/Exponential_integral

You cannot proceed more from here to find an analytical result for $$f_Y(y)$$. But you still can calculate the $$E(Y)$$ for example, $$E(Y)=\int_0^\infty yf_Y(y)dy=\int_0^\infty \int_y^\infty yf(x,y) dxdy$$

Interchange the integration orders:

$$E(Y)=\int_0^\infty \int_0^x yf(x,y) dydx=\int_0^\infty\frac{2e^{-2x}}{x} \left(\int_0^x y dy\right)dx$$

• Thanks for the reply! Can you explain how should I integrate the f(x,y) please? Commented Jul 27, 2022 at 19:25
• This is exponential integral, see here: en.wikipedia.org/wiki/Exponential_integral but you still can calculate the $E(Y)$ for example, $$E(Y)=\int_0^\infty yf_Y(y)dy=\int_0^\infty \int_y^\infty yf(x,y) dxdy$$ Commented Jul 27, 2022 at 19:28
• Oh... Didn't know that I could calculate E(Y) the other way. Thank you so much for saving my life!!! because I had been stucked at this question for hours T_T Commented Jul 27, 2022 at 19:34
• haha, no worries :) Commented Jul 27, 2022 at 19:35