Write an equation in two lines with a single equation number

equations

I am trying to write an equation in two lines sharing a single equation number, as shown in the figure.

enter image description here

I tried this code, but it doesn't work in two columns format:

\begin{equation}  
\begin{split}
AdditionandMultiplication(a, b_i) & = \sin(p \omega \omega_{4_i}) \\
& AdditionandMultiplication(a, {b}_i + 1) = \tanh(p \omega  \omega_{25_i}) 
\end{split}
\end{equation}

Best Answer

There are (at least) two ways to solve your formatting issue:

  • alignment only on the = symbols

  • alignment both along the left-hand edge and on the = symbols.

Both ways are addressed in the following example. The first way employs an aligned environment, and the second employs an alignedat[2] environment. Both environments are explained in depth in the user guide of the amsmath package.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'gather', 'aligned', and 'alignedat' environments
%% macro for displaying variable names (vn):
\newcommand\vn[1]{\mathtt{#1}} % or '\mathrm',  '\mathit' 

\begin{document}

\begin{gather}  
\begin{aligned}
\vn{AdditionandMultiplication}(a, b_i)        &= \sin(p\omega\omega_{4_i}) \\
\vn{AdditionandMultiplication}(a, {b}_i + 1)  &= \tanh(p\omega\omega_{25_i}) 
\end{aligned} \\[1\baselineskip]
\begin{alignedat}{2}
&\vn{AdditionandMultiplication}(a, b_i)       &&= \sin(p\omega\omega_{4_i}) \\
&\vn{AdditionandMultiplication}(a, {b}_i + 1) &&= \tanh(p\omega\omega_{25_i}) 
\end{alignedat}
\end{gather}

\end{document}