I have
$$(1+x+x^2+x^3+x^4+x^5+x^6)(1+x^2+x^4+x^6+x^8+x^{10})(1+x^5+x^{10}+x^{15}+x^{20})$$
but is too long to fit the page. How to break this?
I have
$$(1+x+x^2+x^3+x^4+x^5+x^6)(1+x^2+x^4+x^6+x^8+x^{10})(1+x^5+x^{10}+x^{15}+x^{20})$$
but is too long to fit the page. How to break this?
First: Don't use $$/$$.
The following fits in a book with a text width of 7 inches:
\documentclass{book}
\usepackage[textwidth = 7in]{geometry}
\usepackage{mathtools}
\begin{document}
\begin{gather*}
\begin{split}
&(1 + x + x^{2} + x^{3} + x^{4} + x^{5} + x^{6})\\
&\cdot (1 + x^{2} + x^{4} + x^{6} +x^{8} + x^{10})\\
&\cdot (1 + x^{5} + x^{10} + x^{15} + x^{20})
\end{split}
\end{gather*}
\begin{gather*}
\begin{split}
\MoveEqLeft (1 + x + x^{2} + x^{3} + x^{4} + x^{5} + x^{6})\\
&\cdot (1 + x^{2} + x^{4} + x^{6} +x^{8} + x^{10})\\
&\cdot (1 + x^{5} + x^{10} + x^{15} + x^{20})
\end{split}
\end{gather*}
\end{document}

Notice the use of \MoveEqLeft (from the mathtools package) in the second example, which is equivalent to &\quad.
\cdot{}? Or a leading one in the second and third lines.
– egreg
Dec 30 '14 at 20:59
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
The product is
\begin{multline*}
(1+x+x^2+x^3+x^4+x^5+x^6)(1+x^2+x^4+x^6+x^8+x^{10})\\
\times(1+x^5+x^{10}+x^{15}+x^{20})
\end{multline*}
and some text.
\end{document}
amsmath users guide (texdoc amsmath) goes part of the way, but you'll need more than that. some people recommend the latex wiki; i'd like to reserve judgment on that, but you might find it useful.
– barbara beeton
Dec 31 '14 at 22:23
Using a right-aligned stack. I did it with two lines, but an extra \\ and \times can be used if you prefer 3 lines. The horizontal line show the margin extent. The 16pt is the distance between baselines in the math expression.
\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
\noindent\hrulefill
\setstackgap{L}{16pt}
\[\Longstack[r]{
(1 + x + x^{2} + x^{3} + x^{4} + x^{5} + x^{6})
(1 + x^{2} + x^{4} + x^{6} +x^{8} + x^{10})\qquad{}\\
\times (1 + x^{5} + x^{10} + x^{15} + x^{20})
}
\]
\end{document}

You've mentioned in a comment that the page width of your document is 7", but you haven't mentioned how wide the text block is. Assuming a text block width of 4.5" (i.e., combined left- and right-hand margins of 2.5"), a font size of 10pt, and use of the Computer Modern font family, TeX can make the entire expression fit on a single line. This is possible because the width parameter around the + symbols is shrinkable as well as stretchable.
If you do not want to make TeX apply so much shrinkage to the spacing around the + symbols, or if your basic font size is larger than 10pt and hence if the entire polynomial can't fit on one line, you could use a multline* environment to typeset the entire expression across three lines in a staggered fashion. (If you don't like the \times symbol, consider using \cdot instead.)

\documentclass{article}
\usepackage{amsmath} % for 'multline*' environment
\usepackage[textwidth=4.5in]{geometry} % just for this example
\begin{document}
\noindent
The following line is 4.5" wide:
\hrule
\[
(1+x+x^2+x^3+x^4+x^5+x^6)
(1+x^2+x^4+x^6+x^8+x^{10})
(1+x^5+x^{10}+x^{15}+x^{20})
\]
\begin{multline*}
(1+x+x^2+x^3+x^4+x^5+x^6)\\
\times(1+x^2+x^4+x^6+x^8+x^{10})\\
\times(1+x^5+x^{10}+x^{15}+x^{20})
\end{multline*}
\end{document}