Assume we notice that stock prices are rising and we can deduce we are in a bubble. Assume we start at $w(0)=0$ worth at time $t=0$ and the value grows linearly with time $(w(t)=t)$. We know that there will be a point where the prices will plummet and we lose everything if we haven't sold by that time $(w(t_f)=-1/2 t_f^2)$.
If the time till the burst of bubble is exponentially distributed with parameter $\lambda$, so $t_f \sim exp[\lambda]$. Assume also that the parameter can be approximated with some accuracy, so we know what $\lambda$ is.
So the worth function would be something like: $w(t) = \begin{cases} t, & t<t_f \\ -1/2 t^2, & t=t_f \\ 0, & t>t_f \end{cases}$
What would be the optimal time $t_s$ to sell all the money if all we know is that the fall will happen following exponential distribution with parameter $\lambda$? Optimal would mean, I think, that $E(w(t))$ is maximized. I think we would have to compute integral $$\int_0^{t_s}\int_0^{\infty} \lambda e^{- \lambda t_f} w(t) \ dt_f \ dt$$ and find $t_s$ that maximises that.
I don't understand your value for $t = t_f$, but no matter, it won't contribute to the integral. Your double integral is wrong, though. The expected value should be $$ E(w(t_s)) = t_s \int_{t_s}^\infty \lambda e^{-\lambda t}\ dt = t_s e^{-\lambda t_s}$$ and the maximum of this is at $t_s = 1/\lambda$.