[Tex/LaTex] split equation in multiple lines

amssymbamsthmequations

I am a new Latex user,I have loaded these two math equation in my Latex documents and i want to split an equation i have into multiple line

\usepackage{amssymb}
\usepackage{amsthm}

I am reading this topic for breaking the lines over multiple

How to break a long equation?

although what ever i do it does not allow me to compile

MWE

\documentclass[authoryear,preprint,review,12pt]{elsarticle}

\usepackage{amssymb}
\usepackage{amsthm}

\begin{document}

\begin{equation}\label{xx}
\begin{split}
A&= 1 + 2 + \\
& 3 +4 +6
\end{split}
\end{equation}

\end{document}

\endinput

So

\begin{equation}
A = 1 + 2 + 3 +4 +6
\end{equation}

I want to place them/break the equation in two lines and retain the format of numbering and equal placing beneath.

i tried

\begin{equation}
A = 1 + 2 + \\
3 +4 +6
\end{equation}

Although it does not work

When i use \begin{multline}

\begin{multline}
A = 1 + 2 + \\
3 +4 +6
\end{multline}

and the following errors

! LaTeX Error: Environment multline undefined.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \begin{multline}

! LaTeX Error: \begin{document} ended by \end{multline}.See the LaTeX manual or LaTeX Companion for explanation.Type H for immediate help…. \end{multline}

Though i get the equation broken it is not numbered, or has a one line distance from my text as the \begin{equation}
Also tried this example as kindly suggested

\begin{equation}\label{xx}
\begin{split}
A&= 1 + 2 + \\
& 3 +4 +6
\end{split}
\end{equation}

and obtaining these

! LaTeX Error: Environment split undefined.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \begin{split}
! Misplaced alignment tab character &. A&
! Misplaced alignment tab character &.<recently read> & &
! LaTeX Error: \begin{equation} on input line 142 ended by \end{split}.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \end{split}

Have i missed anything?

Best Answer

I suggest you use a split environment, which in contrast to multline may be used a subenvironment of equation. You need to specify an alignment point on each line with & and separate lines with \\. In this case the first line should be move left relative to the others and the package mathtools provides a convenient command for this:

Sample output

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation}
  \label{wave kinematic}
  \begin{split}
    \MoveEqLeft
    \frac{\partial N(\sigma;\lambda;\theta;t)}{\partial t}
    + \frac{\partial C_{g,\lambda}N(\sigma;\lambda;\theta;t)}
    {\partial \lambda} \\
    &+ \cos\phi^{-1} \cdot
    \frac{\partial C_{f,\phi}N(\sigma;\lambda;\theta;t)}{\partial
    \phi} \\
    &+ \frac{\partial C_{f,\theta}N(\sigma;\lambda;\theta;t)}{\partial
    \theta} 
    + \frac{\partial C_{f,\sigma}N(\sigma;\lambda;\theta;t)}{\partial
    \sigma}  
    = \frac{S(\sigma;\theta;\lambda;\varphi;t)}{\sigma}
  \end{split}
\end{equation}

\end{document}

I have split across three lines for clarity. If you wanted to just split in two parts, then multlined (notice the extra d) from the mathtools package would be a simpler solution:

multlined sample

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation}
  \label{wave kinematic}
  \begin{multlined}
    \frac{\partial N(\sigma;\lambda;\theta;t)}{\partial t}
    + \frac{\partial C_{g,\lambda}N(\sigma;\lambda;\theta;t)}
    {\partial \lambda} 
    + \cos\phi^{-1} \cdot
    \frac{\partial C_{f,\phi}N(\sigma;\lambda;\theta;t)}{\partial
    \phi} \\
    + \frac{\partial C_{f,\theta}N(\sigma;\lambda;\theta;t)}{\partial
    \theta} 
    + \frac{\partial C_{f,\sigma}N(\sigma;\lambda;\theta;t)}{\partial
    \sigma}  
    = \frac{S(\sigma;\theta;\lambda;\varphi;t)}{\sigma}
  \end{multlined}
\end{equation}

\end{document}

All the above works with elsarticle class in your updated question. E.g. the first version becomes:

\documentclass[authoryear,preprint,review,12pt]{elsarticle}

\usepackage{mathtools}

\begin{document}

\begin{equation}
  \label{wave kinematic}
  \begin{split}
    \MoveEqLeft
    \frac{\partial N(\sigma;\lambda;\theta;t)}{\partial t}
    + \frac{\partial C_{g,\lambda}N(\sigma;\lambda;\theta;t)}
    {\partial \lambda} \\
    &+ \cos\phi^{-1} \cdot
    \frac{\partial C_{f,\phi}N(\sigma;\lambda;\theta;t)}{\partial
    \phi} \\
    &+ \frac{\partial C_{f,\theta}N(\sigma;\lambda;\theta;t)}{\partial
    \theta} 
    + \frac{\partial C_{f,\sigma}N(\sigma;\lambda;\theta;t)}{\partial
    \sigma}  
    = \frac{S(\sigma;\theta;\lambda;\varphi;t)}{\sigma}
  \end{split}
\end{equation}

\end{document}
Related Question