[Tex/LaTex] How to put a big equation in a single slide

equationsslideshow

How to make a big equation fit in a single slide?

I have the following equation:

\begin{frame}

\begin{equation}
        \begin{split}
        (\lambda_1-2n+l+4)(\lambda_1-n-l+2)\leq l(n-l) 
        \\
        \implies \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0
        \\
    \implies \bigg \{ 2\lambda_1-\bigg(3n-6-\sqrt{8l+n^2-4n+4}\bigg )\bigg \}\bigg \{ 2\lambda_1-\bigg(3n-6+\sqrt{8l+n^2-4n+4}\bigg)\bigg \} \leq 0
        \\
        \implies  \frac{3n-6-\sqrt{8l+n^2-4n+4}}{2}\leq \lambda_1 \leq \frac{3n-6+\sqrt{8l+n^2-4n+4}}{2}
        \end{split}
        \end{equation}

\end{frame}

Whenever I am using \begin{frame} \end{frame} a part of my equation is going outside the frame.

How can I adjust the whole equation in a single slide?

Please help me out.

Best Answer

Here's a solution suggestion that performs alignment on the inequality symbols.

Aside: The \bigg sizing instructions are, in my opinion, excessive; \big and \Big suffice completely.

enter image description here

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{equation}
\begin{aligned}
(\lambda_1-2n+l+4)(\lambda_1-n-l+2) &\leq l(n-l) \\
\implies \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8) &\leq 0\\
\implies \Bigl\{ 2\lambda_1-\bigl(3n-6-\sqrt{8l+n^2-4n+4}\,\bigr )\Bigr \} \quad&\\
\times\Bigl\{ 2\lambda_1-\bigl(3n-6+\sqrt{8l+n^2-4n+4}\,\bigr)\Bigr\} &\leq 0 \\
\implies  \frac{3n-6-\sqrt{8l+n^2-4n+4}}{2}&\leq \lambda_1\\
\text{and}\quad 
\frac{3n-6+\sqrt{8l+n^2-4n+4}}{2} &\geq \lambda_1\\
\end{aligned}
\end{equation}

\end{frame}
\end{document}

Addendum: Here's a second solution, inspired by @egreg's observation that a lot of space is taken up by the repeated term \sqrt{8l+n^2-4n+4}. Replacing it with the symbol D, rewriting the final row to use interval notation instead of a pair of inequalities, and aligning the rows on the \implies symbols instead of on the inequality symbols yields the following result:

enter image description here

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{equation}
\begin{aligned}[b]
&(\lambda_1-2n+l+4)(\lambda_1-n-l+2) \leq l(n-l)\\
\implies&\lambda_1^2-\lambda_1(3n-6)+(2n^2-2l-8n+8)\leq 0\\
\implies&\bigl( 2\lambda_1-(3n-6-D) \bigr) 
         \bigl( 2\lambda_1-(3n-6+D) \bigr) \leq 0 \\
\implies&\lambda_1\in\bigl[
         (\tfrac{3}{2}n-3)-\tfrac{1}{2}D, 
         (\tfrac{3}{2}n-3)+\tfrac{1}{2}D \bigr]
\end{aligned}
\end{equation}
where $D=\sqrt{(n-2)^2+8l}$\,.

\end{frame}
\end{document}
Related Question