Let $_{(1)}$,...,$_{()}$ be the order statistics of a set of $$ independent uniform $(0,1)$ random variables. I need to calculate $$E[(X_{(2)}-(X_{(1)}+a))^{+} | X_{(1)}<a],$$ where $Y^{+}$ is is positive part of $Y.$
It is known that $X_{(2)}-X_{(1)}$ has the $Beta(1,n-1+1)$ distribution.
Hence $$E[(X_{(2)}-(X_{(1)}+a))^{+} | X_{(1)}<a]=\frac{E[(X_{(2)}-(X_{(1)}+a))^{+} I_{X_{(1)}<a}]}{P(X_{(1)}<a)}\le \frac{E[(X_{(2)}-(X_{(1)}+a))^{+}]}{P(X_{(1)}<a)},$$ where $I$ is a indicator function. Is it inequality $$E[(X_{(2)}-(X_{(1)}+a))^{+} I_{X_{(1)}<a}]\le E[(X_{(2)}-(X_{(1)}+a))^{+}]=E[(X_{(1)}-a))^{+}]$$ correct?
I think your expectation can be calculated in closed form, although it is tedious to do so.
The key is to first obtain the joint distribution of the first two order statistics $(X_{(1)}, X_{(2)})$. This is easy enough, and Wikipedia provides the necessary formula:
$$f_{X_{1}, X_{2}}(x,y) = n(n-1) (1-y)^{n-2}, \quad 0 \le x \le y \le 1.$$
Then the desired expectation, for $0 < a < 1$ and $n \ge 2$, is
$$\begin{align} E(a) &= \operatorname{E}[(X_{(2)} - (X_{(1)} + a))^+ \mid X_{(1)} \le a] \\ &= \frac{\int_{x=0}^a \int_{y=x}^1 \max(0, y - x - a) f_{X_{(1)}, X_{(2)}} (x, y) \, dy \, dx }{\int_{x=0}^a \int_{y=x}^1 f_{X_{(1)}, X_{(2)}} (x,y) \, dy \, dx} \\ &= \frac{\int_{x=0}^{\min(a,1-a)} \int_{y=x+a}^1 (y-x-a) (1-y)^{n-2} \, dy \, dx}{\int_{x=0}^a \int_{y=x}^1 (1-y)^{n-2} \, dy \, dx}. \end{align}$$
Notice the condition $0 \le x \le \min(a,1-a)$. This occurs because we simultaneously require $0 \le x \le a$ and $x+a \le y \le 1$, the latter of which implies $x \le 1 - a$.
We now proceed to evaluate the numerator and denominator separately. The denominator is
$$\begin{align} \int_{x=0}^a \int_{y=x}^1 (1-y)^{n-2} \, dy \, dx = \int_{x=0}^a \frac{(1-x)^{n-1}}{n-1} \, dx = \frac{1 - (1-a)^n}{n(n-1)}. \end{align}$$
The numerator is $$\begin{align} \int_{x=0}^{\min(a, 1-a)} \int_{y=x+a}^1 (y-x-a) (1-y)^{n-2} \, dy \, dx &= \int_{x=0}^{\min(a, 1-a)} \int_{u=0}^{1-(x+a)} u^{n-2} (1-x-a-u) \, du \, dx \\ &= \int_{x=0}^{\min(a, 1-a)} \left[(1-x-a)\frac{u^{n-1}}{n-1} - \frac{u^n}{n} \right]_{u=0}^{1-x-a} \, dx \\ &= \int_{x=0}^{\min(a, 1-a)} \frac{(1-x-a)^n}{n(n-1)} \, dx \\ &= \frac{1}{n(n-1)} \int_{v=\max(0,1-2a)}^{1-a} v^n \, dv \\ &= \frac{(1-a)^{n+1} - \max(0,(1-2a))^{n+1}}{(n+1)n(n-1)}. \end{align}$$
Putting this together,
$$\begin{align} E(a) &= \frac{(1-a)^{n+1} - \max(0, (1-2a))^{n+1}}{(n+1)(1 - (1-a)^n)} \\ &= \begin{cases} \frac{(1-a)^n - (1-2a)^{n+1}}{(n+1)(1-(1-a)^n)}, & 0 < a \le 1/2 \\ \frac{(1-a)^{n+1}}{(n+1)(1-(1-a)^n)}, & 1/2 < a < 1. \end{cases} \end{align}$$
Simulation corroborates this result; e.g., for $n = 5$, $a = 1/7$, the expectation is $\frac{403}{4926}$, and with the Mathematica code
I obtained a sample mean on $10^7$ simulations of approximately $0.0817691$.