\documentclass{article}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\begin{align}
\hat{\alpha} &= \begin{cases}
\tan^{-1}\frac{\hat{\alpha_1}}{\hat{\alpha_2}}, \, &\text{if } \hat{\alpha_1}>0 \, \hat{\alpha_2}>0 \\
\tan^{-1}\frac{\hat{\alpha_1}}{\hat{\alpha_2}}+\pi, \, &\text{if } \hat{\alpha_1}<0 \\
\tan^{-1}\frac{\hat{\alpha_1}}{\hat{\alpha_2}}+2\pi, \, &\text{if }\hat{\alpha_2}<0 \, \hat{\alpha_1} >0 \\
\text{undefined}, & \hat{\alpha_2}=0 \, \hat{\alpha_1}=0
\end{cases}
\end{align}
\end{document}
I need to numbering of this cases but when i put align code , the file not compiling because \par .... what is wrong please help me i attempt every probability to solve this

