# Use split environment multiple times in align

I got a big fan of the split environment to share forumula numberings over multiple lines.

However I can't figure out how to use it multiple times inside an align environment. I have an equation that needs to be split in multiple lines, some group of lines form one formula I want to label. How would one do that? the code below doesn't work...

A more precise working example of what I am trying to do:

\documentclass[]{article}
\usepackage{amsmath}
\begin{document}

\begin{align}
\begin{split}
x^{(2)} &= \frac{1}{10} ( \varphi(x_1) +\varphi(-x_1) \\
& + \cdots \\
& + \varphi(100x_1) +\varphi(-100x_1) ) \\
\label{one}
\end{split}
\begin{split}
& + \frac{1}{10}\varphi_{tanh}( 100x_2)  +\frac{1}{10}\varphi_{tanh}(-100x_2)\\
& + \varphi_{tanh}(x_3)
\label{two}
\end{split}
\end{align}

\end{document}


this produces the output, where I would expect the lines to be below each other:

• Your code having two \end{split} but only one \begin{split} which caused compilation error, and can you explain your requirement with little more clear (sorry)... Sep 11 '19 at 10:39
• Dang you're right, but that's not solving the issue. I will elaborate a bit more precisely in my question Sep 11 '19 at 10:53
• you are missing a \\  between the two split environments, but also please always post complete documents not fragments Sep 11 '19 at 11:50
• Yeah I wasn't sure whether to use \\ in the last column of a split environment or not but both variants produce the same output Sep 11 '19 at 12:03
• no you have no \\  in the align so nothing to make one come above the other (see Bernard's answer with aligned but split is the same) note your example is still not a document that anyone can run to see the issue. Sep 11 '19 at 12:05

Per David comment, \\ required to separate both the lines and use \quad to align the operators. Off topic, in general, trignometry terms like cos, sin and tan should come in roman font only, so please use \tanh instead of tanh and the modified tags are:

\documentclass{book}
\usepackage{mathtools}
\begin{document}

\begin{align}
\begin{split}
x^{(2)} &= \frac{1}{10} ( \varphi(100x_1+175) +\varphi(-100x_1+150) \\
&\quad + \varphi(100x_1-125) +\varphi(-100x_1-150) ) -\frac{1}{10}
\label{one}
\end{split}\\
\begin{split}
+\frac{1}{10}\varphi_{\tanh}(-100x_2+150)\\
\label{two}
\end{split}
\end{align}

\end{document}

• thank you thats what I was looking for. The problem is I don't want to break style and I am also using \varphi_{sig} ad \varphi_{smax} etc. they should all have the same font. Is there a way to make _{sig} look like _{\tanh} ? Sep 11 '19 at 12:52
• Glad to help you, you can define your own like \DeclareMathOperator{\smax}{smax} and the usage is \varphi_{\smax}... Sep 11 '19 at 13:06
• thanks yeah you're right I didnt think of that Sep 11 '19 at 13:17

I would do it with aligned, in this way:

\documentclass[]{article}
\usepackage{amsmath,mathtools, nccmath}

\begin{document}

\begin{align}
\label{one}
& \begin{aligned}x^{(2)} = & \mfrac{1}{10} ( \varphi(100x_1+175) +\varphi(-100x_1+150) + \cdots {}\\
& + \varphi(100x_1-125) +\varphi(-100x_1-150) ) -\smash{\mfrac{1}{10}}
\end{aligned}
\\[1ex]
& \begin{aligned}
\phantom{x^{(2)} = }& + \mfrac{1}{10}\varphi_{\tanh}( 100x_2+150) +\mfrac{1}{10}\varphi_{\tanh}(-100x_2+150)\\
& + \varphi_{\tanh}(x_5)
\end{aligned}
\label{two}
\end{align}

\end{document}


• thanks that works with split, as well. The hint to increase space between splits was helpful as well! Sep 11 '19 at 12:49

I would suggest using aligned in the following way, placing equation numbers at the top of each group and using extra indentation for visual grouping. I also provide an alternative with just aligned, but then you have to remember to use \notag often.

\documentclass{book}

\usepackage{mathtools}

\begin{document}

Using \verb+aligned+
\begin{align}
x^{(2)}
&=
\begin{aligned}[t]
&\frac{1}{10} \bigl( \varphi(100x_1+175) +\varphi(-100x_1+150) \\
-\frac{1}{10}
\end{aligned}
\label{one}
\\
&\hphantom{{}={}}
\begin{aligned}[t]
& + \frac{1}{10}\varphi_{\tanh}( 100x_2+150)
+\frac{1}{10}\varphi_{\tanh}(-100x_2+150)\\
\end{aligned}
\label{two}
\end{align}

Or with just \verb+align+ and \verb+\notag+
\begin{align}
x^{(2)}
&=
\frac{1}{10} \bigl( \varphi(100x_1+175) +\varphi(-100x_1+150)
\label{three}\\