Problem in alignment of equation using \begin{align} and \begin{split}

I was trying to align these equation but they are stretching out of the document. Even though I used \begin{split} it didn't work. I don't know why this is so?

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{align}
\prod_1^{k + 1} (s - s_i)=(s - s_{k + 1}) (s^k - (\sum_1^k s_i)s^{k - 1} + (\sum_{1 \le i   < j \le k} s_i s_j) s^{k - 2} + r(s))
= s^{k + 1} - (\sum_1^k s_i)s^k + (\sum_{1 \le i < j \le k} s_i s_j) s^{k - 1} + s r(s)-  s_{k + 1} s^k+(\sum_1^k s_i s_{k + 1})s^{k - 1} - (\sum_{1 \le i < j \le k} s_i s_j s_{k + 1})  s^{k - 2} - s_{k + 1}r(s)
=s^{k + 1} -(\sum_1^{k + 1} s_i) s^k +  (\sum_{1 \le < j \le k + 1} s_i s_j) s^{k - 1}- (\sum_{1 \le i < j \le k} s_i s_j s_{k + 1}) s^{k - 2} + s r(s) - s_{k + 1} r(s).
\end{align}
\end{document}

• For one thing, you're forgetting the & at alignment points and \\  at line breaks. Dec 6, 2013 at 6:11

It depend on the width of the text, but it might be a good solution:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
\prod_1^{k + 1} (s - s_i)
&=(s - s_{k + 1}) (s^k - (\sum_1^k s_i)s^{k - 1} + (\sum_{1 \le i   < j \le k} s_i s_j) s^{k - 2} + r(s)) \\
&= s^{k + 1} - (\sum_1^k s_i)s^k + (\sum_{1 \le i < j \le k} s_i s_j) s^{k - 1} + s r(s)-  s_{k + 1} s^k\\
&\qquad+(\sum_1^k s_i s_{k + 1})s^{k - 1} - (\sum_{1 \le i < j \le k} s_i s_j s_{k + 1})  s^{k - 2} - s_{k + 1}r(s)\\
&=s^{k + 1} -(\sum_1^{k + 1} s_i) s^k +  (\sum_{1 \le < j \le k + 1} s_i s_j) s^{k - 1}\\
&\qquad - (\sum_{1 \le i < j \le k} s_i s_j s_{k + 1}) s^{k - 2} + s r(s) - s_{k + 1} r(s).
\end{align}

\end{document}


Some corrections of sizes of the parentheses are probably needed. For split inside equation the usage is analogous, but numbering of lines is different.

• Being a single equation, it's definitely better to use split inside equation. Dec 6, 2013 at 6:22
• @ karlkoeller Using split inside the equation enviornment is not aligned properly in my case. Any further help? Dec 6, 2013 at 6:37
• @karlkoeller I have partially incorporated your suggestion. However it seems that OP wants align as a primary solution. Dec 6, 2013 at 6:38
• @Litun What do you mean? Simply replace \begin{align} with \begin{split} and \end{align} with \end{split} in the code in the answer and you will see the result. Dec 6, 2013 at 6:42
• You should use the \nonumber option at the end of the lines the continue. The use of \left( and \right) can also increase the typesetting Dec 6, 2013 at 6:51

As this is one single equation you should use split rather than align. Break the long lines manually via e.g. \\ &\qquad. As \qquad is a skip of 2em this can be put in to a convenient command \eqbreak

\newcommand{\eqbreak}[1][2]{\\&\hskip#1em}


which without argument indents with a \qquad space, but with \eqbreak[4] will give two \qquads. Using mathtools you can make the wide subscripts under the sums spread under the brackets using \mathclap:

\documentclass{article}

\usepackage{mathtools,amssymb}

\newcommand{\eqbreak}[1][2]{\\&\hskip#1em}

\begin{document}

$$\begin{split} \prod_{i=1}^{k+1} (s - s_i) &= (s - s_{k+1}) \Bigl(s^k - (\sum_{i=1}^k s_i)s^{k-1} + (\sum_{\mathclap{1 \leqslant i < j \leqslant k}} s_i s_j) s^{k-2} + r(s)\Bigr) \\ &= s^{k + 1} - (\sum_{i=1}^k s_i)s^k + (\sum_{\mathclap{1 \leqslant i < j \leqslant k}} s_i s_j) s^{k-1} + s\, r(s)- s_{k+1} s^k \eqbreak + (\sum_{i=1}^k s_i s_{k+1})s^{k-1} - (\sum_{\mathclap{1 \leqslant i < j \leqslant k}} s_is_js_{k+1}) s^{k-2} - s_{k + 1}r(s)\\ &= s^{k+1} - (\sum_{i=1}^{k+1} s_i) s^k + (\sum_{\mathclap{1 \leqslant i < j \leqslant k+1}} s_i s_j) s^{k-1} - (\sum_{\mathclap{1 \leqslant i < j \leqslant k}} s_i s_j s_{k+1}) s^{k-2} \eqbreak + s\, r(s) - s_{k + 1} r(s). \end{split}$$

\end{document}


• \le replaced by \leqslant,
• thin space \, add in s r(s) constructions.
• Many of the fences around the sums ought to be a bit bigger, I tend to use \Bigl...\Bigr, as it stands now, especially the ) drowns Dec 6, 2013 at 8:48