[Tex/LaTex] Formula too long and \split fails | contains “sqrt” (square root)

amsmathequationssplitsqrt

I'm quite new to LaTex and I guess I need some help. I'm writing a report and I need to display a specific formula. If I use the simple equation environment the formula gets too long for one line. Therefore I tried to use the split envornment inside the equation environment. Here is my code:

\begin{equation} 
\begin{split}

K_{b}   &=  \sqrt{ \max \left( 0, \sum_{k} \max \left( CVR_{k},0\right)^{2}\\
    &+  \sum_{k} \sum_{k\neq l} \rho_{kl} CVR_{k}CVR_{l}\psi \left(CVR_{k},CVR_{l}\right)
    \right)
}
\end{split}
\end{equation}

If I apply this code I'm getting the following error message:

Missing } inserted. \end{split}

Do you have any idea how to display the formula correctly?

Thanks in advance!!

Kind regards,
Felix

Best Answer

  • I used the align environment.
  • In addition, using \left( and \right. to open a bracket and close it invisible to be able to split.
  • I used \notag to avoid the equation number in the first line.
  • I avoided the sqrt by using ^{1/2}.
  • Make sure to read Big Parenthesis in an Equation, see \biggl and \biggr as an alternative approach to the automatic bracket size (\left and \right).
  • You can use \vphantom to force the same size for all brackets in different lines, see Linebreak between \left and \right for example.
  • I think that most of my code needs the amsmath package (or mathtools which builds on amsmath).

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\section*{Original}

\begin{equation} 
K_{b}   =   \left(\max 
            \left( 0, \sum_{k} \max 
            \left( CVR_{k},0
            \right)^{2}
            + 
            \sum_{k} \sum_{k\neq l} \rho_{kl} CVR_{k}CVR_{l} \psi 
            \left(CVR_{k},CVR_{l}
            \right)
            \right)
            \right)^{1/2}
\end{equation}

\section*{Basic Idea}

\begin{align} 
K_{b}   = &     \left( \max \left( \right. \right. \\
            & + 
            \left. abc \left. \right) \right)           
\end{align}

\section*{Proposal}

\begin{align} 
K_{b}   = &     \left( \max  \left(  
            0, \sum_{k} \max \left( CVR_{k},0 \right)^{2}
            \right. \right.
            +
            \notag
            \\
            & +
            \left. \left.
        \sum_{k} \sum_{k\neq l} \rho_{kl} CVR_{k}CVR_{l} \psi   \left(CVR_{k},CVR_{l}       \right) 
            \right) \right)^{\frac{1}{2}}           
\end{align}


\end{document}

enter image description here


(added by daleif)

In a case like this auto scaling should not be used as it easily comes out in the wrong size. Here are two example with manual scaling. The latter use the fact that are are a bit away whatever is tall, so we do not need the fences that all, plus using different inner braces makes it a lot easier to match what ever goes together.

\begin{align} 
K_{b}   = &     \biggl( \max  \biggl(  
            0, \sum_{k} \max ( CVR_{k},0 )^{2}
            +
            \notag
            \\
            & +
            \sum_{k} \sum_{k\neq l} \rho_{kl} CVR_{k}CVR_{l} \psi   (CVR_{k},CVR_{l}       ) 
            \biggr) \biggr)^{\frac{1}{2}}           
\end{align}
\begin{align} 
K_{b}   = &     \Bigl( \max  \Bigl\{  
            0, \sum_{k} \max ( CVR_{k},0 )^{2}
            +
            \notag
            \\
            & +
            \sum_{k} \sum_{k\neq l} \rho_{kl} CVR_{k}CVR_{l} \psi   (CVR_{k},CVR_{l}       ) 
            \Bigr\} \Bigr)^{\frac{1}{2}}           
\end{align}

enter image description here

Related Question