# Partial Derivative

1. Nov 21, 2011

### autobot.d

I have the equation

$\frac{d\rho}{dt}$=-$\nabla$$\cdot$$\rho v$

where the vector v depends only x and t.

I want to take the partial derivative of this whole equation with respect to t.

Just not sure how to take the partial of the divergence. Thanks!

2. Nov 21, 2011

### SteamKing

Staff Emeritus
Why don't you write out the equivalent equation, replacing the del operator with the partial derivatives incorporated in its meaning?

3. Nov 21, 2011

### autobot.d

$\frac{\partial}{\partial t} \left(\nabla\cdot\rho v\right)$

v a vector again x component only

$\frac{\partial\rho}{\partial t}$$\cdot v$+$\rho$$\frac{dv}{dx}$

knowing rho is with respect to time and v with x.

Yay or nay?

4. Nov 22, 2011

### HallsofIvy

Well, that's not the same problem now! In your first post you stated that v was a function of both x and t and did not say anything about $\rho$. Assuming the most general case, that both v and $\rho$ are functions of both x and t, and writing v= f(x,t)i+ g(x,t)j+ h(x,t)k then we have $\rho v= \rho(x,t)f(x,t)i+ \rho(x,t)g(x,t)j+ \rho(x,t)h(x,t)k$ and
$$\nabla\cdot \rho v= \frac{\partial \rho f}{\partial x}+ \frac{\partial\rho g}{\partial y}+ \frac{\partial \rho h}{\partial z}$$
$$= \frac{\partial\rho}{\partial x}f+ \rho \frac{\partial f}{\partial x}+ \frac{\partial\rho}{\partial y}g+ \rho \frac{\partial g}{\partial y}+ \frac{\partial\rho}{\partial z}h+ \rho\frac{\partial h}{\partial z}$$
$$= \nabla\rho\cdot v+ \rho \nabla\cdot v$$