Calculate $\text{div} (f)$ Let $A=(a_{ij})$ be a positive definite real Hermitian $N\times N$-matrix.
Consider
$$f(x)=\frac{x}{|x|^2}e^{{-\frac{1}{2}}\langle Ax,x\rangle },\;\forall x\in \mathbb{R}^N\backslash\{0\}.$$

Why
  $$\text{div} (f)(x)=\left(\frac{(N-2)}{|x|^2}-\frac{\langle Ax,x\rangle}{|x|^2} \right)e^{{-\frac{1}{2}}\langle Ax,x\rangle}?$$

Notice that $$\text{div} (f)(x)=\sum_{i=1}^N \frac{\partial f}{\partial x_i}(x).$$
 A: I can do it with $\langle u,v\rangle=u\cdot v$ (dot product). I hope it helps:
$$\nabla\cdot f=\partial_k\left(\frac{x_k}{|x|^2}e^{{-\frac{1}{2}}\langle Ax,x\rangle }\right)=$$
$$e^{{-\frac{1}{2}}\langle Ax,x\rangle }\partial_k\frac{x_k}{|x|^2}+\frac{x_k}{|x|^2}\partial_ke^{{-\frac{1}{2}}\langle Ax,x\rangle }=$$
$$e^{{-\frac{1}{2}}\langle Ax,x\rangle }\frac{1}{{|x|^2}}\partial_kx_k+e^{{-\frac{1}{2}}\langle Ax,x\rangle }x_k\partial_k\frac{1}{|x|^2}-\frac{1}{2}\frac{x_k}{|x|^2}e^{{-\frac{1}{2}}\langle Ax,x\rangle }\partial_k \langle Ax,x\rangle =$$
$$e^{{-\frac{1}{2}}\langle Ax,x\rangle }\frac{N}{{|x|^2}}+e^{{-\frac{1}{2}}\langle Ax,x\rangle }x_k\left(-2|x|^{-3}\frac{x_k}{|x|}\right)-\frac{1}{2}\frac{x_k}{|x|^2}e^{{-\frac{1}{2}}\langle Ax,x\rangle }\partial_k ((Ax)_lx_l) =$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-\frac{2}{|x|^2}x_kx_k-\frac{1}{2}x_k\partial_k(A_{li}x_ix_l)\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-2-\frac{1}{2}x_k\partial_k(A_{li}x_ix_l)\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-2-\frac{1}{2}A_{li}x_k\partial_k(x_ix_l)\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-2-\frac{1}{2}A_{li}x_k[x_l\partial_k(x_i)+x_i\partial_k(x_l)]\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-2-\frac{1}{2}A_{li}x_k[x_l\delta_{ki}+x_i\delta_{kl}]\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-2-\frac{1}{2}x_k[x_lA_{lk}+x_iA_{ki}]\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\left(N-2-\frac{1}{2}[Ax\cdot x+Ax\cdot x]\right)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\Bigg(N-2-Ax\cdot x\Bigg)=$$
$$\frac{e^{{-\frac{1}{2}}\langle Ax,x\rangle }}{|x|^2}\Bigg(N-2-\langle Ax,x\rangle\Bigg)$$
