$f(x,y)=\frac{1}{2x^2y}$ , $1\le x<\infty $ , $\frac{1}{x}\le y$f(x,y)=\dfrac{1}{2x^2y}$ , $1\le x<\infty $  , $\dfrac{1}{x}\le y<x$ 
Derive marginal probability density function of $X$ and $Y$
I have a problem in calculating marginal of Y.
We have to calculate $\int_{x}f(x,y)dx$
Usually, I draw graphs to get my limits of integration first before calculating marginal distribution but this time I am unable to figure out limits. 
Graph is 
Function changes. 
I have $y<x$ and $y<1/x$ as well . So how do I calculate marginal in this case?
 A: Guide:


*

*Once you fix $x$, $y$ takes value from $\frac1{x}$ to $x$, those are your lower and upper limit.

*Just compute $\int_{\frac1x}^x \frac1{2x^2y}\, dy$
Edit:
Depends on whether your $y$ is above or below $1$. 


*

*If $y$ is below $1$, the lower limit is $\frac1y$.

*If $y$ is at least $1$, the lower limit is $x$.

*The upper limit is $\infty$. 
A: $\frac 1 {2x^{2}} \int_{1/x} ^{x} \frac 1 y dy=\frac 1 {2x^{2}}  (log \, x -\log \, (1/x))=\frac {log \, x} {x^{2}}$ for $1 <x <\infty$. The marginal of $Y$ is $\int_{\max \{y,\frac 1 y\}}^{\infty} \frac 1 {2x^{2}y} dx=\frac 1 {2\max \{1, y^{2}\}}$.
A: \begin{align*}f_X(x)&=\int_{y}f(x,y)dy=\int_{1/x}^x\frac{1}{2x^2y}dy=\frac{1}{2x^2}\int_{1/x}^x\left(\ln{y}\right)'dy=\frac{\ln{x}}{x^2}\cdot\mathbf1_{\{x\ge1\}}\end{align*}
For $f_Y$ you need to take cases depending on whether $y<1$ or $y\ge 1$. This is best determined from your graph:


*

*$y<1$: Then $1/x<y<x$ implies that $x>1/y>1/x$. You also have that $x\ge 1$, but since, $1/y\ge 1$ $$f_Y(y)=\int_{1/y}^{\infty}f(x,y)dx$$

*$y\ge1$: Then $1\le y<x$ implies that 
$$f_Y(y)=\int_{y}^{\infty}f(x,y)dx$$
