  We establish formulas that give the intrinsic volumes, or curvature measures,
of sublevel sets of functions defined on Riemannian manifolds as integrals of
functionals of the function and its derivatives. For instance, in the Euclidean
case, if $f \in \mathcal{C}^3(\mathbb{R}^n, \mathbb{R})$ and 0 is a regular
value of $f$, then the intrinsic volume of degree $n-k$ of the sublevel set
$M^0 = f^{-1}(]-\infty, 0])$, if the latter is compact, is given by
\begin{equation*} \mathcal{L}_{n-k}(M^0) = \frac{\Gamma(k/2)}{2 \pi^{k/2}
(k-1)!} \int_{M^0} \operatorname{div} \left( \frac{P_{n,
k}(\operatorname{Hess}(f), \nabla f)}{\sqrt{f^{2(3k-2)} + \|\nabla
f\|^{2(3k-2)}}} \nabla f \right) \operatorname{vol}_n \end{equation*} for $1
\leq k \leq n$, where the $P_{n, k}$'s are polynomials given in the text.
  This includes as special cases the Euler--Poincar\'e characteristic of
sublevel sets and the nodal volumes of functions defined on Riemannian
manifolds. Therefore, these formulas give what can be seen as generalizations
of the Kac--Rice formula.
  Finally, we use these formulas to prove the Lipschitz continuity of the
intrinsic volumes of sublevel sets.
