First time Latex user here
I am trying to box a text plus math using the following code
\documentclass[]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{xcolor}
\begin{document}
\section{Section Title}
\fbox{
{\color{blue} This is a text \[x\]}
}
\boxed{
{\color{blue} This is a text \[x\]}
}
\end{document}
Unfortunately, in doing so, I received 10 errors.
Can anyone help me debug these mere 6 lines of code?