# How to get the entire equation to work correctly?

I have written the following equation:

\begin{document}
\documentclass[12pt]{article}
\begin{align}
\begin{split}
\bigg \{2\rho-\bigg (2l+n-2-\sqrt{n^2-4l^2+4ln-4n+4}\bigg )\bigg\}
\bigg \{2\rho-\bigg (2l+n-2+\sqrt{n^2-4l^2+4ln-4n+4}\bigg )\bigg\}\geq 0
\end{split}
\end{align}
\end{document}


The lines of the equation are getting out of the margin. I did use split and \\ but when I use it the rest of the part of the document starts behaving abruptly . I start getting spaces in between the sections. Can someone please tell me how to fix it? Do I need to use any package??

Here are a few options.1

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
The options include \texttt{align}
\begin{align}
\bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\notag\\
\cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\geq 0
\end{align}
and \texttt{multline}
\begin{multline}
\bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\\
\cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\geq 0
\end{multline}
and \texttt{aligned}
\begin{aligned} \bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\\ \cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}&\geq 0 \end{aligned}
and \texttt{split}
$$\begin{split} \bigl\{2\rho-\bigl(2\ell+n-2-\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\\ \cdot\bigl\{2\rho-\bigl(2\ell+n-2+\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\bigr\}\geq 0 \end{split}$$
\end{document}


In the future, please consider posting compilable examples. \documentclass needs to go before \begin{document} and you forgot to load amsmath.

1I personally do not like options (3) or (4), but this is just an opinion. When you have the first time a page break in an equation you may understand why.

• Thank you very much Sir. One question what are the alternatives for aligned? – Math_Freak Jun 5 at 4:08
• @Math_Freak I added more options. (I am pretty sure there will be other answers adding a slight tilt and tell you how great this tilt is. This is what happens always these days.) – user194703 Jun 5 at 4:15
• +1 But I think you forgot to introduce another one with multlined. – Too Fat Man No Neck Jun 5 at 4:41
• @MoneyOrientedProgrammer Thanks! Yes, the list is by far not exhaustive. My favorite is also missing: \documentclass[12pt,fleqn]{article} \begin{document} $$f_+(\ell,n)\,f_-(\ell,n)\ge0\;,$$ where $$f_\pm(\ell,n)=2\rho-\bigl(2\ell+n-2\pm\sqrt{n^2-4\ell^2+4\ell n-4n+4}\bigr)\;.$$ \end{document}. – user194703 Jun 5 at 4:45
• Yes. It is easier to read. – Too Fat Man No Neck Jun 5 at 5:25

I suggest a different way to cope with such a long formula: use an abbreviation for the expression under the square root.

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{aligned}[t] &\bigl( 2\rho-(2l+n-2-\sqrt{\Delta}\,) \bigr) \bigl( 2\rho-(2l+n-2+\sqrt{\Delta}\,) \bigr)\geq 0 \\[0.5ex] &\Delta=n^2-4l^2+4ln-4n+4 \end{aligned}

\end{document}


There is no need to go \bigg: just remember to use \, when the square root is followed by a parenthesis.