Determine limits in double integration I've tried to search the site but haven't really found a satisfactory answer. Not one that I understood anyways. Specifically, I looked at this: Limits in Double Integration and Limits in Double Integration Question.
I am given the following function and asked to find the value of $k$ that makes this into a valid joint probability density function:
$ f(x,y) = \begin{cases} 
      k & 0 \leq x \leq 2\,,\quad 0 \leq y \leq 1\,,\quad 2y \leq x \\[1mm]
      0 & \mbox{otherwise}
   \end{cases}
$
Obviously, I need to setup and solve something like this:
$
\int_{a}^{b}\int_{c}^{d} k d? d? = 1
$
I'm having a terrible time understanding how to determine the limits of integration here, to the point that I'm not even sure if I should integrate over $x$ or $y$ first.
I know that homework questions aren't appreciated (and this is a homework question), but I've been struggling with this question for over an hour and I'm not closer to understanding now than I was when I started.
 A: The region
$$ \{(x,y)\in\mathbb R^2:0\leq x \leq 2, 0 \leq y \leq 1, 2y \leq x\}$$
is a triangle in $\mathbb R^2$ (maybe it will be helpful for you to draw it). To integrate in this region you can do it two ways. You should think of it as describing this region one variable at a time. 
First $x$ then $y$: 
Given $y$, the region includes all $x$'s that satisfy $2y \leq x \leq 2$. And it includes all $y$'s such that $0 \leq y \leq 1$. This leads to the integral
$$ \int_0^1\int_{2y}^2 k\;dxdy .$$
First $y$ then $x$: 
Given $x$, the region includes all $y$'s that satisfy $0 \leq y \leq x/2$. And it includes all $x$'s such that $0 \leq x \leq 2$. This leads to the integral
$$ \int_0^2\int_0^{x/2} k\;dydx .$$
A: Disclaimer: I don't know if this is right, but it's the best I have. If there's a mistake, kindly point it out:
From $2y \leq x$ we determine that $y \leq \frac{x}{2}$. We set up our double integral thusly:
\[
\int_{x=0}^{x=2}\int_{y=0}^{y=\frac{x}{2}}kdydx \Rightarrow k\int_{0}^{2}\int_{0}^{\frac{x}{2}}dydx
\]
Let's do the inner integral first:
\[
\int_{0}^{\frac{x}{2}}dy = y\bigg|_{0}^{\frac{x}{2}} = \frac{x}{2} - 0 = \frac{x}{2}
\]
Now, we'll use this to evaluate the outer integral:
\[
k\int_{0}^{2}\int_{0}^{\frac{x}{2}}dydx = k\int_{0}^{2}\frac{x}{2}dx = \frac{k}{2}\int_{0}^{2}xdx = \frac{k}{2}\Bigg[\frac{x^2}{2}\Bigg]_{0}^{2} = \frac{k}{2}\Big(\frac{2^2}{2} - 0\Big) = k
\]
Since we are seeking to make this a valid joint probability density function, we conclude that $k = 1$.
