Probability of one distribution > another

In general, given $2$ independent distributions $X$ and $Y$, how can I solve for probability $\mathbb{P}Y>X$?

E.g. if $X$ and $Y$ are both standard normal, I can use a geometric and symmetric argument to get $\mathbb{P}(Y>X)$ is $0.5$. The analytical answer here is specific to normal though.

What if:

1: $Y$ is triangular (sum of two $\text{Uniform}(0,1)$) and $X$ is uniform?

2: $Y$ is standard normal and $X$ is uniform?

EDIT:

Thanks for the answers below. Just a follow up regarding the two specific examples above: are there any simpler arguments to solve them, say geometry, without going through the integral? Thanks!

• The general method is based on conditioning $P(Y>X)=\int{dx P(Y>x)f_X(x)}$ – kludg Oct 21 '17 at 15:20
• @kludg that is not general in full sense. It might be that $X$ has no PDF $f_X$. – drhab Oct 21 '17 at 15:25
• @drhab this is optimal method for the OP cases, where both $X$ and $Y$ have PDF's. – kludg Oct 21 '17 at 15:57

Let $[y>x]$ denote the function $\mathbb R^2\to\mathbb R$ that takes value $1$ if $y>x$ and takes value $0$ otherwise.
Then in general by finding: $$\mathsf P(Y>X)=\int\int[y>x]dF_Y(y)dF_X(x)=\int1-F_Y(x)dF_X(x)=1-\int F_Y(y)dF_X(x)$$