show that $\mathbb{E}_{x}\left[e^{-\lambda T_{0}} \mathbf{1}_{T_{0}Let $B$ be a Brownian Motion starting at $0$ and let $\lambda$ be a real number. Define $M_{t}^{\lambda}=e^{\lambda B_{t}-\lambda^{2} t / 2} .$ We recall that $T_{a}=\inf \left\{t \geq 0, B_{t}=a\right\}$


*

*Prove that the process $\left(M_{t}^{\lambda}\right)_{t>0}$ is a $\left(\mathcal{F}_{t}^{B}\right)_{t \geq 0^{-}}$ -martingale.


I was able to do this question, in addition to being a martingale it is also bounded in $L^1$, which means that according to Doob's convergence theorem, there exists $M_{\infty}$ such that $M^{\lambda}_t \to M_{\infty}$ a.s., not sure if this is going to help for what's next though.


*We denote by $\mathbb{P}_{x}$ the law of $\left(x+B_{t}\right)_{t \geq 0},$ i.e. the law of a standard Brownian motion starting at $x \in \mathbb{R} .$ Show that if $0 \leq x \leq a$ and $\lambda>0$ then 
$$
\mathbb{E}_{x}\left[e^{-\lambda T_{0}} \mathbf{1}_{T_{0}<T_{a}}\right]=\frac{\sinh ((a-x) \sqrt{2 \lambda})}{\sinh (a \sqrt{2 \lambda})} $$
I know we have to somehow apply the optional stopping theorem, but I can't figure out what is it this time.
 A: Since $\mathbb P(|B_t|=\infty)=0$ for all $t$ we have
$$
\mathbb E[|M_t^\lambda|] = \mathbb E[e^{\lambda B_t - \lambda^2 t/2}] = \frac{\mathbb E[e^{\lambda B_t}]}{e^{\lambda ^2t/2}}<\infty
$$
for all $t\geqslant 0$ and for $0\leqslant s<t$ we have
\begin{align}
\mathbb E[M_t^\lambda\mid \mathcal F_s] &= \mathbb E[e^{\lambda B_t -\lambda^2t/2}\mid \mathcal F_s]\\
&= \mathbb E[e^{\lambda B_s-\lambda^2 s/2 +\lambda(B_t-B_s) - \lambda^2(t-s)/2}\mid\mathcal F_s]\\
&= \mathbb E[e^{\lambda B_s-\lambda^2 s/2}e^{\lambda(B_t-B_s) - \lambda^2(t-s)/2}\mid\mathcal F_s]\\
&= \mathbb E[e^{\lambda B_s-\lambda^2 s/2}\mid\mathcal F_s]\mathbb E[e^{\lambda(B_t-B)s - \lambda^2(t-s)/2}\mid\mathcal F_s]\\
&= e^{\lambda B_s-\lambda^2 s/2}\mathbb E[e^{\lambda(B_t-B_s) - \lambda^2(t-s)/2}]\\
&= e^{\lambda B_s-\lambda^2 s/2},
\end{align}
since $B_t-B_s\sim\mathrm N(0,t-s)$ and hence the moment generating function of $B_t-B_s$ is $e^{\lambda^2(t-s)/2}$, so that $M_t^\lambda$ is a martingale. Write $$\tilde M_t^\lambda = \frac12\left(e^{\lambda B_t-\lambda^2t/2} - e^{-\lambda B_t-\lambda^2t/2} \right) = e^{-\lambda^2 t/2}\sinh(\lambda B_t),$$
which is a martingale as the sum of two martingales. Then stopping at $T=T_0\wedge T_a$, $\tilde M$ is bounded, so optional stopping yields
$$
\mathbb E_x[\tilde M_T^\lambda] = \mathbb E_x[\tilde M_0^\lambda] \implies \mathbb E[e^{-\lambda ^2 T/2}\sinh(\lambda (B_T+a))] = \mathbb E[e^{-\lambda^2 T/2}\sinh(\lambda(x+a))\mathsf 1_{\{T_a>T_0\}}] = \sinh(\lambda a),
$$hence $$\mathbb E[e^{-\lambda ^2 T/2}\mathsf 1_{\{T_a>T_0\}}] = \frac{\sinh(\lambda a)}{\sinh(\lambda(x+a))}. $$
From here you should be able to derive the desired result.
