\documentclass{article}
\begin{document}
\subsection*{Polynomial and binary divisions}

A polynomial division, working with \texttt{underline\{\}}, \texttt{\textbackslash{}hspace\{\}}
and use of \texttt{eqnarray}. 


\begin{verbatim}
\begin{eqnarray*}
(x^{5}+x^{2}):(x^{3}+x^{2}) & = & x^{2}-x+1\\
\underline{{-(x^{5}+x^{4})}}\hspace{11ex}\\
-x^{4}+x^{2}\hspace{7ex}\\
\underline{{-(-x^{4}-x^{3})}}\hspace{6ex}\\
x^{3}+x^{2}\hspace{2ex}\\
\underline{{-(x^{3}+x^{2})}\hspace{1ex}}\\
0\hspace{5ex} 
\end{eqnarray*}
\end{verbatim}

\begin{eqnarray*}
(x^{5}+x^{2}):(x^{3}+x^{2}) & = & x^{2}-x+1\\
\underline{{-(x^{5}+x^{4})}}\hspace{11ex}\\
-x^{4}+x^{2}\hspace{7ex}\\
\underline{{-(-x^{4}-x^{3})}}\hspace{6ex}\\
x^{3}+x^{2}\hspace{2ex}\\
\underline{{-(x^{3}+x^{2})}\hspace{1ex}}\\
0\hspace{5ex} 
\end{eqnarray*}


A binary division looks a bit different to the polynomial division,
but it's possible with eqnarray, too.
\end{document}
