[Tex/LaTex] Amsmath split environment changes alignment inside gather

amsmathhorizontal alignmentsplit

I am using an amsmath split environment nested in a gather environment in order to obtain a three-lined equation with a single label aligned in center:

\documentclass[11pt, english, singlespacing]{MastersDoctoralThesis}    
\usepackage{palatino} % Use the Palatino font by default
\usepackage{amssymb,amsmath}

\begin{document}
\begin{gather}
\begin{split}
C_V = \left( \frac{\partial E}{\partial T} \right)_V\\
=\sum_{\boldsymbol{k},v}\hbar\omega (\boldsymbol{k},v) \frac{\partial n (\omega,T)}{\partial T}\\
=\sum_{\boldsymbol{k},v}k_B \left( \frac{\hbar\omega(\boldsymbol{k},v)}{k_B T} \right)^2 \frac{e^{\hbar\omega/k_B T}}{\left( e^{\hbar\omega/k_B T}-1 \right)^2 }
\label{eqn:heat_capacity}
\end{split}
\end{gather}
\end{document}

However when i compile the code above it results in the equations being aligned to the right. When i remove the nested split environment, equations are aligned to the center, correctly. Any ideas?

Best Answer

You can use a gathered environment nested in equation. But I'd rather suggest an alignment with aligned nested in equation (two possibilities of alignment).

I took the opportunity to simplify typing the code for partial derivatives, using the \diff(*) commands from the esdiff package, and improved the placement of exponents after a big parenthesis with \mathclap from mathtools:

\documentclass{article}
\usepackage{mathtools}
\usepackage{esdiff} 

\begin{document}

\begin{equation}
    \label{eqn:heat_capacity}
    \begin{gathered}
    C_V = \diffp*{E}{T}{V} \\
    =\sum_{\boldsymbol{k},v}\hbar\omega (\boldsymbol{k},v) \diffp{n (\omega,T)}{ T}\\[-0.5ex]
    =\sum_{\boldsymbol{k},v}k_B \left( \frac{\hbar\omega(\boldsymbol{k},v)}{k_B T} \right)^{\mathclap{2}} \frac{e^{\hbar\omega/k_B T}}{\left( e^{\hbar\omega/k_B T}-1 \right)^2 }
    \end{gathered}
\end{equation}
\bigskip

\begin{equation}
    \label{eqn:heat_capacity1}
    \begin{aligned}
    C_V & = \diffp*{E}{T}{V} =\sum_{\boldsymbol{k},v}\hbar\omega (\boldsymbol{k},v) \diffp{n (\omega,T)}{ T}\\[-0.5ex]
     & =\sum_{\boldsymbol{k},v}k_B \left( \frac{\hbar\omega(\boldsymbol{k},v)}{k_B T} \right)^{\mathclap{2}} \frac{e^{\hbar\omega/k_B T}}{\left( e^{\hbar\omega/k_B T}-1 \right)^2 }
    \end{aligned}
\end{equation}
\bigskip

\begin{equation}
    \label{eqn:heat_capacity1}
    \begin{aligned}
    C_V = \diffp*{E}{T}{V}& =\sum_{\boldsymbol{k},v}\hbar\omega (\boldsymbol{k},v) \diffp{n (\omega,T)}{ T}\\[-0.5ex]
     & =\sum_{\boldsymbol{k},v}k_B \left( \frac{\hbar\omega(\boldsymbol{k},v)}{k_B T} \right)^{\mathclap{2}} \frac{e^{\hbar\omega/k_B T}}{\left( e^{\hbar\omega/k_B T}-1 \right)^2 }
    \end{aligned}
\end{equation}

\end{document} 

enter image description here