# Calculating divergence of function containing mollyfier

Let $(\phi_\alpha)_{\alpha>0}$ be a familiy of mollyfiers, $\phi_\alpha:\mathbb{R}^n \rightarrow \mathbb{R}$ defined as: \begin{align} \phi_1(x)=\left\{\begin{array}{rcl} c \cdot exp(\frac{-1}{1-\vert x\vert^2}) &,& \vert x \vert < 1\\ 0 &,& \text{otherwise} \end{array}\right. \end{align}

with $c>0$ such that $\int_{R^n} \phi_1(x) dx=1$ and $\phi_\alpha(x)=\alpha^{-n} \phi_1(x/\alpha)$

Consider the function $w(x)=(y_1-y_2) \int_0^1 \phi_\epsilon(x-y_1+t(y_1-y_2)) ~dt$ with $y_1,y_2 \in \mathbb{R}^n$ and calculate its divergence $div~ w(x)= \sum_{i=1}^n \frac {\partial w_i(x)}{\partial x_i}.$

The result should be

$div ~w(x) = \phi_\epsilon(x-y_2)-\phi_\epsilon(x-y_1)$.

How do I calculate the divergence in this case? So far I tried to use the fundamental theorem of calculus, however the result was not the same.

If $v$ is a constant vector and $f$ a function, then $\mathrm{div} \,(vf)=v\cdot \nabla f$. Applying this to $f=w$ and $v=y_1-y_2$, you have to differentiate under the integral sign and get $$\mathrm{div}\, w = \int_0^1 (y_1-y_2)\cdot \nabla \phi_\epsilon(x-y_1+t(y_1-y_2))\, dt$$ Now you just need to note that the integrand is equal to $$\frac{d}{dt}\phi_\epsilon(x-y_1+t(y_1-y_2))$$ and then your claim follows from the fundamental theorem of calculus.