Text Formatting ⇒ How can I split this long equation into multiple lines?
-
- Posts: 1
- Joined: Sat Dec 18, 2021 5:03 pm
How can I split this long equation into multiple lines?
\frac{\left(\sqrt{\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\ +\left(1-b\right)\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}ab\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}}-\sqrt{\left(1-\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\ +\left(1-b\right)\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}\right)\left(1-a\right)\left(1-b\right)\left(1-\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}\right)}\right)}{\left(\sqrt{\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}ab\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}}-\sqrt{\left(1-\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)\left(1-a\right)\left(1-b\right)\left(1-\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}\right)}\right)}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
How can I split this long equation into multiple lines?

You could write the quotient as a product:
Code: Select all
\documentclass{article}
\usepackage{mathtools}% loads amsmath
\usepackage[hmargin=1.5cm, showframe]{geometry}
\begin{document}
\begin{equation}
\begin{split}
&\left(\sqrt{\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}ab
\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}}\right.\\
&\left.-\sqrt{\left(1-\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}\right)\left(1-a\right)
\left(1-b\right)\left(1-\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}\right)}\right)\\
&\left(\sqrt{\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}ab
\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}}\right.\\
&\left.-\sqrt{\left(1-\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)
\left(1-a\right)\left(1-b\right)
\left(1-\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}\right)}\right)^{-1}
\end{split}
\end{equation}
\end{document}
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
How can I split this long equation into multiple lines?
\Bigg/
, either at the end of line:
Code: Select all
\documentclass{article}
\usepackage{mathtools}% loads amsmath
\usepackage[hmargin=1.5cm, showframe]{geometry}
\begin{document}
\begin{equation}
\begin{split}
&\left(\sqrt{\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}ab
\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}}\right.\\
&\left.-\sqrt{\left(1-\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}\right)\left(1-a\right)
\left(1-b\right)\left(1-\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}\right)}\right)\Bigg/\\
&\left(\sqrt{\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}ab
\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}}\right.\\
&\left.-\sqrt{\left(1-\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)
\left(1-a\right)\left(1-b\right)
\left(1-\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}\right)}\right)
\end{split}
\end{equation}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{mathtools}% loads amsmath
\usepackage[hmargin=1.5cm, showframe]{geometry}
\begin{document}
\begin{equation}
\begin{split}
&\left(\sqrt{\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}ab
\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}}\right.\\
&\left.-\sqrt{\left(1-\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}\right)\left(1-a\right)
\left(1-b\right)\left(1-\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}\right)}\right)\\
\Bigg/&\left(\sqrt{\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}ab
\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}}\right.\\
&\left.-\sqrt{\left(1-\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)
\left(1-a\right)\left(1-b\right)
\left(1-\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}\right)}\right)
\end{split}
\end{equation}
\end{document}

- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
How can I split this long equation into multiple lines?
\splitdfrac
:
Code: Select all
\documentclass{article}
\usepackage{mathtools}% loads amsmath
\usepackage[hmargin=1.5cm, showframe]{geometry}
\begin{document}
\begin{equation}
\frac{\left(\splitdfrac{\sqrt{\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}ab
\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}}}
{-\sqrt{\left(1-\frac{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}
{a\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}+\left(1-b\right)
\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}\right)\left(1-a\right)
\left(1-b\right)\left(1-\frac{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)}
{b\left(1-\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}\right)+\left(1-a\right)
\frac{\sqrt{b}}{\sqrt{1-a}+\sqrt{b}}}\right)}}\right)}
{\left(\splitdfrac{\sqrt{\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}ab
\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}}}
{-\sqrt{\left(1-\sqrt{\frac{a}{1-b}}\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)
\left(1-a\right)\left(1-b\right)
\left(1-\frac{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)}
{b\left(1-\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}\right)+\left(1-a\right)
\frac{\sqrt{1-b}}{\sqrt{a}+\sqrt{1-b}}}\right)}}\right)}
\end{equation}
\end{document}
