  In this paper we classify all positive extremal functions to a sharp weighted
Sobolev inequality on the upper half space, which involves divergent operators
with degeneracy on the boundary. As an application of the results, we can
derive a sharp Sobolev type inequality involving Baouendi-Grushin operator, and
classify certain extremal functions for all $\tau>0$ and $m\ne2 $ or $ n\ne1$.
