# breqn not aligning first two lines

I have input of the following form (where I have redefined $to be \begin{dmath*} and$ to be \end{dmath*})

\begin{dgroup*}
$A = \frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\sum_{i=0}^{k-1}\delta s_i \norm*{\frac{dH(s)}{ds}} + 7\sum_{i=0}^{k-1}\int_{s_i}^{s_{i+1}}\frac{ds}{\gamma(s)^3} \norm*{\frac{dH(s)}{ds}}^2\right]$$= \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_{s_i}^{s_{i+1}}\frac{ds}{{\delta s_i}^2\gamma(s)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]$$= \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_0^1 \frac{\delta s_i d\sigma_i}{{\delta s_i}^2\gamma(\sigma_i\delta s_i + s_i)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]$
etc.
\end{dgroup*}


and I get the output

where the first and second equals signs are not aligned. All subsequent equals signs are. I can't find this problem anywhere on the internet and it keeps happening. It doesn't occur for every dgroup, and if I switch back to the align environment everything works fine. Does anyone know what could be going on under the hood to cause this? Or is there a simple fix without reverting to the align environment?

You're misusing breqn by splitting the rows manually.

\documentclass{article}
\usepackage{geometry} % wider textwidth
\usepackage{amsmath,mathtools,breqn}

\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

\begin{document}

\begin{dmath*}
A = \frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\sum_{i=0}^{k-1}\delta s_i \norm*{\frac{dH(s)}{ds}} + 7\sum_{i=0}^{k-1}\int_{s_i}^{s_{i+1}}\frac{ds}{\gamma(s)^3} \norm*{\frac{dH(s)}{ds}}^2\right]
= \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_{s_i}^{s_{i+1}}\frac{ds}{{\delta s_i}^2\gamma(s)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]
= \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_0^1 \frac{\delta s_i d\sigma_i}{{\delta s_i}^2\gamma(\sigma_i\delta s_i + s_i)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]
\end{dmath*}

\end{document}


I would use a different environment. The align is defined by & and the new line is defined by \\. I also changed the subscript of \min (you can easily go back to your version). You probably want to consider using an upright d for derivatives.

Please make sure to publish an MWE next time, see I've just been asked to write a minimal example, what is that?.

\documentclass{memoir}
\usepackage{amsmath,mathtools}
\DeclarePairedDelimiter\norm{\lVert}{\lVert}

\begin{document}
\begin{align*}
A&=\frac{1}{T}\left[\frac{2}{\left(\min\limits_{s\in [0,1]}\gamma(s)\right)^2}\sum_{i=0}^{k-1}\delta s_i \norm*{\frac{dH(s)}{ds}} + 7\sum_{i=0}^{k-1}\int_{s_i}^{s_{i+1}}\frac{ds}{\gamma(s)^3} \norm*{\frac{dH(s)}{ds}}^2\right]\\
&=\sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min\limits_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_{s_i}^{s_{i+1}}\frac{ds}{{\delta s_i}^2\gamma(s)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]\\
&=\sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min\limits_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_0^1 \frac{\delta s_i d\sigma_i}{{\delta s_i}^2\gamma(\sigma_i\delta s_i + s_i)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]
\end{align*}
\end{document}


• The choice of doing \left(\min\limits_{s\in[0,1]}\gamma(s)\right)^2 is quite disastrous. – egreg Sep 23 '18 at 21:05
• Removing \left and \right would give a more acceptable result – egreg Sep 23 '18 at 21:11