I am trying to compute an integral of a $d$-manifold $\mathcal{M}$, projected onto the unit (hyper-)sphere $S^d = \{\vec{\omega} \in \mathbb{R}^{d+1} \,:\, \|\vec{\omega}\|=1\}$, both embedded in $\mathbb{R}^{d+1}$. Let $\vec{x} : [0,1]^d \rightarrow \mathbb{R}^{d+1}$ be a parametrization of $\mathcal{M} = \{\vec{x}(\vec{t}) \in \mathbb{R}^{d+1} \,:\, \vec{t} \in [0,1]^d\}$ and let it be sufficiently smooth. Also let a function $f:S^d\rightarrow \mathbb{R}$ be given. The radial projection from $\mathcal{M}$ onto $S^d$ is:
$$P: \mathbb{R}^{d+1} \rightarrow \mathbb{R}^{d+1}, \,P(\vec{x}) = \frac{\vec{x}}{\|\vec{x}\|}$$
The integral then reads (taking into consideration Shifrin's comment, this is where I made a mistake):
$$\int_{S^d}f(\vec{\omega})\,d\vec{\omega} = \int_{S^d}f(P(\vec{x}))\,dP(\vec{x}) = \int_{\mathcal{M}}f(P(\vec{x}))\left|det[J_P(\vec{x})]\right|\,d\vec{x} \\ J_P(\vec{x}) = \frac{\partial P}{\partial \vec{x}}(\vec{x})$$
However, unsurprisingly the determinant of the Jacobian is zero, since it has a zero eigenvalue along $\vec{x}$:
$$J_{P}(\vec{x}) = \frac{1}{\|\vec{x}\|}\left(I- \frac{\vec{x}\vec{x}^T}{\|\vec{x}\|^2}\right)$$
I have seen elsewhere (e.g. wikipedia, the page on solid angle for $d=2$) that one gets a term $\frac{1}{\|x\|^2}\left(\frac{\vec{x}}{\|\vec{x}\|} \cdot n_{\vec{x}}\right)$ instead (where $n_{\vec{x}}$ is the normal of $\mathcal{M}$ at $\vec{x}$), i.e.:
$$\int_{S^d}f(\vec{\omega})\,d\vec{\omega} = \int_{\mathcal{M}}f(P(\vec{x}))\frac{1}{\|x\|^2}\left(\frac{\vec{x}}{\|\vec{x}\|} \cdot n_{\vec{x}}\right)\,d\vec{x}$$
After this I can use:
$$\int_{\mathcal{M}}f(P(\vec{x}))\frac{1}{\|x\|^2}\left(\frac{\vec{x}}{\|\vec{x}\|} \cdot n_{\vec{x}}\right)\,d\vec{x} = \int_{[0,1]^d}f(P(\vec{x}(\vec{t})))\frac{1}{\|x\|^2}\left(\frac{\vec{x}}{\|\vec{x}\|} \cdot n_{\vec{x}}\right)\sqrt{det[g(\vec{t})]}\,d\vec{t} \\ g(\vec{t}) = \left(\frac{\partial \vec{x}}{\partial \vec{t}}(\vec{t})\right)^T\left(\frac{\partial \vec{x}}{\partial \vec{t}}(\vec{t})\right),$$
to compute the integral.
Provided that the above is not wrong, my question is how is the term $\frac{1}{\|x\|^2}\left(\frac{\vec{x}}{\|\vec{x}\|} \cdot n_{\vec{x}}\right)$ derived in the first place, and how would I go about deriving a similar term for other projections (the current one projects on the unit sphere).
Edit: Taking into account Shifrin's comment I realized that I cannot split the two transformations as I have done above. Namely, when I was computing the metric tensor's determinant, I had used a property which doesn't hold for non-square matrices:
$$det[AB] = det[BA] = det[A]det[B],$$
in order to get:
$$det \left[\left(\frac{\partial P}{\partial \vec{t}}\right)^T\left(\frac{\partial P}{\partial \vec{t}}\right)\right] = det \left[\left(\frac{\partial P}{\partial \vec{x}}\frac{\partial \vec{x}}{\partial \vec{t}}\right)^T\left(\frac{\partial P}{\partial \vec{x}}\frac{\partial \vec{x}}{\partial \vec{t}}\right)\right] \\ \ne det \left[\left(\frac{\partial P}{\partial \vec{x}}\right)^T\left(\frac{\partial P}{\partial \vec{x}}\right)\right] det \left[\left(\frac{\partial \vec{x}}{\partial \vec{t}}\right)^T\left(\frac{\partial \vec{x}}{\partial \vec{t}}\right)\right].$$
Nevertheless, it seems like this can be factored in 3D (following the solid angle article in wikipedia) in the following manner instead:
$$\sqrt{det \left[\left(\frac{\partial P}{\partial \vec{t}}\right)^T\left(\frac{\partial P}{\partial \vec{t}}\right)\right]} = \frac{1}{\|\vec{x}\|^2}\left|\vec{n}_{\vec{x}} \cdot \frac{\vec{x}}{\|\vec{x}\|}\right| \sqrt{det\left[\left(\frac{\partial \vec{x}}{\partial \vec{t}}\right)^T\left(\frac{\partial \vec{x}}{\partial \vec{t}}\right)\right]}.$$
I am assuming that after many algebraic transformations the above can be proven at least in 3D. I am not aware whether there's a more general result for $d$ dimensions or how/whether this generalizes to other maps except $P$ (e.g. $Q:\mathcal{M} \rightarrow \mathcal{N}$, $Q$ sufficiently smooth, $\mathcal{N}$ being a different manifold). I have the suspicion that this can be derived somehow from the divergence theorem.
Note that in my comments below my question, $S$ corresponds to $P$ (I cannot edit the comments).