Find $\mathbb{E}_{X_0 = x} X_\tau$ for an Ornstein-Uhlenbeck process $(X_t)_{t \geq 0}$ where $\tau = \inf\{t>0 \mid X_t \notin [a,b]\}$ Let $X_t$ satisfy the following SDE: $dX_t = X_t dt + \sigma dB_t$, $\sigma$ is a  constant and $B_t$ is Brownian Motion.
Find $\mathbb{E}_{X_0 = x} X_\tau$ where $\tau = \inf\{t>0 \mid X_t \notin [a,b]\}$
Having a bit of trouble with this and hoping someone can help me out. 
 A: Hints: Fix $x \in [a,b]$. Instead of $\mathbb{E}_{X_0=x}$ I will use the notation $\mathbb{E}^x$.


*

*Suppose that $f \in C_b^2$ solves the differential equation $$x f'(x) + \frac{\sigma^2}{2} f''(x)=0. \tag{1}$$ Show, using Itô's formula, that $(f(X_t))_{t \geq 0}$ is a martingale.

*Define $$f(x) := \Phi \left( \frac{2}{\sigma} x \right)$$ where $$\Phi(x) := \frac{1}{\sqrt{2\pi}} \int_{-\infty}^x \exp \left(- \frac{z^2}{2} \right) \, dz$$ denotes the cumulative distribution function of the standard Gaussian distribution. Check that $f$ satisfies $(1)$.

*Apply the optional stopping theorem and the dominated convergence theorem to conclude that $$\mathbb{E}^x f(X_{\tau}) = f(x).$$

*Since $(X_t)_{t \geq 0}$ has continuous sample paths and $X_0 = x \in [a,b]$, it holds that $X_{\tau} \in \{a,b\}$. Deduce from step 3 that $$f(b) \mathbb{P}^x(X_{\tau}=b) + f(a) \mathbb{P}^x(X_{\tau}=a) = f(x). \tag{2}$$

*We have, $$\mathbb{P}^x(X_{\tau}=a) + \mathbb{P}^x(X_{\tau}=b)=1. \tag{3}$$ Equations $(2)$ and $(3)$ form a system of linear equations. Solve it.

*Finally, $$\mathbb{E}^x(X_{\tau}) = a \mathbb{P}^x(X_{\tau}=a) + b \mathbb{P}^x(X_{\tau}=b).$$


Remark: The solution of this SDE is called Ornstein-Uhlenbeck process. 
