# Independence of random variables.

For two random variables $X, Y$, if their joint distribution can be written as product of two functions $f(x),g(y)$ for all $x,y$ ( need not be marginals), I am trying to prove that they are independent. However, I am unable to intuitively imagine this through examples. If I try to find the marginals of $X,Y$, aren't they nothing but $f(x), g(y)$ in this case? Is there something I am missing?

• $f$ and $g$ needn't integrate to $1$. – grndl Oct 13 '16 at 13:31

Below is a counterexample. Let the joint PDF of $X$ and $Y$ be $$f_{X, Y}(x, y) = 4xy$$ where $0 \leq x, y \leq 1$ and let $f(x) = x$ and $g(y) = 4y$.
In this case, both $f(x)$ and $g(y)$ are not valid PDF however.