# joint density of two random variables

Let $$X, Y$$ be random variables with density functions $$f_X(x)$$ and $$f_Y(y)$$.

If $$X$$ and $$Y$$ are independent, then the joint density function $$f(x,y)=f_X(x)f_Y(y)$$.

If they are not independent, how can we find the joint density function(if it exists)?

We can't. Say $$X$$ and $$Y$$ are both uniform on $$[0,1]$$. Then if they are independent, $$(X,Y)$$ is uniform on the unit square. If, on the other hand, $$X=Y$$, then $$(X,Y)$$ is uniform on the line segment from $$(0,0)$$ to $$(1,1)$$. One can certainly find more exotic joint distributions too with the same component-wise distributions.