Using divergence theorem for Green's function I was wondering about something I came across on page 461 in Marsden and Trombas book Vector calculus. Marsden and Tromba use the Gauss/Divergence theorem but it is not clear to me why this should be allowed.
The Green's function $$G(x,x')=\frac 1{4\pi|x-x'|}$$ is certainly not $C^1$ in $B$, if $B$ includes $x'$.
Very happy if someone could explain what I am missing.
Note that $x'$ and $x$ are 3d vectors 
 A: Gauss' Theorem does not apply to $B$. But is does apply to $\Bbb R^3 \setminus B$, the complement of $B$.
A: This depends on how you define the divergence. In the courses I took, we used the divergence theorem to define what the divergence meant; namely
$$\nabla\cdot \mathbf{E}(\mathbf{x}) \equiv \lim_{\mu(S)\rightarrow 0}\frac{1}{\mu(s)} \oint_{A=\partial S} \mathbf{E}\cdot\hat{n} \,\mathrm{d}\mu(A),$$
where $S$ is a compact and convex subset of $\mathbb{R}^n$, $\mu(S)$ is its measure (volume, area, etc), $\hat{n}$ is the outwardly directed surface normal of $S$, $A$ is the boundary of $S$, $\mathrm{d}\mu(A)$ is the differential measure on $A$ (e.g. $R^2\sin\theta\, \mathrm{d}\theta\,\mathrm{d}\phi$ for a sphere in $\mathbb{R}^3$), and $\mathbf{x}$ is the point that is always in $S$ for all $\mu(S)>0$ (i.e. the point $S$ is shrinking down to).
The coordinate versions of the divergence follow from that for any vector field that is differentiable in $S$. When the vector field is non-differentiable, you have to go back to this definition.
From there all you need is the result that
$$\nabla \frac{1}{4\pi|\mathbf{x}-\mathbf{x}'|} = - \frac{\mathbf{x}-\mathbf{x}'}{4\pi|\mathbf{x}-\mathbf{x}'|^3} \tag1$$
to get what you need. Granted, because the original Green's function diverges at $\mathbf{x}=\mathbf{x}'$ the value of (1) at $\mathbf{x}=\mathbf{x}'$ cannot be defined. But, because the coordinate free definition of the divergence above only requires the field to exist in the limit as you approach any particular point and not at that point, it doesn't matter.
Another option would be to treat the Green's function the same way some treat the Dirac delta function. That is, you produce some function  that exists everywhere, and that has the desired properties after taking a limit on some parameter. The most common example for the Dirac delta function is to use a Gaussian
\begin{align}
f(x) &= \int_a^b \delta(x-x')\, f(x')\, \mathrm{d}x' \quad \forall\ x\in(a,b)\\
& = \lim_{s\rightarrow 0^+} \int_a^b \frac{1}{s\sqrt{2\pi}} \mathrm{e}^{-(x-x')^2/(2s^2)}\, f(x')\ \mathrm{d}x'.
\end{align}
In your case you want the function to be $C_1$. One example of such a function that fits your criterion is
\begin{align}
   G_R(\mathbf{x};\mathbf{x}') & =\left\{ \begin{array}{ll}
    \frac{1}{4\pi|\mathbf{x}-\mathbf{x}'|} &  |\mathbf{x}-\mathbf{x}'| \ge R \\
    \frac{3}{8\pi R} - \frac{|\mathbf{x}-\mathbf{x}'|^2}{8\pi R^3}  &  |\mathbf{x}-\mathbf{x}'| < R,
\end{array} \right.
\end{align}
the electric field of a uniformly charged sphere with unit charge.
As I'm sure you can verify, $\lim_{R\rightarrow 0} G_R(\mathbf{x},\mathbf{x}')\rightarrow \frac{1}{4\pi |\mathbf{x}-\mathbf{x}'|}$, $G_R$ is $C_1$, and it will satisfy all of the properties needed of the Green's function in the limit as $R\rightarrow 0$.
