I searched through similar questions but couldn't find one answering my question. I know the following is the way of finding marginal pdf from joint pdf. $$ f_x(x)= \int_{-\infty}^{\infty} f_{x,y}(x,y) dy$$
But while solving a problem I realised that after this step we take a function of x as one of the limits, why so? If we do so aren't we violating the method above?
Why aren't we simply taking the limits of y from 0 to 1.(This is consistent with the method)
The problem I'm talking about: