# Let $T$ be an exponential random variable with parameter $\theta$. For $t \gt0$, compute $\Bbb{E}(T|T\le t)$

Let $$T$$ be an exponential random variable with parameter $$\theta$$. For $$t \gt0$$, compute $$\Bbb{E}(T|T\le t)$$.

My work: First $$P(T\le s|T\le t)=\frac{\int_0^s\theta e^{-\theta x}dx}{\int_0^t\theta e^{-\theta x}dx} =\frac{1-e^{-\theta s}}{1-e^{-\theta t}}, \ \ 0\le s\le t$$

Hence $$\Bbb{E}(T|T\le t)=\int_0^t s\cdot \frac{\theta e^{-\theta s}}{1-e^{-\theta t}} ds$$

I am not sure if I make a right calculation, please give a verification.

Alternative way: using the absence of memory property, we have $$\mathrm E[T; T> t] = \mathrm E[T\mid T> t] \mathrm P(T>t) = (t+ \mathrm E[T])e^{-\theta t} = (t+ \theta^{-1})e^{-\theta t},$$ whence $$\mathrm E[T\mid T\le t] = \frac{\mathrm E[T; T\le t]}{\mathrm P(T\le t)} = \frac{\mathrm E[T] - \mathrm E[T; T> t]}{1-e^{-\theta t}} \\ = \frac{\theta^{-1} - (t+ \theta^{-1})e^{-\theta t}}{1-e^{-\theta t}} = \theta^{-1} - \frac{t}{e^{\theta t} - 1}.$$
What you have computed in the first line is $$P(T \leq s|T\leq t)$$ not, $$P(T = s|T\leq t)$$. (The latter is $$0$$). So when you compute the expectation you have to replace $$1-e^{-\theta s}$$ by its derivative.