# About the derivation of the Maxwell stress tensor

In the derivation of the Maxwell stress tensor, we see, like here (or in Jackson's Classical Electrodynamics), the charge density $$\rho$$ upon which $$\textbf{E}$$ and $$\textbf{B}$$ are acting being replaced by $$\nabla \cdot \textbf{E}$$:

$$1$$. Starting with the Lorentz force law $$\mathbf{F} = q(\mathbf{E} + \mathbf{v} \times \mathbf{B})$$ the force per unit volume is $$\mathbf{f} = \rho\mathbf{E} + \mathbf{J} \times \mathbf{B}$$ $$2$$. Next, $$ρ$$ and $$J$$ can be replaced by the fields $$\textbf{E}$$ and $$\mathbf{B}$$, using Gauss's law and Ampère's circuital law: $$\mathbf{f} = \epsilon_0\left(\color{red}{\boldsymbol{\nabla} \cdot \mathbf{E}}\right)\mathbf{E} + \frac{1}{\mu_0}\left(\boldsymbol{\nabla} \times \mathbf{B}\right) \times \mathbf{B} - \epsilon_0\frac{\partial\mathbf{E}}{\partial t} \times \mathbf{B}\,$$

Why do we have any right to replace $$\rho$$ by $$\boldsymbol{\nabla} \cdot \mathbf{E}$$? If we do so, then aren't we saying the field that is acting upon $$\rho$$ is the field generated by $$\rho$$ itself?

Your question is essentially about the meaning of the first Maxwell equation. In the equation $$\nabla \cdot {\bf E} = \frac{\rho}{\epsilon}$$ the field $$\bf E$$ is not necessarily the field sourced by the $$\rho$$ appearing in the equation. The field $$\bf E$$ here refers to the total electric field in the region of space under consideration, no matter who or what may have acted as the source of that field. For example, when we apply the equation to the field between a pair of capacitor plates, the field is the one sourced by the charges on both plates.
So, then, it is perfectly correct to replace $$\rho/\epsilon_0$$ by $$\nabla \cdot {\bf E}$$ in any formula. The overall story of how the field comes about will always result in a field whose divergence matches the local charge density.