How to find the height of sand in an hourglass? EDIT: I have made an important correction to the "previous question" link below... it was accidentally pointing to an unrelated question before.
I would also like to emphasize that I welcome any completely different approach to the question (solving for height as a function of "P") -- not just a correction to/extension of my potentially flawed approach... the simpler the better, of course.
Also, I'm realizing that it's unclear whether I'm asking for a general solution for any shape that conforms to the described properties, or whether I'm asking for a specific, perhaps more elegant, solution specifically for the lemniscate of Bernoulli... or thirdly, for help completing my specific attempt at a solution.  I am interested in all those things, so, honestly I don't really know what to do about that other than to break the question up into multiple separate questions.  Hopefully it's OK as is.

Let's say we have an hourglass/"container-type" shape that when viewed in 2 dimensions is both horizontally and vertically symmetrical around its center... with its 3-dimensional "counterpart" being radially symmetric around its vertical axis.  I have chosen the lemniscate of Bernoulli:

We imagine the "top" half is "full" of "sand" -- or some imaginary substance that has a perfectly level surface.
Anyway, given that some percentage of the sand, P, has fallen to the bottom, how can we calculate the height of that sand as a function of P?

So that is the basic question.  It's been years since the calculus days (assuming the answer can't be found an easier way), and I have spend days getting extremely confused by this.

My attempt at an answer and the reasoning for it:
Apparently it is true that it makes no difference if we use a 2 or 3-dimensional world in which to make this calculation (I have verified this with a previous question).
Further, since the shape is symmetrical, we can literally, cut this problem in half by plotting half of the lemniscate in the following way (in fact, we probably only need a quarter of it):

Setting a = 1:

Because we have cut the problem in half, for our purposes now, the the total amount of sand is equal to one quarter the area of the original lemniscate -- the area under the curve of the above function on the interval (0,sqrt(2)):

This area = 0.5 because the area of a lemniscate is:
Area squared = 2 * a squared. (and a=1 as established already).
So let's say some amount of sand has fallen:

Now, we should be able to find the height, s, of that percent, P, of the sand in the bottom half... by solving for the upper limit of integration of:

Where f(x) is the "y =" function shown earlier.
However I'm stuck here because I can't find the integral of that function, presumably because it's not possible?  I tried using integral-calculator.com and it says it's not possible.
To summarize, my general approach (for any shape) is:

*

*Establish a "f(x)" function representing half of the shape in its horizontal orientation

*Calculate the "total area of sand"

*For a given percentage of sand that has fallen, solve for the height of sand by using a limit of integration.

More importantly, though, I'm sure there is a better way to do this whole problem... maybe an ultra-simple geometric way exists for the lemniscate due to its unique properties?
 A: I'll assume the hourglass is obtained by rotating the lemniscate about its axis of symmetry ($x$ axis).
The volume of sand in the lower part is then
$$
V=\int_{\sqrt2-h}^{\sqrt2}\pi y^2\,dx,
$$
where $h$ is the height of sand. Hence:
$$
P={\int_{\sqrt2-h}^{\sqrt2}\pi y^2\,dx
\over
\int_{0}^{\sqrt2}\pi y^2\,dx}.
$$
A: @Intelligenti pauca gave the solution and
$$\int \big[-(1+t^2)+\sqrt{4 t^2+1}\big]\,dt=-t-\frac{1}{3}t^3+\frac{1}{2}t \sqrt{4 t^2+1} +\frac{1}{4} \sinh ^{-1}(2 t)$$ Computing the definite integrals we have
$$\left(3 \sinh ^{-1}\left(2 \sqrt{2}\right)-2 \sqrt{2}\right)\,P=$$
$$-4 h^3+12 \sqrt{2} h^2+6 \left(\sqrt{4 h \left(h-2 \sqrt{2}\right)+9}-6\right) h+$$ $$3
   \left(-2 \sqrt{8 h \left(h-2 \sqrt{2}\right)+18}+6 \sqrt{2}+\sinh ^{-1}\left(2
   \sqrt{2}\right)\right)-3 \sinh ^{-1}\left(2 \left(\sqrt{2}-h\right)\right)$$ which cannot be inversed. However, you could have a good approximation of it using an empirical model such as
$$h=\frac {\sum_{k=1}^m a_k \,P^k}{1+\sum_{k=1}^n b_k \,P^k}$$ For example, with $m=n=3$, $R^2>0.999999$, all paremeters being highly significant. The maximum absolute error is $0.003328$ and the mean error is $0.000020$.
Just make the regression.
