2

(1). A proper arrangement is required because some of the terms are scattered. enter image description here

(2). This is how the aforementioned arrangement must look.

enter image description here

    \documentclass[11pt,a4paper]{article}
    \usepackage{amsmath}
    \usepackage{array}
    \usepackage{booktabs}
    \newcommand*{\Ph}{\hphantom{)}}%

 \begin{document}
 $\begin{array}{r@{} r@{} r@{} r@{} r r}
 x^3 &{}+2x^{2} &{}+2x &{}+1 \\
 \times (x^2 &{}-x &{}+1) &\\
 \cmidrule{1-4}
 x^{5} & +2x^{4} &{} +2x^{3} &{} +x^{2}\\
 & -1x^{4} &{} -2x^{3} &{} -2x^{2} -1x\\
 && +1x^{3} &{} +2x^{2} &{} +2x &{} +1 \\ 
 \cmidrule{1-6}
 x^{5} &{}+ x^{4} &{}+ x^{3} &{}+ x^{2} &{}+ x &{}+ 1
 \end{array}$
 \end{document}
1

Something like this, maybe?

enter image description here

\documentclass[11pt,a4paper]{article}
\usepackage{array,booktabs}

\begin{document}
\[
\begin{array}{@{} r *{12}{ @{}>{{}}r<{{}} } @{}}
     & x^3 & + & 2x^2            & + & 2x^{\phantom{2}} & + & 1\phantom{x^2} \\
 \times \\
     & x^2 & - & x^{\phantom{2}} & + & 1\phantom{x^2} \\
 \midrule
 & x^5 & + & 2x^4 & + & 2x^3 & + &  x^2\\
 &     & - &  x^4 & - & 2x^3 & - & 2x^2 & - &  x\\
 &     &   &      & + &  x^3 & + & 2x^2 & + & 2x & + & 1\\
 \midrule
 & x^5 & + &  x^4 & + &  x^3 & + &  x^2 & + &  x & + & 1\\
 \end{array}
 \]
 \end{document}
1
  • 1
    Absolutely brilliant! I was struggling to find a solution since last weekend. Thank you so very much! It means a lot! – Nisal Kevin Kotinkaduwa Mar 2 '15 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.