[Tex/LaTex] Undefined control sequence error for sum expression in equation

math-mode

The below sum expression inside the equation throws an undefined control sequence error.

\begin{equation}
    \left\|x\left[t\right]-\textbf{1} F(X)\right\|^2 = \sum_{i = 1}^{n} \lambda_i^2t     \lvert x \left[ 0 \right] \rvert^2
\end{equation}

Error:

Undefined control sequence.

|^2 = \sum_{i = 1}^{n} \lambda_i^2t \lvert 
                                        x \left[ 0 \right] \rvert^2

My guess is I am doing something wrong with the \lvert or \lambda. Don't know exactly. Any suggestion on how to solve this issue will be very helpful.

Best Answer

You need to include \usepackage{amsmath}. The MWE below produces:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
    \left\|x\left[t\right]-\textbf{1} F(X)\right\|^2 = \sum_{i = 1}^{n} \lambda_i^2t     \lvert x \left[ 0 \right] \rvert^2
\end{equation}
\end{document}