How can we compute $\operatorname E\left[(\operatorname\min(|X|,1-|X|))^2\right]$? Let $X$ be an $(-1,1)$-valued random variable and $D:=\operatorname\min(|X|,1-|X|)$. How can we compute $\operatorname E\left[D^2\right]$?
I have no good idea how I need to approach this. In my actual application $X=Y_1-Y_2$, where $Y_i=\iota Z_i$ for some $Z=(Z_1,Z_2)\sim\mathcal N((x,x),\Sigma)$ and $$\iota:\mathbb R\to[0,1)\;,\;\;\;y\mapsto y-\lfloor y\rfloor.$$ Here $x\in[0,1)$ and $\Sigma\in\mathbb R^{2\times 2}$ is positive. If $\sigma_i^2:=\Sigma_{ii}$, then obviously $Z_i\sim\mathcal N(x,\sigma_i^2)$.
But even in this special situation I don't know how to simplify $\operatorname E\left[D^2\right]$
 A: Notice that $\min(|\{x\}-\{y\}|,1-|\{x\}-\{y\}|)=\min(\{x-y\},1-\{x-y\})$, where $\{x\}:=x-\lfloor x\rfloor$. Then, the expected value of interest is given by
\begin{align}
\mathbb{E}[\Big(\min(|\{Z_1\}-\{Z_2\}|,1-|\{Z_1\}-\{Z_2\}|\big)^2]&=\mathbb{E}[\big(\min(\{Z_1-Z_2\},1-\{Z_1-Z_2\}\big)^2]\\
&=\int\big(\min(\{x\},1-\{x\}\big)^2\,\mu(dx)
\end{align}
where $\mu$ is the distribution of $X'=Z_1-Z_2$
Since $Z=[Z_1\,Z_2]^\intercal$ is assumed to be normal with common mean, $X'=Z_1-Z_2$ is a normal with mean $0$ a some variance $\sigma^2>0$.
Here is a simple R code to simulate a situation like the one described by the OP. It can be used to get some insight into the problem.
### function f(x)=min(|x|,1-|x|) 
zfunc <- function(x){
  min(abs(x),1-abs(x))
}
zfunc <- Vectorize(zfunc,vectorize.args = "x")


#### Function that estimates mean of min^2([X],1-[X]) 
# N sample size
# sigma: variance ofsamples from normal distribution 
Zmean <- function(N=3e5, sigma){
  Xsamp1 <- rnorm(N, mean = 0, sd = sigma)
  Xsamp2 <- rnorm(N, mean = 0, sd = sigma)
  Xsamp1.floor <- Xsamp1 - floor(Xsamp1)
  Xsamp2.floor <- Xsamp2 - floor(Xsamp2)
  Xsamp.floor <- Xsamp1.floor - Xsamp2.floor
  Zsamp <-(zfunc(Xsamp.floor))^2
  zmean <- mean(Zsamp)
  Zsd <- sqrt(var(Zsamp))
  return(list(mean = zmean, sd = Zsd))
}

### Example
sigma <- seq(.1,10, by = .01)
Zmeans <- lapply(sigma, function(x){Zmean(sigma = x)})
z2 <- sapply(Zmeans,'[[',1)
plot(sigma, z2, type = 'l')

The code of course can be improved to make the sample size $N$ more sensitive to the size of the variance $\sigma^2$.
The numerical experiments (using the R script above) suggest that  as a function of $\sigma^2:=\operatorname{var}[X']$, $E_{\sigma^2}[(\min(|\{X'\}|,1-|\{X'\}|)^2]=E_{\sigma^2}[D^2]$ is monotone nondecreasing  and seems to converge to a value  around $0.0833$ as $\sigma^2\rightarrow\infty$.  This can be explain by Fejer's theorem as follows. Let $f(x;\sigma)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-x^2/2\sigma^2}$ be the the density function of the Normal distribution with mean $0$ and variance $\sigma^2$. The expectation in the OP is of the form
$$\int_{\mathbb{R}}f(x;\sigma^2)\big(\min(\{x\},1-\{x\}\big)^2\,dx=\int f(x;1)\big(\min(\{\sigma x\},1-\{\sigma x\}\big)^2\,dx$$
where $\{x\}=x-\lfloor x\rfloor$. As the function $x\mapsto \min(\{x\},1-\{x\})$ is $1$-periodic, we have that
\begin{align}
\lim_{\sigma\rightarrow\infty}\int f(x;1)\big(\min(\{\sigma x\},1-\{\sigma x\}\big)^2\,dx&=\left(\int^1_0\big(\min(\{x\},1-\{x\}\big)^2\,dx\right)\int_\mathbb{R} f(x;1)\,dx\\
&=\frac{1}{12}= 0.08\bar{3}
\end{align}
On the other extreme, as $\sigma^2\rightarrow0$, $\mathbb{E}_{\sigma^2}[D^2]\rightarrow0$. This is not surprising since $X'$ converges to $0$ in distribution as $\sigma^2\rightarrow0$.
