# Extra alignment tab error trying to justify within cases environment

I am trying to align brackets inside of cases. This is my equation:

\begin{align}
y(x)=
\begin{cases}
\bigg[ & 1+2 & \\
& +5+6 \bigg] & \text{if } x < 2, \\
\bigg[ & 11+12 & \\
& +15+16 \bigg] & \text{if }x > 2,\\
0 & & \text{otherwise.}
\end{cases}
\end{align}


When I compile this, I get the following error

! Extra alignment tab has been changed to \cr.


The same happens when I remove the align environment change it to equation instead.

$$y(x)= \begin{cases} \bigg[ & 1+2 & \\ & +5+6 \bigg] & \text{if } x < 2, \\ \bigg[ & 11+12 & \\ & +15+16 \bigg] & \text{if }x > 2,\\ 0 & & \text{otherwise.} \end{cases}$$


I searched for this problem, but all the questions seem to be about table environments.

• I think you can only use a single alignment tab (&) per case. When I delete the second & in each case, the error goes away. – NickD Mar 11 '17 at 3:14
• Right, it works that way. I was wondering if its possible to align brackets inside my multiline cases to make it easier to understand which brackets pair up. – highBandWidth Mar 11 '17 at 3:21
• Please complete your code so it produces the error you report. Right now it obviously will not get that far. – cfr Mar 11 '17 at 4:39

Nick has explained by this doesn't work. Two possible workarounds are shown below, one using array instead of cases, the other using a multlined (requires the mathtools package) inside cases.
And note that for single equations you should be using equation, not align (align vs equation).
\documentclass{article}
$$y(x)= \left\{ \begin{array}{@{\,}r@{}ll} \biggl[ & 1+2 & \\ & +5+6 \biggr] & \text{if } x < 2, \\ \biggl[ & 11+12 & \\ & +15+16 \biggr] & \text{if }x > 2,\\ 0 & & \text{otherwise.} \end{array}\right.$$
$$y(x)= \begin{cases} \begin{multlined}[b] \bigg[1+2 \\ +5+6 \bigg] \end{multlined} & \text{if } x < 2, \\ \begin{multlined}[b] \bigg[11+12 \\ +15+16 \bigg] \end{multlined} & \text{if }x > 2,\\ 0 & \text{otherwise.} \end{cases}$$