Quadratic variation of semi-martingale 
$X_t = e^{B_t-\frac{1}{2}t^2}$
I need to find $[X]_t$, the quadratic variation process. I have tried to solve the problem and my main question is whether this approach is correct or not.

Given that
$$
\begin{equation}
\begin{split}
dX_t=&-tX_tdt+X_tdB_t+\frac{1}{2}X_td[B]_t \\
=&\left(\frac{1}{2}-t\right)X_tdt+X_tdB_t 
\end{split}
\end{equation}
$$.
$[X]$ is the unique process such that $X^2-[X]$ is a martingale.
$d( X^2_t)=2X_tdX_t+d[X]_t$

How do I compute $d[X]_t$ more rigorously than saying $dX_tdX_t=X_t^2dt$ because $dt\cdot dt=0$, $dt\cdot dB_t=0$, $dB_t\cdot dB_t=t$? 

Now integrate from $0$ to $t$ and substitute in $dX_s$ (above)
$$
\begin{equation}
\begin{split}
X^2_t-X^2_0=&2\int_0^tX_sdX_s+\int_0^tX_s^2ds \\
=&\int_0^t X_s^2 \left(1-2s\right)ds+2\int_0^t X_s^2dB_s + \int_0^t X^2_s ds\\
&=2\int_0^t X_s^2 \left(1-s\right)ds + 2\int_0^t X_s^2 dB_s
\end{split}
\end{equation}
$$

So it would seem that since the stochastic integral $2 \int_0^t X^2_s dB_s$ is a martingale, by uniqueness and since $X_0^2 = 1$, we have that $[X]_t=1+2\int_0^t X_s^2\left( 1-s \right) ds.$ Is this correct?

 A: The trouble is that there are two types of brackets, $\langle X \rangle_t$ (which I call angle bracket) and $[X]_t$ (sharp/square bracket). In this particular case they do not coincide because $(X_t)_{t \geq 0}$ is not a martingale (see also this answer).

$[X]$ is the unique process such that $X^2-[X]$ is a martingale.
$d(X_t^2) = 2X_t \, dX_t + d[X]_t$

These two characterizations are only equivalent if $(X_t)_{t \geq 0}$ is a martingale. For a semimartingale (with continuous sample paths) the sharp bracket $[X]_t$ is defined as
$$[X]_t := X_t^2-X_0^2 -2 \int_0^t X_s \, dX_s. \tag{1}$$
As long as $(X_t)_{t \geq 0}$ is not a martingale, we cannot expect that the process
$$X^2_t-[X]_t = X_0^2 + 2 \int_0^t X_s \, dX_s$$
is a martingale.
For your particular example, we obtain from Itô's formula that
$$X_t^2-X_0^2 = 2 \int_0^t X_s \, dX_s + \int_0^t X_s^2 \, ds,$$
so that, by $(1)$,
$$[X]_t = \int_0^t X_s^2 \, ds.$$ More generally, if $(X_t)_{t \geq 0}$ is an Itô process of the form
$$dX_t = b(t) \, dt + \sigma(t) \, dB_t,$$
then
$$[X]_t = \int_0^t \sigma^2(s) \, ds.$$
