2

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}
1
  • For one thing, you're forgetting the & at alignment points and \\ at line breaks.
    – Herr K.
    Dec 6, 2013 at 6:11

2 Answers 2

2

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}

enter image description here

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

6
  • 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?
    – Litun
    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{equation}\begin{split} and \end{align} with \end{split}\end{equation} 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
    – Herthog
    Dec 6, 2013 at 6:51
1

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:

Sample ouput

\documentclass{article}

\usepackage{mathtools,amssymb}

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

\begin{document}

\begin{equation}
  \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{equation}

\end{document}

Other changes made:

  • all sums correctly indexed,
  • \le replaced by \leqslant,
  • larger brackets in the first line for the one big group,
  • thin space \, add in s r(s) constructions.

I have deliberately not made the brackets around the sums larger.

2
  • 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
    – daleif
    Dec 6, 2013 at 8:48
  • 1
    @daleif Generally I would agree with that. However, in this particular case it seems to get rather unwieldy, hence my last statement. In fact, I would prefer to reorder so that the multipliers come before the sum and the brackets are unnecessary. Dec 6, 2013 at 9:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .