# How to split a very long equation (using AMSMATH package)?

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}

$$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{document}


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

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

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$$\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{document}


• Nice trick with ={} to get the right indentation on the later lines!
– user30471
Mar 23 '16 at 12:12
• @Andrew A different trick is having &= in the first line and &\qquad+ in the later ones. Mar 23 '16 at 12:16

I'd use an align environment coupled with some \notag commands to prevent multiple equation numbers and some \quad's for spacing:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
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\notag\\
&\quad +(\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 \\
&\quad - n_1^3 n_2 n_3^2 (\lambda + \mu)^2 - n_1 n_2^3 n_3^2 (\lambda + \mu)^2\notag
\end{align}

\end{document}


This gives: