Prove that the scalar curvature $K(p)$ at $p \in M$ is given by $$ K(p) = \frac 1{\omega_{n-1}} \int_{S^{n-1}} \text{Ric}_p(x) dS^{n-1}, $$ where $\omega_{n-1}$ is the area of the sphere $S^{n-1}$ in $T_pM$ and $dS^{n-1}$ is the area elements on $S^{n-1}$.
This is Exercise 4.9 of Riemannian Geometry by do Carmo.
Hint: Use the following general argument on quadratic forms. Consider an orthonormal basis $e_1,\ldots,e_n$ in $T_pM$ such that if $x = \sum_{i=1}^n x_ie_i$, $$ \text{Ric}_p(x)=\sum_i \lambda_i x_i^2, \quad \lambda_i \text{ real}. $$ Because $|x|=1$, the vector $\nu = (x_1,\ldots,x_n)$ is a unit normal vector on $S^{n-1}$. Denoting $V=(\lambda_1 x_1,\ldots,\lambda_n x_n)$, and using Stokes Theorem, we obtain \begin{align} \frac 1{\omega_{n-1}} \int_{S^{n-1}} \sum_i \lambda_i x_i^2 dS^{n-1} &= \frac 1{\omega_{n-1}} \int_{S^{n-1}} \langle V,\nu \rangle dS^{n-1} \\ &= \frac 1{\omega_{n-1}} \int_{B^n} \text{div} V dB^n, \end{align} where $B^n$ is the unit ball whose boundary is $S^{n-1}=\partial B^n$. Noting that $\frac{\text{vol} B^n}{\omega_n}=\frac 1n$, we conclude that \begin{align} \frac 1{\omega_{n-1}} \int_{S^{n-1}} \text{Ric}_p(x) dS^{n-1} &= \frac 1n \text{div}V=\frac{\sum_i \lambda_i}n \\ &= \frac{\sum_i \text{Ric}_p(e_i)}n = K(p). \end{align}
I was able to successfully provide details to every equality established in the hint except one. So my only question from all this is the justification of the equality $$ \frac 1{\omega_{n-1}} \int_{S^{n-1}} \text{Ric}_p(x) dS^{n-1} = \frac 1n \text{div}V. $$ What I have so far: \begin{align} \frac 1{\omega_{n-1}} \int_{S^{n-1}} \text{Ric}_p(x) dS^{n-1} &= \frac 1{\omega_{n-1}} \int_{S^{n-1}} \sum_i \lambda_i x_i^2 dS^{n-1} \\ &= \frac 1{\omega_{n-1}} \int_{B^n} \text{div} V dB^n \\ &= \frac {\text{div} V}{\omega_{n-1}} \int_{B^n} dB^n \quad (?) \\ &= \frac {\text{div} V}{\omega_{n-1}} \text{vol} B^n \end{align} and after that I wanted to use $\frac{\text{vol} B^n}{\omega_n}=\frac 1n$ but what was confusing me is that I essentially have $\frac 1{\omega_{n-1}}$, not $\frac 1{\omega_n}$. Also, would I be able to (and, if so, should I?) pull $\text{div} V = \sum_i \lambda_i$ out of the integral?
Volume of the ball is the integral of the area of the sphere, and the factor $\frac{1}{n}$ comes from integration.