Let $X,Y$ be independent and both $\text{Exp}(\lambda)$ distributed. How does one calculate $$E(\max (X,Y)\mid X)\,?$$
By independence $\max (X,Y)$ is $\text{Exp}(2\lambda) $ distributed but I do not see how to continue. I am aware of memorylessness of exponential distribution. Help is welcome!
For a fixed $x\geq0$ we find:
$$\begin{aligned}\mathbb{E}\max\left(x,Y\right) & =\mathbb{E}\max\left(x,Y\right)\mathbf{1}_{Y\leq x}+\mathbb{E}\max\left(x,Y\right)\mathbf{1}_{Y>x}\\ & =xP\left(X\leq x\right)+\mathbb{E}\left(Y\mid Y>x\right)P\left(Y>x\right)\\ & =x\left(1-e^{-\lambda x}\right)+\left(x+\lambda^{-1}\right)e^{-\lambda x}\\ & =x+\lambda^{-1} e^{-\lambda x} \end{aligned} $$
Here the equality $\mathbb{E}\left(Y\mid Y>x\right)=x+\lambda^{-1}$ is based on the lack of memory of exponential distribution.
Because $X$ and $Y$ are independent we find:
$$\mathbb{E}\left[\max\left(X,Y\right)\mid X=x\right]=\mathbb{E}\left[\max\left(x,Y\right)\mid X=x\right]=\mathbb{E}\max\left(x,Y\right)=x+\lambda^{-1} e^{-\lambda x}$$
allowing us to conclude that:
$$\mathbb{E}\left[\max\left(X,Y\right)\mid X\right]=X+\lambda^{-1} e^{-\lambda X}$$