[Tex/LaTex] Split environment not vertically centering equation number

equationsvertical alignment

I'm trying to compile the following code:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\invexpsqrt}[1]{{#1}^{- \tfrac{1}{2}}}

\begin{document}
\begin{align}
\begin{split}
\rho_{out} &= \exp \left[ - \frac{1}{2} \left( x \cdot \gamma \cdot x + x' \cdot \gamma \cdot x' \right) + x \cdot \beta \cdot x' \right] \\
&= \exp \left[- \frac{1}{2} \left( V \gamma_D^{-\tfrac{1}{2}} y V^T \gamma_D V V^T \gamma_D^{- \tfrac{1}{2}} y + V \invexpsqrt{\gamma_D} y' V^T \gamma_D V V^T \invexpsqrt{\gamma_D} y' \right) \right. \\
&\qquad \qquad \left. + V \invexpsqrt{\gamma_D} y \beta V^T \invexpsqrt{\gamma_D} y' \right] \\
&= \exp \left[ - \frac{1}{2} \left( y \cdot y + y' \cdot y' \right) + y \cdot \left( \invexpsqrt{\gamma_D} V \beta V^T \invexpsqrt{\gamma_D} \right) \cdot y' \right] \\
&= \exp \left[ - \frac{1}{2} \left( y \cdot y + y' \cdot y' \right) + y \cdot \beta' \cdot y' \right]
\end{split}
\end{align}
\end{document}

to get a single, vertically centered equation number. However, my output comes out like this:
Misaligned equation number

I have tried replacing the align environment with the equation environment and using \aligned within \equation. All of these yield the same result.
Is there a command in my code that messes up the alignment, or is this problem caused by my compiler?

Edit: I just noted that another piece of code like this in the same file does not produce the same problem. Could it be that the second line of equations is too wide and therefore 'pushes' the numbering down?

Best Answer

If you want the single equation number to be centered vertically on the group of aligned equations, it's best to use a single equation environment containing a split environment.

A couple of additional suggestions: (1) Use the macro \invexpsqrt{\gamma_D} consistently (the second line doesn't contain them in your MWE). (2) Don't use auto-sized parentheses and bracket as they're a bit too large for the job at hand; use \Bigl and \Bigr instead.

With these adjustments in place, there's enough room to place the equation number right where you want it to be.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\newcommand{\invexpsqrt}[1]{#1^{-\frac{1}{2}}}
\begin{document}
\begin{equation}
\begin{split}
\rho_{out} 
&= \exp \Bigl[ -\tfrac{1}{2} \Bigl( x \cdot \gamma \cdot x + x' \cdot \gamma \cdot x' \Bigr) + x \cdot \beta \cdot x' \Bigr] \\
&= \exp \Bigl[-\tfrac{1}{2} \Bigl( V \invexpsqrt{\gamma_D} y V^T \gamma_D V V^T \invexpsqrt{\gamma_D} y + V \invexpsqrt{\gamma_D} y' V^T \gamma_D V V^T \invexpsqrt{\gamma_D} y' \Bigr)  \\
&\qquad \qquad  + V \invexpsqrt{\gamma_D} y \beta V^T \invexpsqrt{\gamma_D} y' \Bigr] \\
&= \exp \Bigl[ -\tfrac{1}{2} \Bigl( y \cdot y + y' \cdot y' \Bigr) + y \cdot \Bigl( \invexpsqrt{\gamma_D} V \beta V^T \invexpsqrt{\gamma_D} \Bigr) \cdot y' \Bigr] \\
&= \exp \Bigl[ -\tfrac{1}{2} \Bigl( y \cdot y + y' \cdot y' \Bigr) + y \cdot \beta' \cdot y' \Bigr]
\end{split}
\end{equation}
\end{document}