[Tex/LaTex] How to split a very long equation (using AMSMATH package)

amsmathbreqnequationsmath-mode

I'm trying to split up the following equation so that it fits the margins of my document, so far I have:

\documentclass{article}

\usepackage{amsmath}

\begin{document} 

\begin{equation}
0 = n_1^3 n_2 n_3^2(\lambda+\mu)^2 +n_1 n_2^3 n_3^2(\lambda + \mu)^2  + (\lambda + \mu)(\mu - \rho c^2)n_1^3 n_2 + (\lambda + \mu)(\mu - \rho c^2) n_1 n_2^3 + n_1 n_2 n_3^2 (\lambda + \mu)(\mu - \rho c^2) + n_1 n_2 (\mu- \rho c^2)^2 - n_1^3 n_2 n_3^2 (\lambda + \mu)^2 - n_1 n_2^3 n_3^2 (\lambda + \mu)^2 
\end{equation}

\end{document} 

How do I make the equation split so that it fits?

Best Answer

You have eight summands on the right-hand side, split them two for each line:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{split}
0 ={}&
n_1^3 n_2 n_3^2(\lambda+\mu)^2 +n_1 n_2^3 n_3^2(\lambda + \mu)^2 \\
&+ (\lambda + \mu)(\mu - \rho c^2)n_1^3 n_2 + (\lambda + \mu)(\mu - \rho c^2) n_1 n_2^3 \\
&+ n_1 n_2 n_3^2 (\lambda + \mu)(\mu - \rho c^2) + n_1 n_2 (\mu- \rho c^2)^2 \\
&- n_1^3 n_2 n_3^2 (\lambda + \mu)^2 - n_1 n_2^3 n_3^2 (\lambda + \mu)^2
\end{split}
\end{equation}

\end{document}

enter image description here