# How can I take the divergence of a symbolic vector? [duplicate]

I would like to compute expressions that have the following form:

$$\left(\partial_{p_1} - \partial_{p_2}\right)^2 \left(\partial_{p_1} - \partial_{p_2}\right)^2 \frac{(p_1-p_2)\cdot(p_3-p_4)}{p_1^2p_2^2p_3^2p_4^2},\tag{1}$$

where $$p_i$$ are $$4$$-vectors in Euclidean space. Since I have many similar terms, I would like to define the $$p$$'s symbolically without having to give the components. I did so in the following way: