Integral with respect to brownian motion Let $f$ be a continuous function on $[0,\infty)$ and $B_t$ be a standard Brownian motion. Define
$X_t=\int_0^t f(s) dB(s).$
a) Show that $X_t$ is Gaussian and computer its covariance $C(X_s, X_t)$
b) prove that $e^{(X_t - 1/2 C(X_t, X_t))}$ is a continuous time martingale.
I think I know how to show $X_t$ is Gaussian (basically expressing it as a sum of Brownian motion increments each of which is gaussian) is that right? 
I don't know how to derive the covariance and show that  $e^{(X_t - 1/2C(X_t, X_t))}$ is a martingale, any hint would be appreciated.
 A: *

*Covariance: As @Did pointed out, Itô's formula combined with the polarization identities (i.e. $a \cdot b = \frac{1}{4} ((a+b)^2-(a-b)^2)$) yields $$\mathbb{E} \left( \int g(r) \, dB_r \int h(r) \, dB_r \right) = \mathbb{E} \left( \int g(r) h(r) \, dr \right)$$ whenenever the expression is well-defined. Setting $g(r) := 1_{[0,t]}(r) f(r), h(r) := 1_{[0,s]}(r) f(r)$, we find $$\mathbb{E}(X_t X_s) = \mathbb{E} \left( \int_0^{s \wedge t} f(r)^2 \, dr \right) = \int_0^{s \wedge t} f(r)^2 \, dr$$ where the last inequality holds due to the fact that $f$ is deterministic. Consequently, $$C(s,t) = \int_0^{s \wedge t} f(r)^2 \, dr.$$

*Martingale property: This is a straightforward application of Itô's formula. In fact, we have for $F(t,x) := e^{x-G(t)}$, $$\begin{align*}& F(t,X_t)  - F(0,0) \\ &\quad= \int_0^t F(s,X_s) \, dX_s -  \int_0^t G'(s) F(s,X_s) \, ds + \frac{1}{2} \int_0^t F(s,X_s) f(s)^2 \, ds \end{align*}$$ for any differentiable (deterministic) function $G$. In particular, if we choose $G(t) = \frac{1}{2} C(t,t)$, then this shows $$F(t,X_t)-1 = \int_0^t F(s,X_s) \, dX_s.$$ The right-hand side is a martingale as a stochastic integral with respect to a martingale. This finishes the proof.

