3

I have aligned the equations in the following way but using multiple \qquad. I don't think it is a good practice to do so. Moreover the equations should fit within the width of the document. What I really need is something like \multline but how do I use it in this case for multiple equations and texts in between them. The equations after the text also should be in the same position as the equations before (I have used \! for that in my code). I really don't want to use more packages for this purpose and 'd prefer to stick with amsmath or if necessary mathtools.

\documentclass{article}
\usepackage{amsmath}
\usepackage{braket}
\begin{document}
\begin{equation*}
\begin{split}
&\delta\mathcal{S}(\psi)=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt+\int_{t_{1}}^{t_{2}}\braket{\psi(t)|i\frac{\partial}{\partial t}|\delta\psi(t)}dt\\&\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\delta\dot{\psi}(t)}dt-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-\int_{t_{1}}^{t_{2}}\left[\frac{d}{dt}\braket{\psi(t)|\delta\psi(t)}-\braket{\dot{\psi(t)}|\delta\psi}\right]dt\\&\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\braket{\psi(t)|\delta\psi(t)}   -i\int_{t_{1}}^{t_{2}}\braket{\dot{\psi}(t)|\delta\psi(t)}dt\\&\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
&\text{Since } \delta\psi(t_{1})=\delta\psi(t_{2})=0\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|\dot{\psi(t)}}^{*}dt-\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|\hat{H}|\psi(t)}^{*}dt
\end{split}
\end{equation*}
\begin{equation*}
\braket{\beta|\hat{H}|\alpha}={\braket{\alpha|\hat{H}^{\dagger}|\beta}}^{*}
\end{equation*}
\begin{equation*}
\begin{split}
\!&\quad=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|-{\frac{\partial}{\partial t}|\psi}}^{*}dt-\int_{t_{1}}^{t_{2}}{\braket{\delta\psi(t)|\hat{H}|\psi(t)}}^{*}dt\\
\!&\quad=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i{\frac{\partial}{\partial t}-\hat{H}|\psi(t)}}^{*}dt
\end{split}
\end{equation*}
\end{document}
\end{article}
5
  • In equation environment is forbidden use ampersands (&) . (Tat is reason for errors in compilation of your MWE). Instead \begin{equation*} you should use for example \begin{align*} or other asmath environments. For text between equation the intertext{....} can be handy. Since your system of equations is terrible mess, I need more time to put them in order and show where and how to use interttext{...}. I will do this at evening if someone else doesn't do before.
    – Zarko
    Commented May 24, 2015 at 11:36
  • @Zarko i have used & in between \begin{split} and \end{split} to align them and it displays the result when it is compiled. But I want the long equations to be arranged as when we use \multline instead of arranging with & and using multiple \qquad.
    – Sooraj S
    Commented May 24, 2015 at 11:41
  • Just a semantic question: what is the \braket here for? Is it a justification of the previous line?
    – Bernard
    Commented May 24, 2015 at 13:18
  • @Bernard \braket is used to write the quantum mechanical operator for the expectation value. It is part of the equation. try to compile the code pls. That will be clear.
    – Sooraj S
    Commented May 24, 2015 at 13:31
  • 1
    Your original MWE gives error which disaper if I replace equation* with align*. I'm glad to see that meanwhile (during my Sunday lunch with my family :-)) you clean up your MWE and receive two answers, which both gives nice results.
    – Zarko
    Commented May 24, 2015 at 15:02

3 Answers 3

4

You can use align* and multlined (which requires mathtools); for the explanations and keeping the alignment, use \intertext.

I provided a better definition of \braket that doesn't place the asterisk at random places; use \braket[*]{x|y} for having a superscript asterisk. Also a better notation for the differential has been added and an abbreviation for the differential operator.

\documentclass{article}
\usepackage{amsmath,mathtools,xparse}
\usepackage{braket}

\newcommand\diff{\mathop{}\!d}
\newcommand{\pdert}{\frac{\partial}{\partial t}}
\RenewDocumentCommand\braket{om}{%
  \mathinner{\langle{#2}\rangle\IfValueT{#1}{^{#1}}}%
}

\begin{document}

\begin{align*}
&\delta\mathcal{S}(\psi)=
  \begin{multlined}[t]
    \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert-\hat{H}|\psi(t)}\diff t+
    \int_{t_{1}}^{t_{2}}\braket{\psi(t)|i\pdert|\delta\psi(t)}\diff t\\
    -\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}\diff t
  \end{multlined}
\\
&=
  \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert-\hat{H}|\psi(t)}\diff t-
  i\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\delta\dot{\psi}(t)}\diff t-
  \int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi}\diff t
\\
&=
  \begin{multlined}[t]
    \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert-\hat{H}|\psi(t)}\diff t-
    \int_{t_{1}}^{t_{2}}\left[\frac{d}{\diff t}\braket{\psi(t)|\delta\psi(t)}-
                              \braket{\dot{\psi(t)}|\delta\psi}\right]\diff t\\
    -\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}\diff t
  \end{multlined}
\\
&=
  \begin{multlined}[t]
    \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert-\hat{H}|\psi(t)}\diff t-
    i\braket{\psi(t)|\delta\psi(t)}
    -i\int_{t_{1}}^{t_{2}}\braket{\dot{\psi}(t)|\delta\psi(t)}\diff t\\
    -\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}\diff t
  \end{multlined}
\\
\intertext{Since $\delta\psi(t_{1})=\delta\psi(t_{2})=0$}
&=
  \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert|\psi(t)}\diff t-
  i\int_{t_{1}}^{t_{2}}\braket[*]{\delta\psi(t)|\dot{\psi(t)}}\diff t-
  \int_{t_{1}}^{t_{2}}\braket[*]{\delta\psi(t)|\hat{H}|\psi(t)}\diff t
\\
\intertext{Using $\braket{\beta|\hat{H}|\alpha}=\braket[*]{\alpha|\hat{H}^{\dagger}|\beta}$}
&=
  \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert-\hat{H}|\psi(t)}\diff t-
  i\int_{t_{1}}^{t_{2}}\braket[*]{\delta\psi(t)|-{\pdert|\psi}}\diff t-
  \int_{t_{1}}^{t_{2}}{\braket[*]{\delta\psi(t)|\hat{H}|\psi(t)}}\diff t
\\
&=
  \int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\pdert-\hat{H}|\psi(t)}\diff t-
  \int_{t_{1}}^{t_{2}}\braket[*]{\delta\psi(t)|i{\pdert-\hat{H}|\psi(t)}}\diff t
\end{align*}
\end{document}

enter image description here

1

Since \qquad inserts 36mu of horizontal whitespace, 11 consecutive \qquad directives can be written more succinctly as \mkern396mu.

Here's a solution that uses a single align* environment, along with a couple of \intertext directives and three \mkern396mu instructions. I use \allowdisplaybreaks as well, just in case a page break needs to occur. I also suggest replacing all \frac directives with \tfrac. Finally, the two instances of \dot{\psi(t)} should probably be written as \dot{\psi}(t), right?

enter image description here

\documentclass{article}
\usepackage{mathtools}
\usepackage{braket}
\allowdisplaybreaks
\begin{document}
\begin{align*}
\delta\mathcal{S}(\psi)
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}dt+\int_{t_{1}}^{t_{2}}\braket{\psi(t)|i\tfrac{\partial}{\partial t}|\delta\psi(t)}dt\\
&\mkern396mu-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\delta\dot{\psi}(t)}dt-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-\int_{t_{1}}^{t_{2}}\left[\tfrac{d}{dt}\braket{\psi(t)|\delta\psi(t)}-\braket{\dot{\psi}(t)|\delta\psi}\right]dt\\
&\mkern396mu-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\braket{\psi(t)|\delta\psi(t)}   -i\int_{t_{1}}^{t_{2}}\braket{\dot{\psi}(t)|\delta\psi(t)}dt\\
&\mkern396mu-\int_{t_{1}}^{t_{2}}\braket{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
\intertext{Since $\delta\psi(t_{1})= \delta\psi(t_{2})=0$}
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|\dot{\psi}(t)}^{*}dt-\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|\hat{H}|\psi(t)}^{*}dt\\
\intertext{And since $\braket{\beta|\hat{H}|\alpha}={\braket{\alpha|\hat{H}^{\dagger}|\beta}}^{*}$}
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|-{\tfrac{\partial}{\partial t}|\psi}}^{*}dt-\int_{t_{1}}^{t_{2}}{\braket{\delta\psi(t)|\hat{H}|\psi(t)}}^{*}dt\\
&=\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-\int_{t_{1}}^{t_{2}}\braket{\delta\psi(t)|i{\tfrac{\partial}{\partial t}-\hat{H}|\psi(t)}}^{*}dt
\end{align*}
\end{document}
1

I propose two different alignments instead of multlined. I also redefined the \braket command thanks to \mathtools and xparse to have a simple syntax, close to what one writes by hand, namely:: \braket{a|b|c}.

Also note that, if you use the geometry package (without changing whatever), a number of equations don't have to be split across lines.

\documentclass{article}
\usepackage{mathtools}

\usepackage{xparse}
\DeclarePairedDelimiterX\braket[1]{\langle}{\rangle}{\braketargs{#1}}%
\NewDocumentCommand{\braketargs}{ >{\SplitArgument{2}{|}}m }
{\braketargsaux#1}
\NewDocumentCommand{\braketargsaux}{ m m m}%
{\IfNoValueTF{#3}{\IfNoValueTF{#2}{#1}{#1\,\delimsize\vert\,\mathopen{}#2}}%
{#1\,\delimsize\vert\,\mathopen{}#2\,\delimsize\vert\,\mathopen{}#3}}%

\begin{document}
\begin{align*}
  \delta\mathcal{S}(\psi)&=
  \! \begin{aligned}[t]\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt +\int_{t_{1}}^{t_{2}}\braket[\Big]{\psi(t)|i\frac{\partial}{\partial t}|\delta\psi(t)}dt&\\
  -\int_{t_{1}}^{t_{2}}\braket[\big]{\psi(t)|\hat{H}|\delta\psi(t)}dt&
  \end{aligned}\\
    & = \! \begin{aligned}[t]\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)| i\frac{\partial}{\partial t}-\hat{H}| \psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket[\big]{\psi(t)|\delta\dot{\psi}(t)}dt & \\-\int_{t_{1}}^{t_{2}}\braket[\big]{\psi(t)|\hat{H}|\delta\psi}dt &
  \end{aligned}\\
  &= \! \begin{aligned}[t]\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-\int_{t_{1}}^{t_{2}}\left[\frac{d}{dt}\braket[\big]{\psi(t)|\delta\psi(t)}-\braket[\big]{\dot{\psi(t)}|\delta\psi}\right]dt & \\
  \smash[t]{-\int_{t_{1}}^{t_{2}}}\braket[\big]{\psi(t)|\hat{H}|\delta\psi(t)}dt &
  \end{aligned}\\
    & = \! \begin{aligned}[t]\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\braket[\big]{\psi(t)|\delta\psi(t)} -i\int_{t_{1}}^{t_{2}}\braket[\big]{\dot{\psi}(t)|\delta\psi(t)}dt & \\ -\int_{t_{1}}^{t_{2}}\braket[\big]{\psi(t)|\hat{H}|\delta\psi(t)}dt &
  \end{aligned}\\
  \intertext{Since $ \delta\psi(t_{1})=\delta\psi(t_{2})=0 $}
    & = \! \begin{aligned}[t]\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket[\big]{\delta\psi(t)|\dot{\psi(t)}}^{*}dt & \\-\int_{t_{1}}^{t_{2}}\braket[\big]{\delta\psi(t)|\hat{H}|\psi(t)}^{*}dt &
  \end{aligned}\\
  \braket[\big]{\beta|\hat{H}|\alpha} & \! \begin{aligned}[t]={\braket[\big]{\alpha|\hat{H}^{\dagger}|\beta}}^{*}
  =\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|-{\frac{\partial}{\partial t}|\psi}}^{*}dt & \\ -\int_{t_{1}}^{t_{2}}{\braket[\big]{\delta\psi(t)|\hat{H}|\psi(t)}}^{*}dt &
  \end{aligned}\\
  &=\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i{\frac{\partial}{\partial t}-\hat{H}|\psi(t)}}^{*}dt
\end{align*}
\newpage
\allowdisplaybreaks
\begin{align*}
  \delta\mathcal{S}(\psi) & =
  \int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt +\int_{t_{1}}^{t_{2}}\braket[\Big]{\psi(t)|i\frac{\partial}{\partial t}|\delta\psi(t)}dt \\ \MoveEqLeft[-3]-\smash[t]{\int_{t_{1}}^{t_{2}}}\braket[\big]{\psi(t)|\hat{H}|\delta\psi(t)}dt\\ \MoveEqLeft[-3]\smash[t]{-\int_{t_{1}}^{t_{2}}}\braket[\big]{\psi(t)|\hat{H}|\delta\psi(t)}dt\\
  \intertext{Since $ \delta\psi(t_{1})=\delta\psi(t_{2})=0 $: } \\
  \MoveEqLeft[-3]-\smash[t]{\int_{t_{1}}^{t_{2}}}\braket[\big]{\delta\psi(t)|\hat{H}|\psi(t)}^{*}dt\\
  \braket[\big]{\beta|\hat{H}|\alpha} & ={\braket[\big]{\alpha|\hat{H}^{\dagger}|\beta}}^{*}
  =\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|i\frac{\partial}{\partial t}-\hat{H}|\psi(t)}dt-i\int_{t_{1}}^{t_{2}}\braket[\Big]{\delta\psi(t)|-{\frac{\partial}{\partial t}|\psi}}^{*}dt & \\
  \MoveEqLeft[-3]-\smash[t]{\int_{t_{1}}^{t_{2}}}{\braket[\big]{\delta\psi(t)|\hat{H}|\psi(t)}}^{*}dt\\ t}-\hat{H}|\psi(t)}}^{*}dt
\end{align*}

\end{document} 

enter image description here

enter image description here

You must log in to answer this question.

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