Ito formula applied to $\frac{1}{t}\int_0^t W_s ds $ I got this expression and I have to calculate its differential by the Ito formula, $W_t$ denotes the Brownian motion:
$$\frac{1}{t}\int_0^t W_s ds $$
I calculate the derivative of $f(t,x)=\frac{1}{t}\int_0^t x ds $ with respect to $t$ getting $\partial_t f=\frac{x}{t}-\frac{\int_0^t xds}{t^2}$ but I can't derive with respect to $x$: I only got $\partial_x f=( x\frac{\int_0^t ds}{t})'=(x\frac{t}{t})'=1 $ but I really don't think it is correct. 
Can you help me?
 A: First of all,
$$X_t := \int_0^t W_s \, ds \tag{1}$$
is an Itô process, i.e. an process of the form
$$Y_t - Y_0 = \int_0^t \sigma_s \, dW_s + \int_0^t b_s \, ds$$
(here $\sigma_t =0$, $b_t = W_t$). For an Itô process $(Y_t)_{t \geq 0}$ Itô's formula reads
$$f(Y_t)-f(Y_0) = \int_0^t f'(Y_s) \, dY_s +  \int_0^t f(Y_s) + \frac{1}{2} f''(Y_s) \, d \langle Y \rangle_s \tag{2}$$
where (by definition)
$$dY_t = \sigma_t \, dW_t + b_t \, dt \qquad \qquad d\langle Y \rangle_t = \sigma_t^2 \, dt.$$
Now note that $Y_t := (t,X_t)$ defines again an Itô process. If we apply $(2)$ and use $(1)$, we get that
$$f((t,X_t))-f((0,X_0)) = \int_0^t f_x((s,X_s)) W_s \, ds + \int_0^t f_t((s,X_s)) \, ds.$$
(Here $f_x$ denotes the derivative with respect to $x$ and $f_t$ the derivative with respect to $t$.) In particular, if we choose $f(t,x) := \frac{1}{t} \cdot x$ we find
$$\frac{1}{t} \int_0^t W_s \, ds = \int_0^t \frac{1}{s} W_s \, ds - \int_0^t \frac{1}{s^2} X_s \, ds.$$

Remark Note that Itô's formula is rather overkill. In fact, since $t \mapsto W_t$ continuous we see from fundamental theorem that $$t \mapsto X_t = \int_0^t W_s \, ds$$ is differentiable. Hence,
$$\frac{X_t}{t} = \int_0^t \left(\frac{d}{ds} \frac{X_s}{s} \right) \, ds$$
where, by the product rule,
$$\frac{d}{ds} \frac{X_s}{s} = - \frac{1}{s^2} X_s + \frac{W_s}{s}.$$ 
