# Problem with using multline and align

I am LaTeX begginer and when I run this equation, I am getting the error:

! Argument \align* has an extra {.


Here is the equation.

\begin{multline}
\begin{align*}
C_s & = \displaystyle \max_{P(g_M)} \int_0^{\infty}
\bigg[ \left(1-\exp\left(-\frac{g_M}{\overline{g}_W}\right) \right)
\log\left(1+\frac{g_MP(g_M)}{N_M}\right)- \\
\int_0^{g_M} \log\left(1+\frac{g_WP(g_W)}{N_W}\right)
\frac{1}{\overline{g}_W}\exp\left(-\frac{g_W}{\overline{g}_W}\right)
dg_W \bigg]
\frac{1}{\overline{g}_W}\exp\left(-\frac{g_M}{\overline{g}_M}\right) dg_M \\
& = \max_{P(g_M)} \int_0^{\infty}
\bigg[\log \left(1+\frac{g_MP(g_M)}{N_M}\right) -
\exp\left(\frac{1}{\overline{g}_WP(g_M)}\right)
\bigg(Ei\left(\frac{1}{\overline{g}_WP(g_M)}\right)- \\
Ei\left(\frac{g_M}{\overline{g}_W}+
\frac{1}{\overline{g}_WP(g_M)}\right)
\bigg)
\bigg]
\frac{1}{\overline{g}_M}\exp\left(-\frac{g_M}{\overline{g}_M}\right) dg_M
\end{align*}
\end{multline}


-
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or select your code and hit Ctrl+K. – Jubobs Mar 8 '13 at 19:15
I have edited your code to make it more legible. Why are you using multiline and align at the same time? It seems like you are missing alignment characters (ampersands &). – Corentin Mar 8 '13 at 19:30

This is probably close enough to what you are trying to achieve:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\begin{split}
C_s & = \max_{P(g_M)} \int_0^{\infty}
\bigg[ \left(1-\exp\left(-\frac{g_M}{\overline{g}_W}\right) \right)
\log\left(1+\frac{g_MP(g_M)}{N_M}\right) \\
\frac{1}{\overline{g}_W}\exp\left(-\frac{g_W}{\overline{g}_W}\right)
dg_W \bigg]
\frac{1}{\overline{g}_W}\exp\left(-\frac{g_M}{\overline{g}_M}\right) dg_M
\end{split}\\
\begin{split}
& = \max_{P(g_M)} \int_0^{\infty}
\bigg[\log \left(1+\frac{g_MP(g_M)}{N_M}\right)
-\exp\left(\frac{1}{\overline{g}_WP(g_M)}\right)
\bigg(Ei\left(\frac{1}{\overline{g}_WP(g_M)}\right) \\
+\frac{1}{\overline{g}_WP(g_M)}\right)
\bigg)
\bigg]
\frac{1}{\overline{g}_M}\exp\left(-\frac{g_M}{\overline{g}_M}\right) dg_M
\end{split}
\end{align*}

\end{document}


A couple of points:

• It is perfectly ok to use split inside align (see for instance this question).
• You should put the minus signs after line breaking.
• You don't need displaystyle as equations are already displayed in the align environment.
• You can improve the alignment by adding white space with \quad, \qquad or even \phantom.
-
I wouldn't even use split, no need. Just ={}& and &- – daleif Mar 8 '13 at 19:52
In this case you are right, there is no need to use split but the advantage I see in using it is that if we were using align then split would automatically take care of the tag, whereas otherwise you have to do it manually. – Corentin Mar 8 '13 at 21:38