The question, solution and answer is attached. Could someone please explain to me how the 0, pi/2, 2, and 2(1+cos(theta)) boundaries are chosen/found and relate it to the drawing for me please?

Any input would be greatly appreciated!

Thanks in advance!