# Help needed in breaking a long equation which contains long sum

I have an equation which I want to split into two, but it always gives error when I use standard equation breaking techniques, like \split, \gather etc. The quation is given as

\vec{B}^{tra}(\textbf{r})  = \sum^{+\infty}_{n=-\infty}{j^{-n+1}\left[ \frac{k_{+2}c_{n}}{\omega}(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r))Cos(\theta)
-\frac{k_{-2}d_{n}}{\omega}(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r))sin(\theta)\right]}.


I want to write the sine term on second line.

any help will highly appreciated.

FA

-
Welcome to TeX.SE! Real quick: By indenting lines of LaTeX code by four spaces -- which may be done smoothly by highlighting the lines in question and clicking on the {} "button" in the line above the editing window -- the site will pretty-print the code. – Mico Dec 8 '13 at 13:17

I suggest you make the following changes to your code

• To typeset curly braces in TeX/LaTeX, it's necessary to enter them as \{ and \} rather than as { and }. I've replaced your { and } terms with curly braces below since you feature them in your example. However, they're not really needed and could thus be omitted entirely.

• Since the curly braces and square brackets will enclose material that's broken across two lines, one can't use \left and \right to make them "large". I suggest you use the explicit sizing instructions \biggl and \biggr.

• Don't write cos and sin but \cos and \sin to have TeX typeset the materials in an upright roman font rather than in math italics.

\documentclass{article}
\usepackage{amsmath} % provides the "align*" environment
\begin{document}
\begin{align*}
\vec{B}^{tra}(\textbf{r})
=  \sum^{+\infty}_{n=-\infty}\biggl\{ j^{-n+1}
&\biggl[ \frac{k_{+2}c_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r)\bigr) \cos(\theta) \\
\bigl(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r)\bigr) \sin(\theta)
\biggr]\biggr\}.
\end{align*}
\end{document}


Without the unnecesssary curly braces and with the superscript term "tra" typeset in an upright-roman font, the equation looks like this:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\vec{B}^{\textup{tra}}(\textbf{r})
=  \sum^{+\infty}_{n=-\infty} j^{-n+1}
&\biggl[ \frac{k_{+2}c_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r)\bigr) \cos(\theta) \\
\bigl(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r)\bigr) \sin(\theta) \biggr].
\end{align*}
\end{document}

-
I'd remove the braces that serve no purpose. – egreg Dec 8 '13 at 13:36
@egreg - I've added a second form, without the curly braces. I did think it was important to mention the need to type \{ and \} rather than just { and } if curly braces are to be typeset. – Mico Dec 8 '13 at 13:47

One possible approach is to use the split environment from »amsmath« (here loaded by »mathtools«). This makes it necessary to use a manual scale for delimiters by e.g. \bigg.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
$$\begin{split} \vec{B}^\text{tra}(\textbf{r}) = \sum_{n=-\infty}^{+\infty} j^{-n+1}\bigg[ \frac{k_{+2}c_n}{\omega}(\textbf{M}^1_n(k_{+2}r) +\textbf{N}^1_n(k_{+2}r))\cos(\theta) \\ {}-\frac{k_{-2}d_n}{\omega}(\textbf{M}^1_n(k_{-2}r)-\textbf{N}^1_n(k_{-2}r))\sin(\theta)\bigg] \end{split}$$

you want to put an empty group {} before the minus sign starting the second line to get the correct spacing (binary, not unary). – barbara beeton Dec 8 '13 at 15:02