Let $(B_t)_{t \geq 0}$ be a standard Brownian motion and $M_t = B_t^2 - t$.
According to this and this posts we know that \begin{align} [M] = [B^2] = 2 \int_0^t B_s^2\ ds. \end{align} Now, without appealing to the fact that $M^2 - [B^2] = M^2 - [M]$ is a martingale by definition, I want to prove that $M^2 - [B^2]$ is a martingale using Itô's formula and the above result.
Therefore, I apply Itô's formula to $M_t^2 = (B_t^2 -t)^2 = f(t, B_t)$. \begin{align} f(t,B_t) &= f(0,B_0) + \int_0^t f_s'(s,B_s)\ ds + \int_0^t f_{B_s}'(s,B_s)\ dB_s + \frac{1}{2} \int_0^t f_{B_s,B_s}''(s,B_s) ds \end{align} gives that \begin{align} (B_t^2 -t)^2 &= -2 \int_0^t (B_s^2 -s)\ ds+ 4 \int_0^t B_s(B_s^2 -s)\ dB_s + \frac{1}{2} \int_0^t \big(4(B_s^2 - s) + 4B_s \cdot 2B_s \big) ds \\ &= -2 \int_0^t B_s^2\ ds + 2 \int_0^t s\ ds + 4 \int_0^t B_s^3\ dB_s -4 \int_0^t s B_s\ dB_s + 6 \int_0^t B_s^2\ ds -2 \int_0^t s\ ds \\ &= 4 \int_0^t B_s^2\ ds + 4 \int_0^t B_s^3\ dB_s -4 \int_0^t s B_s\ dB_s. \end{align} So, subtracting $2 \int_0^t B_s^2\ ds$ from $(B_t^2 -t)^2$ should give the required result. However, there is a problem with the coefficients. Where did I go wrong?