I am working through an answer to the following question and do not understand an expectation which takes place at the end.
$\textbf{Question:}$ Define the following stochastic process \begin{align} \tilde{W}(t) := W(t) + \int_{0}^{t} e^{W(s)}\mathbb{1}_{\{|W(s)\le 1\}}\,ds \quad \forall \, t \in [0,T] \end{align}
For the stopping time $\tau := \inf\{t \ge 0 : |W(t)| = 1\}$ compute $\mathbb{E}_{P}[\tilde{W}(\tau)]$.
\begin{align} \end{align}
Being as concise as possible the results I have so far are: \begin{align} \mathbb{E}_P[W(\tau)] &= -1P(W(\tau) = -1) + 1P(W(\tau) = 1)\\ &= -1\tfrac{1}{2} + 1\tfrac{1}{2}\\ &= 0 \end{align} Thus, \begin{align} \mathbb{E}_P[\tilde{W}(\tau)] &= \mathbb{E}_P\left[W(\tau) + \int_{0}^{\tau} e^{W(s)}\mathbb{1}_{\{|W(s)\le 1\}}\,ds \right]\\ &= \mathbb{E}\left[\int_{0}^{\tau}e^{W(s)}\,ds\right] \end{align} From ito, \begin{align} e^{W(s)} &= 1 + \int_{0}^{t} e^{W(s)}dW(s) + \tfrac{1}{2}\int_{0}^{t}e^{W(s)}\,ds \end{align} Hence, \begin{align} \int_{0}^{\tau} e^{W(s)}ds = 2e^{W(\tau)} -2 - 2\int_{0}^{\tau}e^{W(s)}dW(s) \end{align}
For brevity let us assume $\mathbb{E}[\int_{0}^{\tau}e^{W(s)}dW(s)] = 0$.
Then \begin{align} \mathbb{E}\left[\int_{0}^{\tau} e^{W(s)}ds\right] &= \mathbb{E}\left[2e^{W(\tau)} -2 - 2\int_{0}^{\tau}e^{W(s)}dW(s) \right]\\ &= 2\mathbb{E}\left[e^{W(\tau)} \right] - 2\\ &= 2 \cdot \tfrac{1}{2}(e^{+1} + e^{-1}) - 2\\ \end{align} Hence, \begin{align} \mathbb{E}[\tilde{W}(\tau)] = (e^{+1} + e^{-1}) - 2 \end{align}
$\textbf{My Question:}$ It appears $\mathbb{E}[e^{W(\tau)}] = \tfrac{1}{2}(e^{+1} + e^{-1})$, I do not understand why this is the case. I am familiar with the result $\mathbb{E}[\exp(cW(t))] = \exp(\tfrac{1}{2}c^2 t)$ but cannot see the application here. Would someone be able to explain please?
Apologies if this is trivial. All help is appreciated.
Many thanks,
John
Since $\mathbb{E}W_{\tau}=0$ and $W_{\tau} \in \{1,-1\}$, we have
$$0 = \mathbb{E}(W_{\tau}) = \mathbb{E}(1 \cdot 1_{\{W_{\tau}=1\}} + (-1) \cdot 1_{\{W_{\tau}=-1\}}) = \mathbb{P}(W_{\tau}=1) - \mathbb{P}(W_{\tau}=-1).$$
Hence,
$$\mathbb{P}(W_{\tau}=1) = \mathbb{P}(W_{\tau}=-1) = \frac{1}{2}.$$
This implies
$$\mathbb{E}f(W_{\tau}) = \frac{1}{2} (f(1)+f(-1))$$
for any measurable function $f$.