The following code:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{cases}
Af &=g \quad \text{if} \ c,\\
f&=0 \quad \text{if} \ d.
\end{cases}$
\end{document}
How to align the two f's vertically (so that they are both in the same distance from the '=' sign)?


\quadthere. In the second line, write\phantom{A}fto get thefs aligned. – Manuel Mar 23 '16 at 09:02{cases}, the&is there to separate columns, not before the equal. – Manuel Mar 23 '16 at 09:06&=inside a{cases}environment. – Manuel Mar 23 '16 at 10:22