Stochastic Calculus Question I'm new here and was hoping someone could help me answer this question. I'm reading a paper and I'm a bit confused on how they go from 1 equation to the next. They say:
Let
\begin{align}
x(t) = {} & \exp\left\lbrace \int_0^t \left[\frac{\alpha(s)^2}{2} - a(s) \right] \, ds - \alpha(s) \, dB(s)\right\rbrace \\
& \times \left[ x_0 + \int_{0}^{t} b(s)\exp\left\lbrace \int_0^s \left[ a(\tau)-\frac{\alpha(\tau)^2}{2}\right] \, d\tau + \alpha(\tau) \, dB(\tau) \right\rbrace \, ds \right]
\end{align}
Then $x(t)$ satisfies the equation:
$$dx(t) = [(\alpha(t)^2 - a(t))\, dt - \alpha(t)\,dB(t)]x(t) + b(t)\,dt$$
Now I worked through this, but when I use their $x(t)$ and calculate $dx(t)$, I get the following:
$$dx(t) = \left[\left(\frac{\alpha(t)^2}{2} - a(t)\right) \,  dt - \alpha(t)\,dB(t)\right]x(t) + b(t)\,dt$$
Here, $a(t), b(t),$ and $\alpha(t)$ are all T-periodic functions. The only difference is that extra $\frac{1}{2}$ I have where they don't. Likewise, if I start with their $dx$ and integrate, I get:
\begin{align}
x(t) = {} & \exp\left\lbrace \int_0^t \left[\alpha(s)^2 - a(s) \right] \, ds - \alpha(s) \, dB(s)\right\rbrace \\
& \times \left[ x_0 + \int_0^t b(s)\exp\left\lbrace \int_0^s \left[ a(\tau)-\alpha(\tau)^2\right] \, d\tau + \alpha(\tau)\,dB(\tau)\right\rbrace \, ds \right]
\end{align}
And now that extra $\frac{1}{2}$ is missing. That $\frac{1}{2}$ is very important for the rest of the paper, and I can't figure out where it goes. Can anyone please help?
 A: Let $\ \text df_s = -(\frac{\alpha_s^2}{2}-a_s)\text ds + \alpha_s\text dB_s\ $ and consider that, by the product rule, we have
$$
\text d\Big(x_se^{f_s}\Big) = (\text d x_s) e^{f_s} + x_s\text d(e^{f_s}) + \text d\langle x, e^{f}\rangle_{s}\tag{1}
$$
Now, since $\text dx_s = ((\alpha_s^2 - a_s)\text ds - \alpha_s\text dB_s)x_s+b_s\text ds$, observe that 

$\text d(e^{f_s}) = e^{f_s}\Big(\text df_s + \frac{1}{2}\text d\langle f \rangle_s\Big) = e^{f_s}\Big(\frac{1}{2}\alpha_s^2\text ds-\frac{\text dx_s-b_s\text ds}{x_s} + \frac{1}{2}\alpha_s^2\text ds \Big) = e^{f_s}\Big(\alpha_s^2\text ds-\frac{\text dx_s-b_s\text ds}{x_s} \Big)\,,\tag{2}$

and

$$\text d\langle x,e^{f} \rangle_s = -e^{f_s}\alpha_s^2x_s\text ds\,.\tag{3}$$

Using (2) and (3) in (1) gives
$$
\text d\Big(x_se^{f_s}\Big) = e^{f_s}b_s\text ds\,.
$$
Therefore,

$$x_te^{\int_{0}^{t}-(\frac{\alpha_s^2}{2}-a_s)\text ds + \int_{0}^{t}\alpha_s\text dB_s}-x_0 = \int_{0}^{t}b_se^{\int_{0}^{s}-(\frac{\alpha_r^2}{2}-a_r)\text dr + \int_{0}^{s}\alpha_r\text dB_r}\text ds$$


One way to compute $\text d \langle x, e^f \rangle_s$ is by using (2) and the stated definition of $\text dx_s$. Formally, we have
$$
\begin{eqnarray*}
  \text d\langle x, e^f\rangle_s &=& \text dx_s\cdot\text de^{f_s} = \text dx_s\cdot \Big(-e^{f_s}\frac{\text dx_s}{x_s}+e^{f_s}(\frac{b_s}{x_s}+\alpha_s^2)\text ds\Big) \\
&=& -e^{f_s}\frac{\text dx_s\cdot\text dx_s}{x_s}+e^{f_s}(\frac{b_s}{x_s}+\alpha_s^2)\text dx_s\cdot\text ds \\
&=& -e^{f_s}\frac{\text d\langle x\rangle_s}{x_s}+e^{f_s}(\frac{b_s}{x_s}+\alpha_s^2)\text d\langle x, s\rangle_s = -e^{f_s}\frac{\alpha_s^2x_s^2\text ds}{x_s} \\
&=& -e^{f_s}\alpha_s^2x_s\text ds.
\end{eqnarray*}
$$  

To obtain a preferred form of $f$ one might start by positing the existence of an "integrating factor" $e^{f_s}$, in terms of some as yet to be determined Ito process, $\text df_s = u_s\text ds + v_s\text dB_s$, such that the Ito process defined by the SDE $\text dx_s$ satisfies
$$
\text d(x_se^{f_s}) = e^{f_s}\text dx_s-x_sge^{f_s} =  e^{f_s}b_s\text ds\tag{4} 
$$ 
where $g=((\alpha_s^2 - a_s)\text ds - \alpha_s\text dB_s)$. But, using (1) in the lhs of (4), we necessarily require
$$
e^{f_s}\text dx_s-x_sge^{f_s} = (\text d x_s) e^{f_s} + x_s\text d(e^{f_s}) + \text d\langle x, e^{f}\rangle_{s}.\tag{5}
$$
From (5), by substituting the forms of $g$, $\text df_s$, $\text dx_s$, and ignoring terms with zero quadratic (co)variation, we obtain
$$
\Big(u_s + \frac{1}{2}v_s^2 - \alpha_sv_s + \alpha_s^2 - a_s\Big)\text ds +(v_s-\alpha_s)\text dB_s = 0,\ \forall s
$$ 
from which the forms of $u_s$ and $v_s$ can be immediately deduced. We can now see that we require 

$$
\text df_s = -\Big(\frac{\alpha^2_s}{2}-a_s\Big)\text ds + \alpha_s\text dB_s\,. 
$$

