You can compare four ways to get the result.
The alignment with the original code happens essentially by chance and needs visual formatting (additions of \quad
and \;
).
With Bmatrix
the alignment is again by chance (the second column items have the same width).
With cases
, adding \left.
and \right.
, a bigger space after \equiv
is used.
The best, in my opinion, is to use \left\{
and \right\}
, with a nested aligned
so you can clearly state the desired left alignment of both columns.
In any case, it should be \text{if $x=0$}
, so no awkward explicit \;
is needed (which is not a normal interword space). Also \,
should precede dx
, not \;
.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\subsubsection*{Original without \texttt{\string\all}}
\begin{equation}
\delta(x)\equiv\left\{\begin{aligned}
0,\quad
\text{if}\;x\ne 0\\
\infty,\quad
\text{if}\; x=0
\end{aligned}\right\}\quad
\text{with}\quad\int_{-\infty}^{+\infty}\delta(x)\;dx=1.
\end{equation}
\subsubsection*{With \texttt{Bmatrix}}
\begin{equation}
\delta(x)\equiv
\begin{Bmatrix}
0, & \text{if $x\ne 0$} \\
\infty, & \text{if $x=0$}
\end{Bmatrix}
\quad\text{with}\quad
\int_{-\infty}^{+\infty}\delta(x)\,dx=1.
\end{equation}
\subsubsection*{With \texttt{cases}}
\begin{equation}
\delta(x)\equiv
\left.
\begin{cases}
0, & \text{if $x\ne 0$} \\
\infty, & \text{if $x=0$}
\end{cases}\right\}
\quad\text{with}\quad
\int_{-\infty}^{+\infty}\delta(x)\,dx=1.
\end{equation}
\subsubsection*{With \texttt{aligned}}
\begin{equation}
\delta(x)\equiv
\left\{
\begin{aligned}
&0, && \text{if $x\ne 0$} \\
&\infty, && \text{if $x=0$}
\end{aligned}
\right\}
\quad\text{with}\quad
\int_{-\infty}^{+\infty}\delta(x)\,dx=1.
\end{equation}
\end{document}
\all
in the second line, your code seems to produce the desired result