# Error With Summation Formula

Below is the code I use:

\begin{center}
\begin{eqnarray}
$E_{n} = \dfrac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}$
\end{eqnarray}
\end{center}


However it produces many errors, and it does not give the equation a number. All equations before this were automatically assigned a number. However, this one does not have a number and produces many errors. The errors are:

Bad math environment delimiter. [ Missing \endgroup inserted.

...rac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}] Missing } inserted.

...rac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}] \begin{eqnarray} on input

line 344 ended by \end{equation*}. ...rac{1}{N}

\sum_{m}^{}[x(m)w(n-m)]^{2}]

Missing \$ inserted. ...rac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}]

And many more like these. What am I doing wrong here?

• You're using both \begin{eqnarray} and $, both of which start math mode. Remove the \[ and $. But you shouldn't use eqnarray either for reasons stated here. You don't seem to using an array of equations, so just use $$...$$ perhaps? Oct 25, 2022 at 18:44
• Also the \begin{center} ... \end{center} doesn't do anything here but make the spacing worse. Remove that too. Oct 25, 2022 at 18:47
• @frabjous thanks a lot it is finally fixed. Oct 25, 2022 at 18:51

I'm afraid you have really many errors and that looking at an introductory manual is needed. See https://tex.meta.stackexchange.com/a/8477/4427 for some pointers.

1. Math displays are centered by default, so center does almost nothing; almost in the sense that it does bad, because it marks an allowed page break point, which instead is not allowed before a math display.

2. eqnarray is deprecated and, in any case, it shouldn't be used for a single equation/formula.

3. eqnarray and the better environments defined by amsmath already initiate display math mode, so \[ is illegal inside them.

Just remove the wrong parts and use equation for the single equation.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
$$E_{n} = \frac{1}{N}\sum_{m}[x(m)w(n-m)]^{2}$$
\end{document}


• @egreg Thank you very much for your editing. Oct 27, 2022 at 19:45