# Display fractional formula nicely

I've tried using the split environment as well as dfrac, however, I can't seem to be able to make this equation look nice at all.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{split}
f_{xx}(t,x) = &\dfrac{1}{\underbrace{\left(2t^{5/2}
\left(e^{x^2/4t}+\sqrt{\dfrac{1}{t}}\right)^2\right)^2}_\text{c}}\\
&\left(-\dfrac{x\left(e^{x^2/4t} \left(2t+x^2\right) \right)}{2t}
\cdot 2t^{5/2}\left(e^{x^2/4t}+\sqrt{\dfrac{1}{t}}\right)^2\right) - \\
&\left(\left( e^{x^2/4t}\left(2t - x^2\right) +2\sqrt{t}\right) \cdot \left(2txe^{x^2/4t}\left(\sqrt{t}e^{x^2/4t}+1 \right)\right)\right)
\end{split}
\end{equation*}
\end{document}


I took out the denominator and multiplied the entire numerator by 1 over the fraction, but the equation becomes quite unbalanced.

Edit: The denominator should be multiplied to all the terms that follow, I apologize if my code is unclear.

• You're using a split environment yet do not provide & alignment anchors. Is this intentional? – Mico Jul 11 '15 at 1:52
• @Mico Thanks for pointing that out. Edited to include the alignment anchors. – Jun-Goo Kwak Jul 11 '15 at 1:56

I suggest you

• indent the second line relative to the first and indent the third line even more to indicate the mathematical structure of the full formula; as per your follow-up comment, I've placed square brackets around the material in lines two and three;

• replace the two \sqrt{\dfrac{1}{t}} subformulas with \sqrt{1/t};

• not use \left( and \right to auto-size the parentheses; instead, use \big, \Big, and \bigg judiciously to size the "fences".

Note that since the material in a displayed equation is in so-called "display style", it doesn't make a difference whether one uses \frac or \dfrac for the two remaining fractional expressions.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
before:
\begin{equation*}
\begin{split}
f_{xx}(t,x) = &\dfrac{1}{\underbrace{\left(2t^{5/2}
\left(e^{x^2/4t}+\sqrt{\dfrac{1}{t}}\right)^2\right)^2}_\text{c}}\\
&\left(-\dfrac{x\left(e^{x^2/4t} \left(2t+x^2\right) \right)}{2t}
\cdot 2t^{5/2}\left(e^{x^2/4t}+\sqrt{\dfrac{1}{t}}\right)^2\right) - \\
&\left(\left( e^{x^2/4t}\left(2t - x^2\right) +2\sqrt{t}\right) \cdot
\left(2txe^{x^2/4t}\left(\sqrt{t}e^{x^2/4t}+1 \right)\right)\right)
\end{split}
\end{equation*}

\bigskip
after:

\begin{equation*}
\begin{split}
f_{xx}(t,x)
&= \frac{1}{\underbrace{\Bigl(2t^{5/2}
\bigl(e^{x^2/4t}+\sqrt{1/t}\,\bigr)^2\Bigr)^2}_\text{c}}\\
\cdot 2t^{5/2}\bigl(e^{x^2/4t}+\sqrt{1/t}\,\bigr)^2 \\
\Bigl(2txe^{x^2/4t}\bigl(\sqrt{t}\,e^{x^2/4t}+1 \bigr)\Bigr)\biggl]
\end{split}
\end{equation*}

\end{document}


Addendum: Since you're assigning the symbol c to the denominator part, one might as well make use of it to simplify the equation still further (this is very similar to the idea Gonzalo Medina used in his answer):

\documentclass{article}
\usepackage{mathtools} % for "\shortintertext" macro
\begin{document}
\noindent
Making use of your $c$'' expression:

\begin{align*}
f_{xx}(t,x)
&= c\times\biggl[-\frac{x\bigl(e^{x^2/4t} (2t+x^2) \bigr)}{2t}
\cdot 2t^{5/2}\bigl(e^{x^2/4t}+\sqrt{1/t}\,\bigr)^2 \\
\Bigl(2txe^{x^2/4t}\bigl(\sqrt{t}\,e^{x^2/4t}+1 \bigr)\Bigr)\biggr]\\
\shortintertext{where}
c &= \Bigl(2t^{5/2}
\bigl(e^{x^2/4t}+\sqrt{1/t}\,\bigr)^2\Bigr)^{-2}
\end{align*}
\end{document}

• @Jun-GooKwak - I've updated the code to incorporate your follow-up comment that the material on rows two and three belongs together. – Mico Jul 11 '15 at 2:29

I'd propose something like this:

The code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{multline*}
f_{xx}(t,x) =
\dfrac{1}{\alpha}\biggl(-\dfrac{x\left( \exp(x^2/4t) \left(2t+x^2\right) \right)}{2t}
\cdot 2t^{5/2} \bigl(\exp(x^2/4t)+\sqrt{1/t}\, \bigr)^2\bigr) \\
- \bigl( ( \exp(x^2/4t)  ( 2t - x^2 ) +2\sqrt{t} \bigr) \cdot
\bigl( 2tx\exp(x^2/4t) (\sqrt{t}\exp(x^2/4t)+1  ) \bigr) \biggr),
\end{multline*}
where $\alpha=\bigl(\exp(x^2/4t)+\sqrt{1/t} )^2 \bigr)^2$.

\end{document}


## Remarks

• I took out the denominator and replaced it in the formula by \alpha

• Instead of e^{<big exponent>} use the \exp notation.

• Avoid, as much as possible, the \left, \right constructs. Use the \big, \Big, \bigg, \Bigg family of commands instead.

• Being just one formula in, now, two lines, I'd rather use multline.

• @GonzolaMedina Thank you for your time and solution. It is very elegant. – Jun-Goo Kwak Jul 11 '15 at 2:47