Calculate the expection and variance using Ito's Lemma Let $x_k$ be a Ito process defined by the equation $dx_t=-ax_tdt+\sigma dB_t$, where a is a real constant, $\sigma$ is a positive real constant and $B_t$ is a standard Brownian motion. Let $x_t=x_0$ at $t=0$.
By applying Ito's Lemma on $y_t=f(t)x_t$, where $f(t)$ is a deterministic function of $t$, show that,
i) the expectation value of $x_t$ is $x_0e^{-at}$,
ii) the variance of $x_t$ is $\frac{\sigma^2}{2a}(1-e^{-2at})$. 
I tried to substitute $y_t=f(t)x_t$ into the Ito's Lemma, gives
\begin{equation}
dy=\left(-a y_t + \frac{\partial f(t)}{\partial t}x_t\right) dt + \sigma f(t) dB_t\end{equation} 
What should I do next?
 A: You have $$y_t=f(0)x_0+\int_0^t (f'(s)x_s-ay_s)\,ds+\sigma\int_0^t f(s)\,dB_s.$$ Take $f(t)=e^{at}$. In this way, you have $f'(s)x_s-ay_s=0$ and therefore $$e^{at}x_t=x_0+\sigma\int_0^t e^{as}\,dB_s\Rightarrow x_t=e^{-at}\left(x_0+\sigma\int_0^t e^{as}\,dB_s\right).$$
When you have a deterministic function $f\in L^2[0,t]$, one has $\int_0^t f(s)\,dB_s\sim N(0,\Vert f\Vert_{L^2[0,t]}^2)$. Hence,
$$ x_t\sim N\left(e^{-at}x_0,\,e^{-2at}\sigma^2\int_0^t e^{2as}\,ds=\frac{1-e^{-2at}}{2a}\sigma^2\right).$$
A: $$y_t=f(t).x_t \to g(t,x)=f(t).x \\ \frac{\partial g}{\partial t}=f'(t).x\\\frac{\partial g}{\partial x}=f(t).1\\\frac{\partial^2 g}{\partial x^2}=0$$ 
I don't find any clue ... but by other observation I can solve it ...let me say to you 
$$\times e^{at} \to e^{at}dx_t=-ae^{at}x_tdt+\sigma e^{at} dB_t\\
e^{at}dx_t+ae^{at}x_tdt=\sigma e^{at} dB_t\\d(e^{at}x_t)=\sigma ae^{at} dB_t\\$$ now apply integral
$$t \in [0,t] \to \int d(e^{as}x_s)=\int \sigma e^{at} dB_s\\e^{at}x_t-e^{0}x_0=\sigma \int_{0}^{t} e^{at} dB_s \\ \to
e^{at}x_t=x_0+\sigma \int_{0}^{t} e^{at} dB_s \to \div e^{at} \\x_t=x_0e^{-at}+\sigma e^{-at}\int_{0}^{t} e^{at} dB_s $$ now 
\begin{align}
  & E[{{x}_{t}}]=E[{{x}_{0}}{{e}^{-at}}+\sigma {{e}^{-at}}\int_{0}^{t}{\,{{e}^{as}}d{{B}_{s}}]} \\ 
 & E[{{x}_{t}}]=E[{{x}_{0}}{{e}^{-at}}]+\sigma E[{{e}^{-at}}\int_{0}^{t}{\,{{e}^{as}}d{{B}_{s}}]} \\ 
\end{align}
$\color{red} {E[\int_{0}^{t}{\,{{e}^{b(s-t)}}d{{B}_{s}}]}=0}$
\begin{align}
  & E[{{x}_{t}}]=E[{{x}_{0}}{{e}^{-at}}]+\sigma .(0) \\ 
 & E[{{x}_{t}}]=E[{{x}_{0}}].{{e}^{-at}} \\ 
\end{align}
$Var\left[ {{X}_{t}} \right]=E\left[ X_{t}^{2} \right]-{{E}^{2}}\left[ {{X}_{t}} \right]$
$\begin{align}
  & E\left[ X_{t}^{2} \right]=E[({{x}_{0}}{{e}^{-at}}+\sigma {{e}^{-at}}\int_{0}^{t}{\,{{e}^{as}}d{{B}_{s}}{{)}^{2}}]} \\ 
 & =E[{{({{x}_{0}}{{e}^{-at}})}^{2}}+(\sigma {{e}^{-bt}}\int_{0}^{t}{\,{{e}^{as}}d{{B}_{s}}{{)}^{2}}+2({{x}_{0}}{{e}^{-at}})(\sigma {{e}^{-at}}\int_{0}^{t}{\,{{e}^{as}}d{{B}_{s}}{{)}^{{}}}]}} \\ 
\end{align}$
$\begin{align}
  & {{e}^{-2at}}E\left[ X_{0}^{2} \right]+2\sigma {{e}^{-at}}E\left[ {{X}_{0}} \right]E\left[ \int_{\,0}^{\,t}{{{e}^{-a(t-s)}}\,d{{B}_{s}}} \right]+{{\sigma }^{2}}E\left[ {{\left( \int_{\,0}^{\,t}{{{e}^{-a(t-s)}}\,d{{B}_{s}}} \right)}^{2}} \right] \\ 
 & ={{e}^{-2at}}E\left[ X_{0}^{2} \right]+{{\sigma }^{2}}E\left[ \int_{\,0}^{\,t}{{{e}^{-2a(t-s)}}\,ds} \right] \\ 
\end{align}$ 
$={{e}^{-2at}}E\left[ X_{0}^{2} \right]+{{\sigma }^{2}}\frac{1-{{e}^{-2at}}}{2a}$ $\to \\$ 
  VAR 
$={{e}^{-2at}}Var\left[ {{X}_{0}} \right]+\frac{{{\sigma }^{2}}}{2a}\left( 1-{{e}^{-2at}} \right)$
