[Tex/LaTex] Help needed in breaking a long equation which contains long sum

equations

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

Best Answer

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.

enter image description here

\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) \\
&\quad {}-\frac{k_{-2}d_{n}}{\omega}
\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 unnecessary curly braces and with the superscript term "tra" typeset in an upright-roman font, the equation looks like this:

enter image description here

\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) \\
&\quad {}-\frac{k_{-2}d_{n}}{\omega}
\bigl(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r)\bigr) \sin(\theta) \biggr].
\end{align*}
\end{document}
Related Question