(1).部分术语比较零散,需要适当整理。
(2)上述安排必须是这样的。
\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
也许是这样的?
\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}