The joint density function of X, Y is
f(x,y)=\frac{1}{y}e^{-(y+x/y)},\quad0\lt x,y\lt \infty(a) Verify that the preceding is a joint density function.
(b) Find Cov (X, Y).
To show that f(x, y) is a joint density function we need to show it is nonnegative, which is immediate, and that \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x,y)d y\,d x=1. We prove the latter as follows:
\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x,y)d y\,d x=\int_{0}^{\infty}\int_{0}^{\infty}{\frac{1}{y}}e^{-(y+x/y)}d y\,d x=\int_{0}^{\infty}e^{-y}\int_{0}^{\infty}{\frac{1}{y}}e^{-x/y}d x\,d y
=\int_{0}^{\infty}e^{-y}d y
= 1
To obtain Cov(X, Y), note that the density funtion of Y is
f_{Y}(y)=e^{-y}\int_{0}^{\infty}{\frac{1}{y}}e^{-x/y}d x=e^{-y}Thus, Y is an exponential random variable with parameter 1, showing (see Example 2.21) that
E[Y] = 1
We compute E[X] and E[XY] as follows:
E[X]=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}x f(x,y)d y\,d x=\int_{0}^{\infty}e^{-y}\int_{0}^{\infty}{\frac{x}{y}}e^{-x/y}d x\,d y
Now, \textstyle\int_{0}^{\infty}{\frac{x}{y}}e^{-x/y}d x is the expected value of an exponential random variable with parameter 1/y, and thus is equal to y. Consequently,
{ E}[X]=\int_{0}^{\infty}y e^{-y}d y=1Also
E[X Y]=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}x y f(x,y)d y\,d x=\int_{0}^{\infty}y e^{-y}\int_{0}^{\infty}\frac{x}{y}e^{-x/y}d x\,d y
=\int_{0}^{\infty}y^{2}e^{-y}d y
Integration by parts (d v=e^{-y}d y,u=y^{2}) gives
E[X Y]=\int_{0}^{\infty}y^{2}e^{-y}d y=-y^{2}e^{-y\vert_{0}^{\infty}}+\int_{0}^{\infty}2y e^{-y}d y=2E[Y]=2Consequently,
Cov(X, Y) = E[XY] − E[X]E[Y] = 1