# Find the marginal density $f_Y(y)$ of a random vector $(X,Y)$.

Given a (continuous) bivariate random vector $(X,Y)$ with a probability density:

$$f_{XY}(x,y)=\left\{ \begin{array}{l}\tfrac{1}{y}e^{-(y+\tfrac{x}{y})} & \text{if }x>0 \text{ and } y>0 \\ 0 & \text{otherwise}\end{array} \right.$$

Find the marginal density $f_X(x)$ and $f_Y(y)$ and show whether $X$ and $Y$ are stochastically independent.

In my attempt, I tried to calculate the marginal densities as follows:

\begin{align*}f_Y(y) &= \int_{-\infty}^{\infty}f_{XY}(x,y)\mathrm{d}x \\ &= \int_{0}^{\infty}\tfrac{1}{y}e^{-(y+\tfrac{x}{y})}\mathrm{d}x\\ &= -\lim_{N \to \infty} \left[ e^{-(y+\tfrac{x}{y})} \right]_0^N \\ &= -\lim_{N \to \infty} (e^{-(y+\tfrac{N}{y})}-e^{-(y+\tfrac{0}{y})})\\ &= e^{-y}-0 = \frac{1}{e^y} \end{align*} $\\$ \begin{align*}f_X(x) &= \int_{-\infty}^{\infty}f_{XY}(x,y)\mathrm{d}y \\ &= \int_{0}^{\infty}\tfrac{1}{y}e^{-(y+\tfrac{x}{y})}\mathrm{d}y\\ \end{align*}

But I get stuck at solving this last integrals. How should this be solved?

The expression for $f_X(x)$ is not elementary. In fact, the integral is a defining integral for the Macdonald function: $$f_X(x) = \int_0^\infty \exp\left(-y - \frac{x}{y}\right)\frac{\mathrm{d}y}{y} = \left.\left( \underbrace{\left(\frac{z}{2}\right)^\nu \int_0^\infty \exp\left(-t-\frac{z^2}{4t} \right) \frac{\mathrm{d}t}{t^{\nu+1}}}_{2 K_\nu\left(z\right)}\right)\right|_{\nu=0,z=2 \sqrt{x}} = 2 K_0\left(2 \sqrt{x}\right)$$ where $x$ was assumed positive. Anyhow, you readily conclude that $f_{X,Y}(x,y) \not= f_X(x) f_Y(y)$.