Show that this continuous local martingale is a martingale We are given the following SDE:
$$dX_t=X_tdt+\sqrt{2}X_tdB_t, \quad X_0=1,$$
and
$$F(x,t)=e^{-t}x,\quad t\geq0,\; x\in\mathbb{R}.$$
We are asked to apply Ito's formula to $F(t,X_t)$ for $t\geq0$ and determine a continuous local martingale $(M_t)_{t\geq0}$ (starting at $0$) and a continuous bounded variation process $(A_t)_{t\geq0}$ such that $F(t,X_t)=M_t+A_t$ for $t\geq0$.
If I am correct, $M_t=\int_0^tF_x(s,X_s)dX_s=\int_0^te^{-s}ds+\sqrt{2}\int_0^te^{-s}dB_s$, $t\geq0$
Now, we need to show that $M_t$ is a martingale and compute $\langle M,M\rangle_t$ and $\mathbb{E}[e^{-\tau}X_\tau]$ when $\tau=\inf\{t\geq0:X_t=2-t\}$ but I don't know how! Any help would be appreciated!
 A: It's not difficult to see that
$$X_t := \exp \left(\sqrt{2} B_t \right)$$
solves the given SDE. (You can either use Itô's formula to check it or use some standard methods for linear SDE's to obtain this solution.) Moreover, by Ito's formula:
$$f(t,X_t)-\underbrace{f(0,x_0)}_{x_0} = \sqrt{2} \int_0^t e^{-s} \cdot X_s \, dB_s + \int_0^t e^{-s} \cdot X_s + (-e^{-s} \cdot X_s) \, ds \\ = \sqrt{2} \int_0^t e^{-s} \cdot e^{\sqrt{2} B_s} \,dB_s \\ \Rightarrow f(t,X_t) = \underbrace{\sqrt{2} \int_0^t e^{\sqrt{2} B_s-s} \,dB_s}_{M_t} + \underbrace{x_0}_{A_t}$$
where $x_0=1$. Let
$$g(s,w) := \sqrt{2} \cdot e^{\sqrt{2} B(s,w)-s}$$
Then $g \in L^2(\lambda_T \otimes \mathbb{P})$, i.e.
$$\int_0^T \int_\Omega g(s,w)^2 \, d\mathbb{P} \, ds <\infty$$
There is a general result which says that this condition implies that $M_t$ is a martingale (and not only a local one). Moreover,
$$\langle M,M \rangle_t = \int_0^t |g(s,w)|^2 \, ds$$
(see René L. Schilling/Lothar Partzsch: "Brownian Motion - An Introduction to stochastic processes", Theorem 14.13). 
Concerning the integral $\mathbb{E}(e^{-\tau} \cdot X_\tau)$: Remark that
$$\tau = \inf\{t \geq 0; X_t=2-t\} = \inf\{t \geq 0; \sqrt{2} B_t = \ln(2-t)\}$$
Now let
$$\sigma := 2\tau = \inf\{t \geq 0; \underbrace{\sqrt{2} B_{\frac{t}{2}}}_{=:W_t} = \ln (2-t/2)\}$$
where $(W_t)_{t \geq 0}$ is again a Brownian Motion (scaling property). Thus
$$\mathbb{E}(e^{-\tau} \cdot X_\tau) = \mathbb{E}(e^{-\tau+\sqrt{2} B_\tau}) = \mathbb{E}(e^{-\frac{\sigma}{2}+W_\sigma}) \stackrel{\ast}{=} 1$$
In $(\ast)$ we applied the exponential Wald identity (see remark).
Remark Exponential Wald identity: Let $(W_t)_{t \geq 0}$ a Brownian motion and $\sigma$ a $\mathcal{F}_t^W$-stopping time such that $\mathbb{E}e^{\sigma/2}<\infty$, then $\mathbb{E}(e^{W_\sigma-\frac{\sigma}{2}})=1$. (see René L. Schilling/Lothar Partzsch: "Brownian Motion - An Introduction to stochastic processes", Theorem 5.14)
