You have to remember that top and bottom are relative when integrating. In the blue box, you're solving for y, so you have to sort of turn your head to the right and view the graph in terms of y. By doing so, you will see that the top graph (in terms of y) is actually 3y and the bottom graph (in terms of y) is y^2. Does it make more sense now?