Aligning conditions in cases environment
You could use alignedat
instead, for aligning at several places, with a big brace on the left:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
f(x) = \left\{\begin{alignedat}{2}
& mx^2 +nx +1, && x \le -1 \\
& 2m e^{|x|-1} + \sin \pi x - 3n, \qquad & -1 < {}&x < 1 \\
& 3x^2 - (m+n)x, && x \ge 1
\end{alignedat}\right.
\]
\end{document}
A different solution, which extends the cases
environment. It adds an optional argument for defining array column options. The standard cases
behavior is the default, so without optional argument it's like the normal amsmath's cases.
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\renewcommand{\env@cases}[1][@{}l@{\quad}l@{}]{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{1.2}%
\array{#1}%
}
\makeatother
\begin{document}
\[
f(x) = \begin{cases}[@{}l@{\quad}r@{}l@{}]
mx^2 +nx +1, & &x \le -1 \\
2m e^{|x|-1} + \sin \pi x - 3n, & -1 < {} &x < 1 \\
3x^2 - (m+n)x, & &x \ge 1
\end{cases}
\]
\end{document}
I would recommend using a \phantom{-1 <{}}
to achieve the proper spacing. This will reserve as much space as is taken up by -1 <
(with the additional {}
to get the proper spacing on the right hand side of the <
):
If you also want the 1
aligned on the right hand side you can add \phantom{-}
before the 1
to get:
\documentclass{article}
\usepackage{amsmath}
\newcommand*{\Phantom}{\phantom{-1 <{}}}%
\begin{document}
\[
f(x) = \begin{cases}
mx^2 +nx +1, & \Phantom x \le -1 \\
2m e^{|x|-1} + \sin \pi x - 3n, & -1 < x < \phantom{-}1 \\
3x^2 - (m+n)x, & \Phantom x \ge \phantom{-}1
\end{cases}
\]
\end{document}