# Wave equation for sound waves and moving source

Is there a way to take a moving source already into account when one derives the wave equation for sound waves and derive from that using only math the Doppler effect for moving sources?

-

If I understand you correctly, you want to desribe sound waves from the viewpoint of a moving observer. To do this, you just have to take the standard wave equation and perform a variable substitution $\mathbf{x}\mapsto \mathbf{y}:=\mathbf{x}-\mathbf{v}\cdot t$.
You start with $$\partial_t^2 p(\mathbf{x},t) = c^2\nabla^2 p(\mathbf{x},t) = c^2\sum_i\partial_{\!x_i}^2 p(x_1,\ldots,t)$$ The right side transforms as $$c^2\sum_i\partial_{\!x_i}^2 p(x_1,\ldots,t) = c^2\sum_i\partial_{\!x_i}^2 p(y_1+v_1t,\ldots,t)$$ where we yet have to replace the derivative WRT $x_i$ against the derivative WRT $y_i$, but they are the same: $$\frac{\partial}{\partial x_i} = \frac{\partial y_i}{\partial x_i}\frac{\partial}{\partial y_i} = (1+0)\cdot\frac{\partial}{\partial y_i};$$ so $$c^2\nabla_{\!\!\mathbf{x}}^2p(\mathbf{x},t) = c^2\nabla_{\!\!\mathbf{y}}^2p(\mathbf{y}+\mathbf{v}t,\ t).$$ The left side transforms as $$\partial_t^2 p(\mathbf{x},t) = \partial_t^2 p(\mathbf{y}+\mathbf{v}\cdot t,\ t).$$
Here, we would like to drop the $+\mathbf{v}t$, but before we can do this we need to take into account the derivative of this term: $$\partial_t p(\mathbf{y}+\mathbf{v}\cdot t,\ t) = \left.\bigl(\partial_t p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t} + \mathbf{v}\cdot\nabla_{\!\!\mathbf{y}}p(\mathbf{y}+\mathbf{v}\cdot t,\ t)$$ now the second derivative: $$\partial_t\left.\bigl(\partial_t p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t} = \left.\bigl(\partial_t\partial_\tau p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t} + \left.\bigl(\partial_t^2 p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t}$$ where $$\left.\bigl(\partial_t\partial_\tau p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t} = \left.\bigl(\partial_t\,\mathbf{v}\!\cdot\!\nabla_{\!\!\mathbf{y}}p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t}$$ and $$\partial_t\,\mathbf{v}\!\cdot\!\nabla_{\!\!\mathbf{y}}p(\mathbf{y}+\mathbf{v}\cdot t,\ t) = \mathbf{v}\!\cdot\!\nabla_{\!\!\mathbf{y}} \left(\left.\bigl(\partial_t p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t} + \mathbf{v}\cdot\nabla_{\!\!\mathbf{y}}p(\mathbf{y}+\mathbf{v}\cdot t,\ t)\right)$$ $$= \left.\bigl(\partial_t\,\mathbf{v}\!\cdot\!\nabla_{\!\!\mathbf{y}}p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t)\bigr)\right|_{\tau=t} + \mathbf{v}\cdot\nabla_{\!\!\mathbf{y}}^2\,\mathbf{v}\,p(\mathbf{y}+\mathbf{v}\cdot t,\ t)$$ All together, we get $$\partial_t^2p(\mathbf{x},t) = \left.\left( \partial_t^2 p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t) + 2 \partial_t\,\mathbf{v}\!\cdot\!\nabla_{\!\!\mathbf{y}}p(\mathbf{y}+\mathbf{v}\cdot \tau,\ t) + \mathbf{v}\cdot\nabla_{\!\!\mathbf{y}}^2\,\mathbf{v}\,p(\mathbf{y}+\mathbf{v}\cdot t,\ t) \right)\right|_{\tau=t}.$$ Now we may drop the $+\mathbf{v}t$ on both sides of the equation, and get $$\partial_t^2 p(\mathbf{y},t) + 2 \partial_t\,\mathbf{v}\!\cdot\!\nabla p(\mathbf{y},t) + \mathbf{v}\cdot\nabla^2\,\mathbf{v}\,p(\mathbf{y},t) = c^2\nabla^2p(\mathbf{y},t)$$
But in the transformed formulation of the wave equation, the moving source is at rest, so you can now solve it like you would normally solve the wave equation for a resting source. If you then want to simulate a resting observer, you just have to take this solution and evaluate it along the path $\mathbf{y}(t)=\mathbf{y}_0+\mathbf{v}t$. – leftaroundabout Jun 23 '11 at 13:35