TITLE: Tanaka-Meyer formula
QUESTION [6 upvotes]: I have a simple question about Tanaka-Meyer formula, I am having difficulty applying it. Let $X$ be a continous martingale vanishing at zero. From Tanaka-Meyer formula it holds $$d|X_t| = sgn(X_t)dX_t+d \Lambda^X_t(0)$$
where $\Lambda^X_t(0)$ is the local time accumulated by the process $X$ at the origin.  
I am interested in the process $Z = X^2$. From Itô's formula we have 
$$dZ_t = 2X_t dX_t + d \langle X \rangle_t.$$
Since obviously $Z = |Z|$ applying Tanaka-Meyer should have the same differential, however 
$$d|Z_t| = 2sgn(Z_t) X_t dX_t + sgn(Z_t)d \langle X \rangle_t + d \Lambda^Z_t(0) ,$$ 
and
$$dZ^+_t = 2*\mathbb{1}_{[Z_t>0]} X_t dX_t + \mathbb{1}_{[Z_t>0]}d \langle X \rangle_t + {1 \over 2} d \Lambda^Z_t(0) .$$ 
Applying the expected value to processes $|Z|$ and $Z^+$, I have
\begin{align}
\mathbb{E}[\int_0^T sgn(X^2_t)d\langle X \rangle_t +\Lambda^Z_t(0)  ] = \mathbb{E}[\int_0^T \mathbb{1}_{[X^2_t>0]}d\langle X \rangle_t +{1 \over 2}\Lambda^Z_t(0)]
\end{align}
which feels like that $\Lambda^Z_t(0) = 0 ~ a.s.$ Where is my reasoning wrong? I have been staring at it longer than I like to admit.

REPLY [2 votes]: Alternatively, use Corollary 1.9 in Revuz & Yor and $d\langle Z \rangle_t =  4 X_t^2 d \langle X \rangle_t$ (as Eldredge did) to write  \begin{align*}
\Lambda_t^Z(0) &= \lim_{\epsilon \downarrow 0} \frac{1}{\epsilon} \int_0^t 1_{\{ 0 \le Z_s < \epsilon\} }  d \langle Z \rangle_s \\
&= \lim_{\epsilon \downarrow 0} \frac{1}{\epsilon} \int_0^t 1_{\{ -\sqrt{\epsilon} < X_s < \sqrt{\epsilon} \}} 4 X_s^2 d \langle X \rangle_s \\
&\le 4 \lim_{\epsilon \downarrow 0}  \int_0^t 1_{ \{-\sqrt{\epsilon} < X_s < \sqrt{\epsilon}\} } d \langle X \rangle_s \\
&\le  4 ( \Lambda_t^X(0) +  \Lambda_t^{-X}(0)) \lim_{\epsilon \downarrow 0}    \sqrt{\epsilon} = 0 \quad \text{a.s.}
\end{align*} 
which implies $\Lambda_t^Z(0) = 0$ a.s.