# Problem with align and cases

I am trying to align my cases with other lines in my align environment but have had no luck thus far. Can you tell me how to align all these lines:

Here is my code:

\documentclass[11pt]{article}

\usepackage[framemethod=default]{mdframed}
\usepackage{mathtools}
\usepackage[most]{tcolorbox}
\tcbset{myformula/.style={
arc=0pt,
outer arc=0pt,
colback=blue!10,
colframe=green,
boxrule=0.8pt,
left=2pt,
right=2pt,
highlight math style={
arc=0pt,
outer arc=0pt,
colback=green,
colframe=red.
}
}
}

\begin{document}

\begin{tcolorbox}[ams align, myformula]
Q(z) & =  a_{n}z^{n} + a_{n-1}z^{n-1} + \dots + a_{2}z^{2} + a_{1}z^{1} + a_{0} = 0
\intertext{The conditions for stability are}\\
Q(1) & >  0
\intertext{and:}
\begin{dcases}
Q(-1) & >  0 \quad \text{if $n$ is even}\\
Q(-1) & <  0\quad \text{if $n$ is odd}
\end{dcases}
\end{tcolorbox}

\end{document}

• The & in dcases separates the formula from its description, so it should be Q(-1)>0 & \text{if $n$ is even}. Aside from this, are you sure you want to align those three formulas? I have no doubt I wouldn't. – egreg Jun 1 '17 at 6:13
• Why did you add a double backslash after the first \intertext? – Bernard Jun 1 '17 at 7:29

\begin{tcolorbox}[ams align, myformula]
& Q(z) =  a_{n}z^{n} + a_{n-1}z^{n-1} + \dots + a_{2}z^{2} + a_{1}z^{1} + a_{0} =
0
\intertext{The conditions for stability are}
& Q(1) >  0
\intertext{and:}
& \begin{dcases}
Q(-1) & >  0 \quad \text{if $n$ is even}\\
Q(-1) & <  0\quad \text{if $n$ is odd}
\end{dcases}
\end{tcolorbox}


A… well, not-so-slight (:-) improvement on Herbert’s answer:

\documentclass[11pt]{article}

\usepackage[framemethod=default]{mdframed}
\usepackage{mathtools}
\usepackage[most]{tcolorbox}
\tcbset{myformula/.style={
arc=0pt,
outer arc=0pt,
colback=blue!10,
colframe=green,
boxrule=0.8pt,
left=2pt,
right=2pt,
highlight math style={
arc=0pt,
outer arc=0pt,
colback=green,
colframe=red.
}
}
}

\begin{document}

\begin{tcolorbox}[ams align, myformula]
& Q(z) = a_{n}z^{n} + a_{n-1}z^{n-1} + \dots + a_{2}z^{2} + a_{1}z^{1} + a_{0}
= 0
\intertext{The conditions for stability are}
& Q(1) >  0
\intertext{and:}
& \begin{dcases*}
Q(-1) > 0, & if $n$ is even;\\
Q(-1) < 0, & if $n$ is odd.
\end{dcases*}
\end{tcolorbox}
\end{document}


The output is: