# Girsanov theorem calculations help

I need help to understand a couple of calculations in this Girsanov theorem related SDE problem. I have five questions as stated below.

Let $X_t$ solve the Ornstein-Uhlenbeck equation $$dX_t = X_t\, dt + dB_t, \quad X_0 = x$$ and show: $$E[f(X_t)] = E\left[\exp\left\{\frac{1}{2}(W_t^2-t)+xW_t - \int_0^t(W_s + x)^2ds\right\}f(W_t+x)\right]$$

The solution specifies that we set:

$dX_t = dW_t, \quad X_0 = x$

Question 1: How do we know what to set $dX_t$ to?

We use Girsanov transformation

$dQ = L(T)dP$

where

$dL_t = X_t L_t dW_t$ $L_0 = 1$

The Girsanov theorem then tells us that $$dW_t = X_tdt + dB_t$$ where $B$ is a $Q$-Brownian motion. The SDE for X thus becomes $$dX_t = X_tdt + dB_t,$$ which means that $$X_t = x + \int_0^t X_s ds + B_t.$$

Question 2: Is this not the same as given in the problem statement? In this case why did we need to use Girsanov to draw this circle conclusion?

Now using that $Z \in F_t$ then:

$$E^Q[Z] = E^P[L_tZ]$$

Question 3: How do we know this?

we obtain $$E^Q[f(X_t)] = E^P[L_tf(X_t)].$$ The solution of $dL_t$ with $L_0 = 1$ is given by $$L_t = \exp \left\{\int_0^t X_s dW_s - \frac{1}{2} \int_0^t X_s^2 ds\right\}.$$

Question 4: how does the term $-\frac{1}{2}\int_0^t X_s^2 ds$ get there?

From calculations I only get: $$dL_t = X_tL_tdW_t, \quad L_0 = 1\\ \ln(L_t) = \int_0^tX_s dW_s + L_0 = \int_0^tX_s dW_s + 1\\ L_t = \exp\left\{\int_0^tX_s dw_s + 1\right\},$$ which is not the same as stated in the problem solution.

Now lastly using $X_t = x + W_t$ under $P$ we obtain $$\int_0^t X_s dW_s = \int_0^t (x+W_t) dW_s = \int_0^t x dW_s + \int_0^t W_tdW_s = xW_t + \frac{1}{2}(W_t^2 - t).$$

Question 5: How do we find that: $$\int_0^t W_t dW_s = \frac{1}{2}(W_t^2 -t ).$$

Now inserting this gives the expectation as asked for.

Question 1 (Girsanov's theorem) Let $W_t$ be a Brownian motion under the physical measure $\mathbb{P}$. Define $$L_t := \exp \left\{-\int_{0}^{t} X_s dW_s - \frac{1}{2} \int_{0}^{t} X_s^2ds \right\},$$ and define an equivalent martingale measure $\mathbb{Q}$ by setting $d\mathbb{Q}/d\mathbb{P} = L_t$, then $B_t = W_t + \int_{0}^{t} X_s ds$ is a standard Brownian motion under $\mathbb{Q}$.
Question 2+3 It follows from Girsanov's theorem: for any measurable subset $A$ $$\mathbb{E}_{\mathbb{Q}}[Z] = \int_{A} Z d\mathbb{Q} = \int_{A} Z L_t d\mathbb{P}.$$
Question 4 It's how $L_t$ is defined, show instead by applying Ito's lemma that $dL_t:= -L_t X_t dW_t$.
Question 5 This follows by Ito's formula. If $f$ is a twice differentiable real valued function then $$f(W_t) = f(W_0) + \int_{0}^{t} f'(W_s)dW_s + \frac{1}{2} \int_{0}^{t} f''(W_s)ds.$$ Apply Ito's formula to $f(x) = x^2$ and the result follows.