1

I am trying to obtain an expression where I want to write the numerator in multiple aligned lines, and I need a denominator covering all of the numerator terms in a single line. My equation is:

But I am trying to obtain its numerator in multiple lines as follows:

$$\begin{equation}
  \begin{aligned}
    \lim_{s\rightarrow 1/2}E(r)=\frac{\Bigg[&\sqrt{1-r}\left(7-78 r+144 r^2\right) \operatorname{ArcTanh}\left[\frac{\sqrt{-1+3 r}}{\sqrt{3r}}\right]\\
    & +\sqrt{-3+9 r}\left(4(-6 \sqrt{1-r} r^{3 / 2}+\sqrt{(1-r) r})
    \\
    & +\left(-3+42 r-48 r^2\right) \operatorname{ArcTan}\left[\sqrt{\frac{1-r}{r}}\right]\right)
    \Bigg]}{144 \pi \sqrt{3-3 r r^{3 / 2}} \sqrt{-1+3 r}}
  \end{aligned}
\end{equation}$$

My code doesn't compile by using this, where is the problem? Guide and thanks.

Mico
  • 506,678
Jpmg
  • 13
  • 2
    Welcome to TeX.SE. Your code must be generating an error message as you're encasing an equation environment in a pair of $$ tokens. Please make your code compilable. – Mico Jan 23 '24 at 23:18
  • Welcome. // Please make it a habit to run through a process like this before you post code: https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that/10137#10137 . It avoids a flood of comments and will result in better answers sooner (though Mico did a great job once again). Thank you – MS-SPO Jan 24 '24 at 04:49

1 Answers1

2
  • First off, you have to remove the $$ tokens that encase the equation environment. For an in-depth discussion of this subject, please see the posting What are the differences between $$, \[, align, equation and displaymath?

  • Next, I suggest you load the mathtools package and employ its \splitfrac macro to create a three-line numerator. In the code shown below, observe that \splitfrac directives can be nested.

    If the line spacing employed by \splitfrac is too tight for your taste, I suggest replacing \splitfrac with \splitdfrac. (The letter d stands for \displaystyle.)

  • I further recommend replacing the \frac terms in the numerator with inline-fraction expressions.

  • And, because \left and \right sizing directives are not allowed to span line breaks, you must replace one of the inner \left( ... \right) constructs -- the one that would span lines 2 and 3 -- with explicit sizing directives. In the code below, I use \bigl\{ ... \bigr\}.

    More generally, don't treat the \left and \right sizing directives as crutches; instead, use them only when absolutely needed.

  • As a final touch, I'd use a ^{\vphantom/}} directive in the second square-root term in the denominator in order to equalize the heights of the adjacent square-root expressions.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{mathtools}  % for '\splitfrac' macro
\DeclareMathOperator{\ArcTan}{ArcTan}
\DeclareMathOperator{\ArcTanh}{ArcTanh}

\begin{document}

\begin{equation} \lim_{s\rightarrow 1/2}E(r) =\frac{ \left( % encase entire numerator in tall parentheses \splitfrac{% start of first line \sqrt{1-r}(7 -78r +144r^2) \ArcTanh[\sqrt{-1+3r}\big/\sqrt{3r},]} {\splitfrac{% start of second line {}+\sqrt{-3+9 r},\bigl{4(-6\sqrt{1-r},r^{3/2} +\sqrt{(1-r) r},)} % end of second line {+(-3 +42r -48r^2) \ArcTan[(1-r)/r] \bigr} } % end of inner \splitfrac } % end of outer \splitfrac \right) }% end of numerator {144 \pi \sqrt{3-3 r r^{3 / 2}} \sqrt{-1+3 r^{\vphantom{/}}}} % '^{\vphantom{/}}' serves to equalize the heights of the square-root symbols \end{equation}

\end{document}

Mico
  • 506,678