Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a long equation from Mathematica with very long numerator and normal elements of denominator.

\begin{equation}
P_1(t)= \frac{\exp \left(-\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right) \left(\lambda _{\text{G1}}^3 \left(\mu _{\text{G1}} \left(2 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)-4 e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-4\right)-\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2} \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-1\right)\right)-\lambda _{\text{G1}}^2 \mu _{\text{G1}} \left(\mu _{\text{G1}} \left(10 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)+11 e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}+11\right)+3 \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2} \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-1\right)\right)+2 \lambda _{\text{G1}} \mu _{\text{G1}}^2 \left(\mu _{\text{G1}} \left(-5 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)+e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}+1\right)+\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2} \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-1\right)\right)+2 \mu _{\text{G1}}^4 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)+\lambda _{\text{G1}}^4 \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}+1\right)\right)}{2 \left(-3 \lambda _{\text{G1}}^3 \mu _{\text{G1}}-16 \lambda _{\text{G1}}^2 \mu _{\text{G1}}^2-3 \lambda _{\text{G1}} \mu _{\text{G1}}^3+\lambda _{\text{G1}}^4+\mu _{\text{G1}}^4\right)},
\end{equation}
share|improve this question
1  
And what is your question? –  Svend Tveskæg May 6 at 15:29
    
@SvendTveskæg I believe the OP wants the fraction to be rewritten so that it fits in a page. As it is, it has a huge numerator. –  azetina May 6 at 15:32
    
@SvendTveskæg While the body of the question doesn't say so, the title pretty much captures it. I found that it needed to be scaled to 10% of original size to fit in one line. Thus, are there any tools to help breaking it up manually. Of course, the big problem to doing so is that there are many uses of \left(...\right) which pose difficulties to a split. –  Steven B. Segletes May 6 at 15:33
    
Probably one can redefine the numerator as a function of several variables and then use split. Having this done the equation could be represented with a single fraction. –  azetina May 6 at 15:37
    
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. –  Mike Renfro May 6 at 15:44

2 Answers 2

A possible solution:

\documentclass{article}

\usepackage[margin = 2.5cm]{geometry}
\usepackage{amsmath}

\newcommand*\Index[1]{#1_{\text{G1}}}
\newcommand*\Expo{e^{\frac{1}{2}tW}}
\newcommand*\spc{\mkern -5mu}

\begin{document}

\noindent Set
\begin{align*}
  W
  = \sqrt{\Index{\lambda}^{2} + \Index{\mu}^{2} - 6\Index{\lambda}\Index{\mu}}
\end{align*}
and let
\begin{align*}
  P_{\text{num}}(t)
  &= \exp\spc\left(-\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right)\\
  &\hphantom{{}=} \cdot \Biggl[\Index{\lambda}^{3}\biggl(\Index{\mu}\biggl(2\exp\spc\left(\frac{1}{4}t \left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) - 4\Expo - 4\biggr) - W\left(\Expo - 1\right)\biggr)\\
  &\hphantom{{}= \cdot \Biggl[} - \Index{\lambda}^{2}\Index{\mu}\left(\Index{\mu} \left(10\exp\spc\left(\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) + 11\Expo + 11\right) + 3W\left(\Expo - 1\right)\right)\\
  &\hphantom{{}= \cdot \Biggl[} + 2\Index{\lambda}\Index{\mu}^{2}\left(\Index{\mu} \left(-5\exp\spc\left(\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) + \Expo + 1\right) + W\left(\Expo - 1\right)\right)\\
  &\hphantom{{}= \cdot \Biggl[} + 2\Index{\mu}^{4}\exp\spc\left(\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) + \Index{\lambda}^{4}\left(\Expo + 1\right)\Biggr]{\mkern -3mu},\\[0.5ex]
  P_{\text{denom}}(t)
  &= 2{\mkern -3mu}\left(\Index{\lambda}^{4} + \Index{\mu}^{4} - 3\Index{\lambda}^{3}\Index{\mu} - 3\Index{\lambda}\Index{\mu}^{3} - 16\Index{\lambda}^{2}\Index{\mu}^{2}\right){\mkern -3mu}.
\end{align*}
Then
\begin{equation*}
  P_{1}(t)
  = \frac{P_{\text{num}}(t)}{P_{\text{denom}}(t)}.
\end{equation*}

\end{document}

output1

Update

Here is an improved version:

\documentclass{article}

\usepackage{amsmath}

\newcommand*\Index[1]{#1_{\text{G1}}}

\begin{document}

\noindent Set
\begin{align*}
  U
  &= \sqrt{\Index{\lambda}^{2} + \Index{\mu}^{2} - 6\Index{\lambda}\Index{\mu}},\\
  V
  &= \frac{1}{4}t(U + 3\Index{\lambda} + 3\Index{\mu}),\\
  W
  &= \exp{\mkern -8mu}\left(\frac{1}{2}tU\right){\mkern -5mu},
\end{align*}
and let
\begin{align*}
  P_{\text{num}}(t)
  &= \exp(-V)\\
  &\hphantom{{}=} \cdot \Bigl[\Index{\lambda}^{3}\bigl(2\Index{\mu}(\exp(V) - 2W - 2) - U(W - 1)\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} - \Index{\lambda}^{2}\Index{\mu}\bigl(\Index{\mu} (10\exp(V) + 11W + 11) + 3U(W - 1)\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} + 2\Index{\lambda}\Index{\mu}^{2}\bigl(\Index{\mu} (-5\exp(V) + W + 1) + U(W - 1)\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} + 2\Index{\mu}^{4}\exp(V) + \Index{\lambda}^{4}(W + 1)\Bigr]{\mkern -3mu},\\[0.5ex]
  P_{\text{denom}}(t)
  &= 2{\mkern -3mu}\left(\Index{\lambda}^{4} + \Index{\mu}^{4} - 3\Index{\lambda}^{3}\Index{\mu} - 3\Index{\lambda}\Index{\mu}^{3} - 16\Index{\lambda}^{2}\Index{\mu}^{2}\right){\mkern -4mu}.
\end{align*}
Then
\begin{equation*}
  P_{1}(t)
  = \frac{P_{\text{num}}(t)}{P_{\text{denom}}(t)}.
\end{equation*}

\end{document}

output2

Update 2

Yet another version:

\documentclass{article}

\usepackage[margin = 4cm]{geometry}
\usepackage{amsmath}

\newcommand*\Index[1]{#1_{\text{G1}}}

\begin{document}

\noindent Set
\begin{align*}
  U
  &= \sqrt{\Index{\lambda}^{2} + \Index{\mu}^{2} - 6\Index{\lambda}\Index{\mu}},\\
  V
  &= \frac{1}{4}t(U + 3\Index{\lambda} + 3\Index{\mu}),\\
  W
  &= \exp{\mkern -8mu}\left(\frac{1}{2}tU\right){\mkern -5mu},\\
  X
  &= \exp(V),\\
  Y
  &= U(W - 1)
\end{align*}
and let
\begin{align*}
  P_{\text{num}}(t)
  &= \exp(-V)\\
  &\hphantom{{}=} \cdot \Bigl[\Index{\lambda}^{3}\bigl(2\Index{\mu}(X - 2W - 2) - Y\bigr) - \Index{\lambda}^{2}\Index{\mu}\bigl(\Index{\mu} (10X + 11W + 11) + 3Y\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} + 2\Index{\lambda}\Index{\mu}^{2}\bigl(\Index{\mu} (-5X + W + 1) + Y\bigr) + 2\Index{\mu}^{4}X + \Index{\lambda}^{4}(W + 1)\Bigr]{\mkern -2mu},\\[0.5ex]
  P_{\text{denom}}(t)
  &= 2{\mkern -3mu}\left(\Index{\lambda}^{4} + \Index{\mu}^{4} - 3\Index{\lambda}^{3}\Index{\mu} - 3\Index{\lambda}\Index{\mu}^{3} - 16\Index{\lambda}^{2}\Index{\mu}^{2}\right){\mkern -3mu}.
\end{align*}
Then
\begin{equation*}
  P_{1}(t)
  = \frac{P_{\text{num}}(t)}{P_{\text{denom}}(t)}.
\end{equation*}

\end{document}

output3

share|improve this answer
2  
+1 for the effort in spotting subterms, I started but decided not to bother:-) –  David Carlisle May 6 at 16:41

I think there's little to be gained, in terms of communicating with your readers, of just splitting up the very long denominator across a multitude of shorter lines. It may well be preferable to simplify the entire expression by using simpler symbols that occur again and again. In essence, I propose going even further than Svend Tveskæg does. I use B, C, and D below; you can probably come up with more descriptive symbols...

enter image description here

\documentclass{article}
\usepackage{mathtools}
\newcommand\tg{\text{G1}}
\newcommand\ltg{\lambda_{\tg}}
\newcommand\mtg{\mu_{\tg}}
\begin{document}
\begin{equation}
P_1(t)= \frac{A}{E}
\end{equation}
where
\begin{align*}
A &= \exp \bigl[-\tfrac{1}{4} t (D+3 \ltg+3 \mtg)\bigr]\\
&\quad\times\Bigl\{\ltg^3
  \bigl[\mtg (2 B -4 e^{\frac{1}{2} t D}-4)
  -C\bigr]\\
&\qquad\quad  -\ltg^2 \mtg \bigl[\mtg (10 B+11 e^{\frac{1}{2} t D}+11)+3 C\bigr]\\
&\qquad\quad  +2 \ltg \mtg^2
  \bigl[\mtg (-5 B+e^{\frac{1}{2} t D}+1)+C\bigr]\\
&\qquad\quad  +2 \mtg^4 B\\
&\qquad\quad  +\ltg^4
  (e^{\frac{1}{2} t D}+1) \Bigr\}\,,\\
B&=\exp \bigl[\tfrac{1}{4} t (D+3 \ltg+3 \mtg)\bigr]\,,\\
C&=D \bigl[e^{\frac{1}{2} t D}-1\bigr]\,,\\
D&=\sqrt{-6 \ltg \mtg+\ltg^2+\mtg^2}\,,\\
\shortintertext{and}
E&= 2 \bigl[-3 \ltg^3 \mtg-16 \ltg^2 \mtg^2-3 \ltg \mtg^3+\ltg^4+\mtg^4\bigr],
\end{align*}
\end{document} 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.