# Piecewise Function Alignment

The third row of the piecewise function does dot align with the first two rows

f(x) =
\begin{cases}
2x   & -2<x \\
2 & -2\le x\le  1 \\
3x^2 & 1<x\\
\end{cases}
\]


How can I resolve this issue

With the help of \phantom:
\documentclass{article}
$f(x) = \begin{cases} 2x & -2<x \\ 2 & -2\le x\le 1 \\ 3x^2 & \phantom{-}1<x\\ \end{cases}$