Figuring out limits of integration when doing joint densities

The problem in question:

f(x,y)=24xy for 0<= x<=1, 0<=y<=1, 0<=x+y<=1, otherwise x=0

The goal is to show that f(x,y) is a joint probability fxn and I believe we do that by doubly integrating f(x,y) and showing the result equals 1.

I believe that the answer is: , however I'm having trouble understanding the limits of integration. Why is it that we integrate from 0 to 1-y on x and from 0 to 1 on y?

Here's a similar problem I had earlier:

f(x,y)=2 0<x<y, 0<y<1

The problem asks the student to determine whether X,Y are independent. So, I set out to find the marginal distribution of x:

Why do we integrated from x to 1

Why do we integrate from 0 to y

Could we switch the limits of integration as long as we adjust them for both X and Y? For example, could we integrate from 0 to 1 instead of x to 1 if we change the limits of integration on Y?

Thanks a bunch in advance...I hate probability