  In this paper, we consider the following variational problem:
\begin{eqnarray*} \inf_{u\in
D^{1,2}_a(\bbr^N)\backslash\mathcal{Z}}\frac{\|u\|^2_{D^{1,2}_a(\bbr^N)}-C_{a,b,N}^{-1}\|u\|^2_{L^{p+1}(|x|^{-b(p+1)},\bbr^N)}}{dist_{D^{1,2}_{a}}^2(u,
\mathcal{Z})}:=c_{BE}, \end{eqnarray*} where $N\geq2$, $b_{FS}(a)<b<a+1$ for
$a<0$ and $a\leq b<a+1$ for $0\leq a<a_c:=\frac{N-2}{2}$ and $a+b>0$ with
$b_{FS}(a)$ being the Felli-Schneider curve, $p=\frac{N+2(1+a-b)}{N-2(1+a-b)}$,
$\mathcal{Z}= \{ c \tau^{a_c-a}W(\tau x)\mid c\in\bbr\backslash\{0\}, \tau>0\}$
and up to dilations and scalar multiplications, $W(x)$, which is positive and
radially symmetric, is the unique extremal function of the following classical
Caffarelli-Kohn-Nirenberg (CKN for short) inequality \begin{eqnarray*}
\bigg(\int_{\bbr^N}|x|^{-b(p+1)}|u|^{p+1}dx\bigg)^{\frac{2}{p+1}}\leq
C_{a,b,N}\int_{\bbr^N}|x|^{-2a}|\nabla u|^2dx \end{eqnarray*} with $C_{a,b,N}$
being the optimal constant. It is known in \cite{WW2022} that $c_{BE}>0$. In
this paper, we prove that the above variational problem has a minimizer for
$N\geq2$ under the following two assumptions: \begin{enumerate}
\item[$(i)$]\quad $a_c^*\leq a<a_c$ and $a\leq b<a+1$, \item[$(ii)$]\quad
$a<a_c^*$ and $b_{FS}^*(a)\leq b<a+1$, \end{enumerate} where
$a_c^*=\bigg(1-\sqrt{\frac{N-1}{2N}}\bigg)a_c$ and \begin{eqnarray*}
b_{FS}^*(a)=\frac{(a_c-a)N}{a_c-a+\sqrt{(a_c-a)^2+N-1}}+a-a_c. \end{eqnarray*}
Our results extend that of Konig in \cite{K2023} for the Sobolev inequality to
the CKN inequality. Moreover, we believe that our assumptions~$(i)$ and $(ii)$
are optimal for the existence of minimizers of the above variational problem.

Analysis of PDEs