1
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}\usepackage{amssymb}
\textwidth=16.5cm  \oddsidemargin=-0.10cm \evensidemargin=-0.10cm  \topmargin=-1.0cm \textheight=24.5cm

\newcommand{\piRsquare}{\pi r^2}        

\title{The small amplitude expansion: The class of theoritical considered}
\author{Md. X }     
\date{January 26, 2013}                 
\begin{document} \baselineskip=18pt
\section{Introduction}  
  \begin{align}
    \left(\nabla p_1\right){}^2 g_2-\frac{1}{3} \text{Cos}[2 \tau ] \left(\nabla p_1\right){}^2 g_2-\frac{1}{24} \lambda  \text{Cos}[2 \tau ] g_2 p_1^4-\frac{1}{24} \lambda  \text{Cos}[4 \tau ] g_2 p_1^4+\frac{19}{72} g_2^3 p_1^4-\frac{1}{9} \text{Cos}[2 \tau ] g_2^3 p_1^4+\frac{5}{72} \text{Cos}[4 \tau ] g_2^3 p_1^4 \\
    & \qquad -\frac{5}{8} g_2 g_3 p_1^4-\frac{1}{2} \text{Cos}[2 \tau ] g_2 g_3 p_1^4+\frac{1}{8} \text{Cos}[4 \tau ] g_2 g_3 p_1^4+\frac{3}{8} g_4 p_1^4+\frac{1}{2} \text{Cos}[2 \tau ] g_4 p_1^4+\frac{1}{8} \text{Cos}[4 \tau ] g_4 p_1^4-\frac{5}{2} \text{Cos}[\tau ] g_2^2 p_1^2 p_2+\frac{1}{2} \text{Cos}[3 \tau ] g_2^2 p_1^2 p_2 \\
    & \qquad +\frac{9}{4} \text{Cos}[\tau ] g_3 p_1^2 p_2+\frac{3}{4} \text{Cos}[3 \tau ] g_3 p_1^2 p_2+\frac{1}{2} g_2 p_2^2+\frac{1}{2} \text{Cos}[2 \tau ] g_2 p_2^2+g_2 p_1 p_3+\text{Cos}[2 \tau ] g_2 p_1 p_3-\frac{5}{6} \text{Sin}[\tau ] g_2^2 p_1^2 q_2+\frac{1}{2} \text{Sin}[3 \tau ] g_2^2 p_1^2 q_2 \\
    & \qquad +\frac{3}{4} \text{Sin}[\tau ] g_3 p_1^2 q_2+\frac{3}{4} \text{Sin}[3 \tau ] g_3 p_1^2 q_2+\text{Sin}[2 \tau ] g_2 p_2 q_2+\frac{1}{2} g_2 q_2^2-\frac{1}{2} \text{Cos}[2 \tau ] g_2 q_2^2+\text{Sin}[2 \tau ] g_2 p_1 q_3+g_2 p_1 \text{$\Delta $p}_1\\
    & \qquad -\frac{1}{3} \text{Cos}[2 \tau ] g_2 p_1 \text{$\Delta $p}_1-\text{Cos}[\tau ] \text{$\Delta $p}_2-\text{Sin}[\tau ] \text{$\Delta $q}_2-\frac{2}{3} \text{Cos}[2 \tau ] g_2 p_1^2 \omega _2-\text{Cos}[\tau ] p_2 \omega _2-\text{Sin}[\tau ] q_2 \omega _2-\text{Cos}[\tau ] p_1 \omega _3+\phi _4[\tau ]+\phi _4''[\tau ] =0
    \end{align}
\end{document}

I tried to split the equation but I couldn't. I could do for other equation but this is not taking several equations. I have used & \qquad but it is not working. Can anyone help me?

3
  • Could you clarify what you're trying to do? The first line is pretty darned long...
    – cmhughes
    Commented Jun 12, 2013 at 22:32
  • This is a one line equation and I want to write multiple line as latex. But I couldn't. Commented Jun 12, 2013 at 22:33
  • 2
    as requested in your questions earlier today please always post complete documents not just fragments. Commented Jun 12, 2013 at 22:33

3 Answers 3

3

With long mechanically generated terms it isn't clear that it makes sense to try to insert & and \\ in align-like structures. To make a human readable output really you need to break it up completely, give names to sub-terms etc, An alternative is just to let the whole thing flow as it comes:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{flushleft}\linespread{2}\selectfont
$\displaystyle
(\nabla p_1){}^2 g_2-\frac{1}{3} \text{Cos}[2 \tau ] \left(\nabla p_1\right){}^2 g_2-\frac{1}{24} \lambda  \text{Cos}[2 \tau ] g_2 p_1^4-\frac{1}{24} \lambda  \text{Cos}[4 \tau ] g_2 p_1^4+\frac{19}{72} g_2^3 p_1^4-\frac{1}{9} \text{Cos}[2 \tau ] g_2^3 p_1^4+\frac{5}{72} \text{Cos}[4 \tau ] g_2^3 p_1^4 
 -\frac{5}{8} g_2 g_3 p_1^4-\frac{1}{2} \text{Cos}[2 \tau ] g_2 g_3 p_1^4+\frac{1}{8} \text{Cos}[4 \tau ] g_2 g_3 p_1^4+\frac{3}{8} g_4 p_1^4+\frac{1}{2} \text{Cos}[2 \tau ] g_4 p_1^4+\frac{1}{8} \text{Cos}[4 \tau ] g_4 p_1^4-\frac{5}{2} \text{Cos}[\tau ] g_2^2 p_1^2 p_2+\frac{1}{2} \text{Cos}[3 \tau ] g_2^2 p_1^2 p_2 
+\frac{9}{4} \text{Cos}[\tau ] g_3 p_1^2 p_2+\frac{3}{4} \text{Cos}[3 \tau ] g_3 p_1^2 p_2+\frac{1}{2} g_2 p_2^2+\frac{1}{2} \text{Cos}[2 \tau ] g_2 p_2^2+g_2 p_1 p_3+\text{Cos}[2 \tau ] g_2 p_1 p_3-\frac{5}{6} \text{Sin}[\tau ] g_2^2 p_1^2 q_2+\frac{1}{2} \text{Sin}[3 \tau ] g_2^2 p_1^2 q_2 
 +\frac{3}{4} \text{Sin}[\tau ] g_3 p_1^2 q_2+\frac{3}{4} \text{Sin}[3 \tau ] g_3 p_1^2 q_2+\text{Sin}[2 \tau ] g_2 p_2 q_2+\frac{1}{2} g_2 q_2^2-\frac{1}{2} \text{Cos}[2 \tau ] g_2 q_2^2+\text{Sin}[2 \tau ] g_2 p_1 q_3+g_2 p_1 \text{$\Delta $p}_1
-\frac{1}{3} \text{Cos}[2 \tau ] g_2 p_1 \text{$\Delta $p}_1-\text{Cos}[\tau ] \text{$\Delta $p}_2-\text{Sin}[\tau ] \text{$\Delta $q}_2-\frac{2}{3} \text{Cos}[2 \tau ] g_2 p_1^2 \omega _2-\text{Cos}[\tau ] p_2 \omega _2-\text{Sin}[\tau ] q_2 \omega _2-\text{Cos}[\tau ] p_1 \omega _3+\phi _4[\tau ]+\phi _4''[\tau ] =0
\hfill\qquad\refstepcounter{equation}(\theequation)
$
\end{flushleft}

\end{document}
2

You've got some extremely long lines in that equation. You need to put an alignment & earlier in the first line so you can see the following lines:

\documentclass{article}
\usepackage[margin=1in,landscape]{geometry}
\usepackage{amsmath,amssymb}
\pagestyle{empty}
\begin{document}

\begin{align}
\left(\nabla p_1\right){}^2 & g_2-\frac{1}{3} \text{Cos}[2 \tau ] \left(\nabla p_1\right){}^2 g_2-\frac{1}{24} \lambda  \text{Cos}[2 \tau ] g_2 p_1^4-\frac{1}{24} \lambda  \text{Cos}[4 \tau ] g_2 p_1^4+\frac{19}{72} g_2^3 p_1^4-\frac{1}{9} \text{Cos}[2 \tau ] g_2^3 p_1^4+\frac{5}{72} \text{Cos}[4 \tau ] g_2^3 p_1^4 \\
& \qquad -\frac{5}{8} g_2 g_3 p_1^4-\frac{1}{2} \text{Cos}[2 \tau ] g_2 g_3 p_1^4+\frac{1}{8} \text{Cos}[4 \tau ] g_2 g_3 p_1^4+\frac{3}{8} g_4 p_1^4+\frac{1}{2} \text{Cos}[2 \tau ] g_4 p_1^4+\frac{1}{8} \text{Cos}[4 \tau ] g_4 p_1^4-\frac{5}{2} \text{Cos}[\tau ] g_2^2 p_1^2 p_2+\frac{1}{2} \text{Cos}[3 \tau ] g_2^2 p_1^2 p_2 \\
& \qquad +\frac{9}{4} \text{Cos}[\tau ] g_3 p_1^2 p_2+\frac{3}{4} \text{Cos}[3 \tau ] g_3 p_1^2 p_2+\frac{1}{2} g_2 p_2^2+\frac{1}{2} \text{Cos}[2 \tau ] g_2 p_2^2+g_2 p_1 p_3+\text{Cos}[2 \tau ] g_2 p_1 p_3-\frac{5}{6} \text{Sin}[\tau ] g_2^2 p_1^2 q_2+\frac{1}{2} \text{Sin}[3 \tau ] g_2^2 p_1^2 q_2 \\
& \qquad +\frac{3}{4} \text{Sin}[\tau ] g_3 p_1^2 q_2+\frac{3}{4} \text{Sin}[3 \tau ] g_3 p_1^2 q_2+\text{Sin}[2 \tau ] g_2 p_2 q_2+\frac{1}{2} g_2 q_2^2-\frac{1}{2} \text{Cos}[2 \tau ] g_2 q_2^2+\text{Sin}[2 \tau ] g_2 p_1 q_3+g_2 p_1 \text{$\Delta $p}_1\\
& \qquad -\frac{1}{3} \text{Cos}[2 \tau ] g_2 p_1 \text{$\Delta $p}_1-\text{Cos}[\tau ] \text{$\Delta $p}_2-\text{Sin}[\tau ] \text{$\Delta $q}_2-\frac{2}{3} \text{Cos}[2 \tau ] g_2 p_1^2 \omega _2-\text{Cos}[\tau ] p_2 \omega _2-\text{Sin}[\tau ] q_2 \omega _2-\text{Cos}[\tau ] p_1 \omega _3+\phi _4[\tau ]+\phi _4''[\tau ] =0
\end{align}

\end{document}

enter image description here

Also, I would recommend changing the \text{Cos} and \text{Sin} to \cos and \sin respectively.

Finally, this is an extremely long and unwieldy equation. As a reader, I would find this very difficult to parse.

3
  • SoBut I inserted & in the equation. Commented Jun 12, 2013 at 22:39
  • You inserted it at the far right hand side of the equation, so things are aligning of the edge of your paper.
    – A.Ellett
    Commented Jun 12, 2013 at 22:41
  • And what about equation numbering? With this solution a single equation is considered as five different equations... Commented Apr 21, 2018 at 17:56
2

Automatic output from Mathematica can't be directly inserted and some manual work is needed.

For instance, you'll find useless \left and \right, also useless {} and wrong \text{$\Delta$p}_2$.

I split the long equation at plus and minus sign, surrounded it by \begin{multline} and \end{multline}; then I inserted \\ at possibly appropriate spots not to make overlong lines.

In addition, I changed \text{Cos} and \text{Sin} with appropriate commands.

\documentclass{article}
\usepackage[pass,showframe]{geometry} % just for the example (it shows the margins)
\usepackage{amsmath,amssymb}
\DeclareMathOperator\Cos{Cos}
\DeclareMathOperator\Sin{Sin}

\begin{document}

\begin{multline}
(\nabla p_1)^2 g_2
-\frac{1}{3} \Cos[2\tau] (\nabla p_1)^2 g_2
-\frac{1}{24} \lambda \Cos[2\tau] g_2 p_1^4
-\frac{1}{24} \lambda \Cos[4\tau] g_2 p_1^4
\\
+\frac{19}{72} g_2^3 p_1^4
-\frac{1}{9} \Cos[2\tau] g_2^3 p_1^4
+\frac{5}{72} \Cos[4 \tau ] g_2^3 p_1^4
-\frac{5}{8} g_2 g_3 p_1^4
\\
-\frac{1}{2} \Cos[2\tau] g_2 g_3 p_1^4
+\frac{1}{8} \Cos[4\tau] g_2 g_3 p_1^4
+\frac{3}{8} g_4 p_1^4
+\frac{1}{2} \Cos[2\tau] g_4 p_1^4
\\
+\frac{1}{8} \Cos[4\tau] g_4 p_1^4
-\frac{5}{2} \Cos[\tau] g_2^2 p_1^2 p_2
+\frac{1}{2} \Cos[3 \tau ] g_2^2 p_1^2 p_2
+\frac{9}{4} \Cos[\tau] g_3 p_1^2 p_2
\\
+\frac{3}{4} \Cos[3\tau] g_3 p_1^2 p_2
+\frac{1}{2} g_2 p_2^2
+\frac{1}{2} \Cos[2\tau] g_2 p_2^2
+g_2 p_1 p_3
\\
+\Cos[2 \tau ] g_2 p_1 p_3
-\frac{5}{6} \Sin[\tau] g_2^2 p_1^2 q_2
+\frac{1}{2} \Sin[3\tau] g_2^2 p_1^2 q_2
+\frac{3}{4} \Sin[\tau] g_3 p_1^2 q_2
\\
+\frac{3}{4} \Sin[3\tau] g_3 p_1^2 q_2
+\Sin[2 \tau ] g_2 p_2 q_2
+\frac{1}{2} g_2 q_2^2
-\frac{1}{2} \Cos[2\tau] g_2 q_2^2
\\
+\Sin[2\tau] g_2 p_1 q_3
+g_2 p_1 \Delta p_1
-\frac{1}{3} \Cos[2\tau] g_2 p_1 \Delta p_1
-\Cos[\tau ] \Delta p_2
\\
-\Sin[\tau ] \Delta q_2
-\frac{2}{3} \Cos[2\tau] g_2 p_1^2 \omega _2
-\Cos[\tau ] p_2 \omega _2
-\Sin[\tau ] q_2 \omega _2
\\
-\Cos[\tau ] p_1 \omega _3
+\phi _4[\tau ]
+\phi _4''[\tau ] =0
\end{multline}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .