I am trying to understand how to deal with the following type of question given two random variables $X$ and $Y$ that are jointly continuous with some pdf:
Here: $f_{X,Y}(x,y) = \left\{ \begin{align} x\cos y, 0 \leq x \leq \frac{\pi}{2},0 \leq y \leq x \\ 0 \text{ , otherwise} \end{align} \right.$
Now I don't know how to calculate $Pr(X+Y) \geq\frac{\pi}{2}$
I have the answer and they choose bounds for their integrals
$$\int_{\frac\pi 4}^{\frac\pi 2} \int_{\frac\pi 2 -x}^x \mathrm{d }y \mathrm{d }x$$
How were these bounds chosen? Why was this integral correct.
Thanks for your help.

Without the constraints of the pdf, how would you describe the region where $x+y \ge \pi/2$?
If you put the pdf as the integrand, then the support (where the pdf is nonzero) narrows down the region further, to give you the integral you wrote.