Consider a d-dimensional Brownian motion X = (X-1 , . . . , X-d) and a func
tion F which belongs locally to the Sobolev space W-1,W-2. We prove an exte
nsion of Ito's formula where the usual second order terms are replaced by t
he quadratic covariations [f(k) (X), X-k] involving the weak first partial
derivatives f(k) of F. In particular we show that for any locally square-in
tegrable function f the quadratic covariations [f (X), X-k] exist as limits
in probability for any starting point, except for some polar set. The proo
f is based on new approximation results for forward and backward stochastic
integrals.