The LaTeX macros \begin{equation} and \[ both initiate a display-math group, and the macros \end{equation} and \] both terminate a display-math group. (In addition, the equation environment provides a method for numbering the equations, whereas \[ ... \] does not.) The LaTeX macros \begin{equation} and \[ are designed purposefully so as not to let users open a display-math group twice; this is why you're getting the error message "Bad math environment delimiter" when LaTeX encounters \[ after having processed \begin{equation}.
The upshot: Use one or the other method for setting up a display-math group, but don't use both simultaneously.
For a more-detailed discussion of how various LaTeX displaymath environments are set up, see this answer to the question "What are the differences between $$, \[, align, equation and displaymath?" Shameless self-citation alert!
Best Answer
let me convert my comment to an answer:
\begin{equation} ... \end{equation}
inside\begin{displaymath} ... \end{displaymath}
,$
inside equation is not allowed (it is intend for use for math expression in text)where is, as noted Mico in his comment below,
\[ ... \]
entirely equivalent to\begin{displaymath} ... \end{displaymath}
.or an alternative to the leandriis answer, as suggested Bernard in his comment below:
which gives:
and one more (final) alternative :-), as suggested barbara beeton in her comment below:
which gives