<s>[INST] Difference between maxima of random variables Given four independent, identically distributed Gaussian random variables with zero mean and unit variance $x_1$, $x_2$, $y_1$, $y_2$, consider 
\begin{equation}
u \equiv \max(x_1+C\, y_1, x_2+C \, y_2) - \max(x_1-C \, y_1, x_2-C \, y_2),
\end{equation}
where $C$ is a real number.
Do you know how to compute the PDF of $u$, or a least its variance?
 [/INST] Using $\max(a,b) = \dfrac{a+b}{2} + \left| \dfrac{a-b}{2}\right|$, write $u = w_1 + |w_2| - |w_3|$ where 
$$ \eqalign{ w_1 &=  C (y_1 + y_2) \cr
             w_2 &= \dfrac{1}{2} (x_2 - x_1 + C (y_2 - y_1))\cr
             w_3 &= \dfrac{1}{2} (x_2 - x_1 - C (y_2 - y_1))\cr}$$
are jointly normal with mean $0$ and covariance matrix
$$ V = \pmatrix{2 C^2 & 0 & 0 \cr 0 & (1+C^2)/2 & (1-C^2)/2\cr
 0 & (1-C^2)/2 & (1+C^2)/2\cr}$$
In particular, $w_1$ is independent of $w_2$ and $w_3$.
Thus $\text{Cov}(w_1, |w_2|) = 0$ and $\text{Cov}(w_1, |w_3|) = 0$.
The only nontrivial computation is  $ \text{Cov}(|w_2|, |w_3|)$.  If $|C| < 1$ get
$$ \eqalign{ {\mathbb E} [|w_2| |w_3|] &= \dfrac{1-C^2}{\pi} \arctan\left(\frac{2|C|}{C^2-1}\right) + \dfrac{1-C^2}{2} + 2 \frac{|C|}{\pi}\cr
{\mathbb E}|w_2| &= {\mathbb E} |w_3| = \sqrt{\dfrac{C^2+1}{\pi}}\cr
\text{Cov}(|w_2|,|w_3|) &= \dfrac{1-C^2}{\pi} \arctan\left(\frac{2|C|}{C^2-1}\right) + \dfrac{1-C^2}{2} - \dfrac{(1-|C|)^2}{\pi}
} $$
and then 
 $$ \text{Var}(w_1 + |w_2| - |w_3|) = 2\dfrac{C^2-1}{\pi} \arctan\left(\frac{2|C|}{C^2-1}\right)  + 4 C^2 - \frac{4|C|}{\pi} $$
EDIT: That formula was only for $|C|<1$ because of branch problems with the arctan.  Here's one that should work for all $C \ne 0$:
$$ \text{Var}(w_1 + |w_2| - |w_3|) = 2 \dfrac{C^2-1}{\pi} \arctan \left(\frac{1-C^2}{2|C|}\right) + 3 C^2 - \frac{4|C|}{\pi} + 1 $$
</s>