I have a cone with $r=1$ with the tip pointing upward.
The volume of liquid in the cone is given by $$V(h)=\pi\left(h-\frac{h^2}{3}+\frac{h^3}{27}\right)$$
With $0\leq h\leq3$
Why?
I know the volume of cone (with height t) is given by $$V(t)=\frac13 \pi r^2t$$
$V(h)$ is a proportion of $V(t)$, and the radius is equal for both. $h$ is the variable. And $V(h)$ is maximum $1/3$ of $V(t)$ (I think?) since we $h$ is max $3$, and $$V(3)=\pi$$ And for the cone itself $$V(t)=\frac13\pi t$$
$$\frac{V(h)}{V(t)}= \frac{\pi\left(h-\frac{h^2}{3}+\frac{h^3}{27}\right)}{\frac13\pi t}$$
$$\frac{3h-h^2 + \frac{h^3}{9}}{t}=\frac3t$$ for $h=3$
Hmm.. Does not look right.
You can use your formula to calculate the volume of the whole cone and as you pointed out correctly, it is $\pi $.
Now if there is liquid up to a height of $h $, then the rest of the cone, the bit above, has height $3-h $ and is itself a cone right? But you know how to compute a cone's volume! All it takes is that you know its radius. You can find it with basic trigonometry but you can also use ratios:
The big cone has height $3$
The small cone has height $3 - h $
The big cone has radius $1$
The small cone has radius $\frac{3-h}{3} $ because the ratio of the lengths is $r = \frac{3-h}{3} $.
But if two solids have length ratio $r $, then their volume ratio is $r^3$ and thus the volume of the smaller cone is
$$\pi\cdot r^3 = \pi\cdot\left(\frac{3 - h}{3}\right)^3$$
Therefore the volume occupied by the liquid is
$$\pi - \pi\cdot\left(\frac{3 - h}{3}\right)^3 = \pi\cdot \left(1 - \left(\frac{3 - h}{3}\right)^3\right) $$
Which simplifies to
$$\pi\cdot\left(h-\frac{h^2}{3}+\frac{h^3}{27}\right)$$