  We solve variationally certain equations of stellar dynamics of the form
$-\sum_i\partial_{ii} u(x) =\frac{|u|^{p-2}u(x)}{{\rm dist} (x,{\mathcal A}
)^s}$ in a domain $\Omega$ of $\rn$, where ${\mathcal A} $ is a proper linear
subspace of $\rn$. Existence problems are related to the question of
attainability of the best constant in the following recent inequality of
Badiale-Tarantello [1]: $$0<\mu_{s,\P}(\Omega)=\inf{\int_{\Omega}|\nabla u|^2
dx; u\in \huno \hbox{and}\int_{\Omega}\frac{|u(x)|^{\crit(s)}}{|\pi(x)|^s}
dx=1}$$ where $0<s<2$, $\crit(s)=\frac{2(n-s)}{n-2}$ and where $\pi$ is the
orthogonal projection on a linear space $\P$, where $\hbox{dim}_{\rr}\P \geq
2$. We investigate this question and how it depends on the relative position of
the subspace $\Porth$, the orthogonal of $\P$, with respect to the domain
$\Omega$ as well as on the curvature of the boundary $\partial\Omega$ at its
points of intersection with $\Porth $.
