I'm working through an exercise related to SDEs and I'm getting some conflicting results. Hoping someone can set me in the right direction. The problem:
Let $X_T = \cos(B_T)$ (where $B$ is Brownian motion or Wiener process). Find the process $\mu$ such that
$X_T = \mathbb{E}[X_T] + \int_0^T \mu_s \, dB_s$
and calculate $\mathbb{E}[X_T]$.
So, we can use a change of variable and consider that $X_T = e^{\frac{1}{2}t} \cos B_t$ and apply Ito:
$dX_t = -e^{\frac{1}{2}t}\sin B_t \, dB_t \iff d(e^{\frac{1}{2}t}\cos B_t) = -e^{\frac{1}{2}t} \sin B_t \, dB_t$, or
$e^{\frac{1}{2}T} \cos B_t = \int_0^T-e^{\frac{1}{2}t} \sin B_t \, dB_t \iff \cos(B_t) = \int_0^T-e^{\frac{1}{2}(t-T)} \sin B_t \, dB_t$
So, we have shown $\cos(B_t)$ is equivalent to just a stochastic integral, that is, it is a martingale with no drift and thus no expectation.
But, I've been searching around and it seems that a direct expectation on $\cos(B_t)$ yields $e^{\frac{-t}{2}}$?
When you rewrote the differential equation as an integral equation you forgot the initial condition. Please be more careful about notation (e.g. whether it is $t$ or $T$)
If we set $f(t,x) := e^{t/2} \cos(x)$, then $Y_t := f(t,B_t)$ satisfies by Itô's formula
$$dY_t = - e^{t/2} \sin(B_t) \, dB_t.$$
This is equivalent to saying
$$Y_T \color{red}{-Y_0} =- \int_0^T e^{t/2} \sin(B_t) \, dB_t.$$
Note that $Y_0 = e^0 \cos(0)=1$. Multiplying both sides with $e^{-T/2}$, we find
$$\cos(B_T) - e^{-T/2} = - \int_0^T e^{(t-T)/2} \sin(B_t) \, dB_t.$$
Hence,
$$X_T = \cos(B_T) = e^{-T/2} - \int_0^T e^{(t-T)/2} \sin(B_t) \, dB_t.$$
This shows, in particular, $\mathbb{E}(X_T) = e^{-T/2}$.