differentiation of a volume Given a function $f(x)$. Then we define $D=\{x\mid f(x)>y\}\subset\mathbb{R}^n$ and $\Gamma=\{x\mid f(x)=y\}$. Now we define $S(y)=\int_D dx$. My question is what is the meaning of $S(y)$? Is it "size" (volume) of the domain $D$? How can I obtain $\frac{dS}{dy}$ and what is its meaning?
 A: If you assume $\nabla f \ne 0$, the derivative is given by the co-area formula:
$$
S(y) = \int_{f(x) > y} \,dx = \int_{t=y}^{t=\infty} \int_{f(x)=t} \frac{dA}{|\nabla f(x)|},
$$
where $dA$ is the $(n-1)$-dimensional volume form on each level set $f(x) = t$.
Equivalently,
$$
S'(y) = -\int_{f(x)=t} \frac{dA}{|\nabla f(x)|}.
$$
An explanation of the co-area formula can be found here: https://math.stackexchange.com/a/4031416/10584
A: No, $S(y)$ is the size of the projection of $D$ onto the $x$ axis. The meaning of the derivative is the speed of increase of $f$ when $f(x) = y.$
A: For some simple functions $f(x), x\in\mathbb{R}^n$ there may be a closed form solution. However, my suspicion is that in general there is no simple closed-form for $\frac{\text{d} S}{\text{d} y}$ (especially when $n>1$).
A simple example of a 1-dimensional function, i.e with $n=1$, defined on all of $\mathbb{R}$ is $f(x)=-x^2$.
Treating $D$ as a "function" of $y$, $D(y)=\{x\in\mathbb{R} | -x^2>y\}$ for some arbitrary $y\in\mathbb{R}$ as the parameter.
In this example, $S(y)$ is the piecewise function
$$S(y)= \begin{cases} 2\sqrt{-y}, \quad y<0\\ 0, \quad y\geq 0 \end{cases}$$
Defining the derivative of $S(y)$ is now relatively easy work. However, it is important to note that the derivative may be undefined at certain critical points, $y$, where a region of $f(x)$ is "disappearing" under the criterion $f(x)>y$ (loosely speaking). Intuitively, picture sweeping the horizontal line $y$ upwards (from "negative infinity") on the same plot as $f(x)$.
In this example $\frac{\text{d} S}{\text{d} y}$ is undefined at $y=0$, but can defined for all $y\neq 0$ as
$$``\frac{\text{d} S}{\text{d} y}"=\begin{cases} \frac{1}{\sqrt{-y}}, \quad y<0\\ 0, \quad y> 0 \end{cases}$$
Hopefully this illustrates how this can get out of hand very quickly. For example, when there is an interval $[a_i, b_i]$ that has $f(x)<y$ for all $y\in[a_i, b_i]$ but $f(x)>y+\Delta y$ for some $y+\Delta y$ (where $\Delta y$ is some arbitrarily small number at your discretion).
Intuitively, this $\Delta y$ is related to the derivative by it's definition:
$$\frac{\text{d} S}{\text{d} y}=\lim_{\Delta y\to 0} \frac{S(y+\Delta y)-S(y)}{\Delta y}$$
For another visualisation, picture sweeping downwards with horizontal line $y$. Every time a new peak is encountered, an interval $[a_i, b_i]$ emerges on $D$ (where previously $D \cap [a_i, b_i]=\emptyset$).
In general, $\frac{\text{d} S}{\text{d} y}$ represents the rate of change of the size of the domain of $f$ that is greater than $y$. Where size can be qualified to mean the Lebesgue measure.
