\documentclass[10pt]{article}
\usepackage{amsmath}  % removing this bypasses the problem
\begin{document}
\begin{equation} % Using \[ instead is ok
y(n) = \langle x\rangle. % \qquad\hbox{($x$ real)}
\label{eq1}
\end{equation} % Using \] instead is ok
\begin{equation} % Using \[ instead is ok
y_2(n) 
\label{eq2}
= \langle x_2\rangle. % \qquad\hbox{($x$ real)}
\end{equation} % Using \] instead is ok
See eq.~\ref{eq1} and eq.~\ref{eq2}.


%http://tug.org/pipermail/latex2html/2017-September/003974.html
\begin{equation}
% a comment
  \label{test1}
  \int_0^1\sin x dx
\end{equation}
\begin{equation}
  \int_0^2\sin x dx
  \label{test2}
\end{equation}

\begin{align}
a &= a + a + a + a \\
b &= b
\end{align}

\begin{multline}
( a + a + a + a \\
 + b		\\
 + c )
\end{multline}

\begin{subequations}
  \begin{align}
    \label{eq:mandelstam_s}
    s & \equiv (P_1 + P_2)^2 \\
    \label{eq:mandelstam_t}
    t & \equiv (P_1 - P_3)^2 \\
    \label{eq:mandelstam_u}
    u & \equiv (P_1 - P_4)^2
  \end{align}
  \begin{subequations}
    \begin{align}
      a^2 + b^2 = c^2
    \end{align}
  \end{subequations}
\end{subequations}
Next an align environment:
  \begin{align}
    s & \equiv (P_1 + P_2)^2 \\
    t & \equiv (P_1 - P_3)^2 \\
    u & \equiv (P_1 - P_4)^2
  \end{align}
An array inside an align environment:
\begin{align}
  \begin{array}{c}
    0
  \end{array}
  & =
  \begin{array}{c}
    0
  \end{array}
  \\
  \left[ \begin{array}{cc}
           a & b \\ c & d
         \end{array} \right] &=
  \left[ \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array} \right]
\end{align}

ba%comment
nana

ba%comment followed by space
 nana

ba %comment preceded by space
nana

% the comment was causing the picture to disappear
\begin{figure}
  \centering
  \setlength{\unitlength}{0.5mm}
  % 
  % \begin{picture}(130,100)
  % \end{picture}
  \begin{picture}(60,100)
    % \put(0,0){\framebox(60,100){}}
    \put(5,5){\makebox(0,0)[c]{a)}}
    \put(20,50){\vector(0,1){50}}
    \put(20,50){\vector(0,-1){50}}
    % 
    \put(45,50){\makebox(0,0)[c]{$\vec{P}=\vec{0}, M$}}
    \put(35,75){\makebox(0,0)[c]{$\vec{p}_1, m_1$}}
    \put(35,25){\makebox(0,0)[c]{$\vec{p}_2, m_2$}}
    \thinlines
    \put(20,50){\circle*{15}}
  \end{picture}\hfill%
\end{figure}

\end{document}
