I am taking a course in fluid dynamics. I'm trying to establish the equality $$\frac{d}{dt}\int_{a(t)}^{b(t)} \rho(x, t)g(x, t)dx = \int_{a(t)}^{b(t)}\rho(x, t)\frac{D}{Dt}g(x, t)dx$$
I can use make use of the mass conservation law, which says that $$\frac{D\rho}{Dt} + \rho v_x = 0$$
I have seen that we can use Leibniz' integral rule to evaluate the LHS and find that
$$\frac{d}{dt}\int_{a(t)}^{b(t)} \rho(x, t)g(x, t)dx = \int_{a(t)}^{b(t)} \left[\rho(x, t)g(x, t)\right]_t dx + \rho\left(b(t), t\right)g\left(b(t), t\right)b'(t) - \rho\left(a(t), t\right)g\left(a(t), t\right)a'(t)$$
Now, examining the RHS, I want to somehow make use the this conservation of mass identity. My idea was to use a product rule outcome, observing that
$$\rho\frac{Dg}{Dt} = \frac{D}{Dt}(\rho g) - g\frac{D\rho}{Dt}$$ and so the RHS can be rephrased as
$$\int_{a(t)}^{b(t)}\left[\frac{D}{Dt}(\rho g) - g\frac{D\rho}{Dt}\right]dx$$ now, using the fact that $\frac{D\rho}{Dt} = -\rho v_x$ the RHS can again be re-expressed as $$\int_{a(t)}^{b(t)}\frac{D}{Dt}(\rho g)dx + \int_{a(t)}^{b(t)}\rho g v_x dx$$ and finally, it seems like a good idea to apply integration by parts to the second integral so that the RHS can be written as
$$\int_{a(t)}^{b(t)}\frac{D}{Dt}(\rho g)dx + \left[\rho g v\right]_{a(t)}^{b(t)} - \int_{a(t)}^{b(t)} \left[\rho g\right]_x v dx$$
And$\ldots$ now I'm relatively unsure about how to proceed.
Many thanks
Never mind, I managed to solve it. The answer lay in the fact that $a'(t) = v\left(a(t)\right)$. From there it was a matter of following definitions