The expectation of sum of uniform random variables given their maximum I have been working on the following problem by using two approaches. They give different results and I do not find the mistake. I have random variables $X_1,\ldots,X_n$, which are uniformly distributed on $[0,\theta]$. I want to compute $E\left[ \sum_{i=1}^{n}X_i\mid T=t \right]$, where $T=max\{X_1,\ldots,X_n\}$.
Approach 1: Since $T=t$, one of $X_i$ is equal to $t$ and others are uniformly distributed on $[0,t]$. Thus, $E\left[ \sum_{i=1}^{n}X_i\mid T=t \right]=t+\frac{(n-1)t}{2}=\frac{(n+1)t}{2}$.
Approach 2: Note that since $P(T\leq t)=P(X_1\leq t,\ldots,X_n\leq t)=(\frac{t}{\theta})^n$, $f_T(t)=\frac{nt^{n-1}}{\theta^n}$. Similarly, since $P(T\leq t\mid X_i=x)=(\frac{t}{\theta})^{n-1}$, $f_{T\mid X_i}(t\mid x)=\frac{(n-1)t^{n-2}}{\theta^{n-1}}$, where $x\leq t$.
Then, $f_{X_i\mid T}(x\mid t)=\frac{f_{X_i}(x)f_{T\mid X_i}(t\mid x)}{f_T(t)}=\frac{\frac{1}{\theta}\frac{(n-1)t^{n-2}}{\theta^{n-1}}}{\frac{nt^{n-1}}{\theta^n}}=\frac{n-1}{nt}$. This implies that
$E[X_i\mid T=t]=\int_0^tx\frac{n-1}{nt}dx=\frac{(n-1)t}{2n}$. Therefore, $E\left[ \sum_{i=1}^{n}X_i\mid T=t \right]=\sum_{i=1}^nE[X_i\mid T=t]=\frac{(n-1)t}{2}$. 
As you see, the results are different. In my opinion, the conditional density $f_{X_i\mid T}(x\mid t)$ is faulty since it does not sum up to 1. But, I do not understand why.
 A: Not completely sure about this, but I made a modification by multiplying your conditional in approach 2 by the "Heaviside step function" such that the probability is zero once you cross the boundary of $x$: 
$P\left(T \le t | X_{i}=x\right) = \left(\frac{t}{\theta}\right)^{n-1}\Theta\left(t-x\right)$.
From there I carried out the same calculations as you yielding the following (note that $\delta$ is the Dirac delta function, which is the derivative of the Heaviside step function etc.):
$f_{T|X_{1}}\left(t | x\right) = \frac{\left(n-1\right)t^{n-2}}{\theta^{n-1}}\Theta\left(t-x\right)+\left(\frac{t}{\theta}\right)^{n-1}\delta(t-x)$
$f_{X_{1}|T}\left(x | t\right) = \frac{\left(n-1\right)}{nt}+\frac{\theta^{n-1}}{nt^{n-1}}\left(\frac{t}{\theta}\right)^{n-1}\delta(t-x)$
$f_{X_{1}|T}\left(x | t\right) = \frac{\left(n-1\right)}{nt}+\frac{1}{n}\delta(t-x)$
$E\left[X_{i}|T=t\right]=\int_{0}^{t}x\frac{\left(n-1\right)}{nt}\mathrm{d}x+\int_{0}^{t}x\frac{1}{n}\delta(t-x)\mathrm{d}x$
$E\left[X_{i}|T=t\right]=\frac{\left(n-1\right)t}{2n}+\frac{t}{n}$
$E\left[X_{i}|T=t\right]=\frac{\left(n+1\right)t}{2n}$
and the final step is to multiply by $n$ as you did to get the expectation of the sum.
I hope this helps.
