# \ensuremath (LaTeX2e)

\ensuremath{Text set in math mode}

The argument of the \ensuremath command is always set in math mode, regardless of the current mode. Note that math mode is not specifically invoked in the Text set in math mode.

Thus \ensuremath{$\alpha^2+\beta^2$} is not correct.
The correct form is \ensuremath{\alpha^2+\beta^2}.