# The strange function $1/r^2$

We will shortly see that the electric field of a point charge at the origin is proportional to: $$\begineq \myv v (r,\theta, \phi)&=& \frac{1}{r^2}\uv{r}=\frac{\myv r}{r^3}\\ &=&\frac{1}{(x^2+y^2+z^2)^{3/2}}\left(x\,\uv x +y\,\uv y+z\,\uv z \right)\endeq$$

### Problem 1.16

*Sketch $\myv v (\myv r)=\frac{\uv r}{r^2}$ and compute its divergence.*

Your sketch of $\myv v$:

- Arrows always point away from origin.
- Spherically symmetric.
- Length of arrows is smaller as $1/r^2$.

Note that $\myv v \neq d\myv r/dt$!

#### Divergence in Cartesian coordinates

$$\myv v(\myv r)=\frac{\uv r}{r^2}=\frac{\myv r}{r^3}=\frac{x\,\uv x+y\,\uv y+z\,\uv z}{[x^2+y^2+z^2]^{3/2}}.$$

$$\myv \grad \cdot \myv v= \frac{\partial v_x}{\partial x} +\frac{\partial v_y}{\partial y}+\frac{\partial v_z}{\partial z}.$$

Calculating just the first term in the sum: $$\begineq \frac{\partial v_x}{\partial x}&=& \frac{\partial}{\partial x}\left(\frac{x}{(x^2+y^2+z^2)^{3/2}} \right)\\ &=& \frac{1}{(x^2+y^2+z^2)^{3/2}}-\frac 32 \frac{x}{(x^2+y^2+z^2)^{5/2}}2x\\ &=& \frac{x^2+y^2+z^2-3x^2}{(x^2+y^2+z^2)^{5/2}}\\ \endeq $$

When I carry this through for the $y$-component and the $z$-component, and add them together, apparently I'll get: $$\myv \grad \cdot \myv v=\frac{3(x^2+y^2+z^2)-3x^2-3y^2-3z^2}{(x^2+y^2+z^2)^{5/2}}=0.$$

Where (from the sketch) is it obvious that there *has* to be some divergence?

#### Divergence in spherical-polar coordinates

...it's much easier to calculate. Expressing the vector field as $\myv v(\myv r)=\frac{\uv r}{r^2} = v_r \uv r$, we can write the three components of $\myv v$ as: $$ v_r = \frac 1{r^2};\ \ v_\theta=0;\ \ v_\phi=0.$$

We look up the expression for $\myv \grad\cdot\myv v$ in spherical-polar coordinates, and apparently there's only one term we have to calculate: $$\begineq\myv \grad \cdot \myv v &=& \frac{1}{r^2}\frac{\del}{\del r}(r^2 v_r)\\ &=&\frac{1}{r^2}\frac{\del}{\del r}\left(r^2 \frac{1}{r^2}\right)=\frac{1}{r^2}\frac{\del}{\del r}(1) = 0\endeq.$$

The divergence vanishes, except perhaps at $r=0$. (The function $1/r^2$ is, after all, blowing up right there...).

Hmmm!

#### Use the fundamental theorem for divergences...

$$\int_{\cal V} \myv \grad \cdot \myv v\, d \tau = \oint_{\cal S} \myv v \cdot d\uv a.$$

So, let's calculate the surface integral of the flux of $\myv v = (1/r^2)\uv{r}$.

Taking advantage of spherical symmetry, let's use, for our surface of integration, the surface of a sphere of radius $R$ centered on the origin. Luckily, $d \myv a$ myv a or uv a?? points radially outward everywhere on the sphere, parallel to $\myv v$.

To figure our infinitesimal surface area: $r=R$ will be constant. So let's take $da = dl_{\theta}dl_{\phi}=R\,d \theta\, R\sin \theta \,d \phi$, so the integral over the surface of the sphere becomes $$\begineq\oint \myv v \cdot d\myv{a} &=& \int \int \frac{1}{R^2}\uv{r} \cdot R^2\sin \theta\, d \theta\, d \phi\,\uv{r} \\ &=&\int_0^{\pi} \sin \theta \,d \theta \int_0^{2\pi} d \phi = 4 \pi.\endeq$$

So, if we believe the fundamental theorem for divergences, all the
"divergence" must be due to a **singularity** at the origin.

The divergence is acting like there's something that "diverges" only at the origin.

Is it possible for a function to be zero everywhere (except at the origin)
but still to have an integral which is finite? There *is* a kind of mathematical
object that behaves this way, called a...

### Dirac $\delta$ function

A **Dirac delta function**, $\delta(x)$, has these properties:
$$\delta(x)=\{\begin{array}{rl} 0;& \text{if }\ x \neq 0\\
\infty;&\text{if}\ x=0\end{array}\right.,$$
$$\int_{-\infty}^{+\infty}
\delta(x) dx = 1.$$

Consider a Gaussian function $g(x)$, graphed below for A=1 (blue), then 2, then 4 (red)... $$g(x) = C e^{-(Ax)^2}.$$

[spot assignment] Your job is to use Mathematica to explore this gaussian, and find $C$ such that... $$\int_{-\infty}^{+\infty} C e^{-(Ax)^2} dx = 1.$$

You would be right if you guessed that this behaves exactly like a Dirac delta function in the limit... $$\lim_{A\to\infty} C e^{-(Ax)^2} = \delta(x).$$

I think $C=A/\sqrt \pi$.

### When a Dirac delta function meets another function

When we integrate the product of a Dirac delta function with any other function, since $\delta(x)$ is 0 everywhere except at the origin: $$\int_{-\infty}^{+\infty} f(x)\delta(x) dx = f(0)\int_{-\infty}^{+\infty}\delta(x) dx = f(0).$$

Now, $\delta(x-a)$ will be zero everywhere except at $a$, so we say this function "picks out" a particular value of another function when integrated together... $$\int_{-\infty}^{+\infty} f(x)\delta(x-a) dx = f(a).$$

**For example** (Problem 1.43 (c)):
$$\int_{-\infty}^{+\infty} x^3\delta(x+1) dx = (-1)^3 = -1.$$

[How sensitive is this integral to its limits??]

How should we interpret... $\delta(kx)$?

Let's see how this behaves when integrated with another function. We'll need to change the variable of integration to $y=kx \rightarrow dy=k\,dx$: $$\begineq\int_{-\infty}^{+\infty} f(x) \delta(kx) dx&=&\int_{-\infty/k}^{+\infty/k} f(y/k) \delta(y) \frac{dy}{k}\\ &=& f(0)\int_{-\infty/k}^{+\infty/k} \delta(y) \frac{1}{k}dy\\ &=&\frac{f(0)}{|k|}.\endeq$$

### In three dimensions

In 3-d, Cartesian coordinates, we'll write the three-dimensional Dirac delta function $\delta^3(\myv r)$ as a product of three deltas, such that... $$\int_\text{universe} \delta^3(\myv r)\, d \tau = \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} \delta(x) \delta(y) \delta(z) \,dx\, dy\, dz = 1.$$

Also, $$\int_\text{universe} f(\myv r)\delta^3(\myv r-\myv a)\, d \tau = f(\myv a).$$

And so, we can finally return to our original puzzle about the function $1/r^2$. The divergence of this function acts like... $$\myv \grad \cdot \frac{\uv r}{r^2} = 4\pi\delta^3(\myv r).$$

And generally, we'll be interested in that function of relative positions... $\myv \rr$ $$\myv \grad\cdot\frac{\uv \rr}{\rr^2} = 4\pi \delta^3(\myv \rr).$$

**Example** *Write an expression for the volume charge
density $\rho(\myv r)$ of a point charge $q$ at $\myv r '$. Make sure that the
volume integral of $\rho$* equals $q$.

Check this for r vs r' correctiness...

We'd like to use the way that the delta function concentrates things at one place. We'll have ($k$ is just a constant): $$\rho(\myv r) = k\delta^3(\myv r-\myv r')$$

Now, the integral of this charge "density" ought to be equal to $q$: $$q = \int_\text{universe} k \delta^3(\myv r')\, d \tau = k\int_\text{universe} \delta^3(\myv r')\, d \tau= k,$$

So, the desired charge density is precisely

$$\rho(\myv r) = q\delta^3(\myv r')$$

### Explore the gaussian approx to $\delta(x)$

If you haven't already in another class, watch the 10-minute intro to Mathematica.

- Starting up Mathematica (on any ITS-maintained computer at GC): If you're asked for a code to activate Mathematica choose "other options". You want to enter the name of a licensing server. It is "kms.goshen.edu" .
- Do they tell you in there?...When
you're dealing with Mathematica expressions, you hit
**shift-Enter**to execute.

Free form input: "integrate (from -infinity to +infinity) e^(-(Ax)^2)"

See also: Learning resources - higher ed

Your assignment:

- Find the value of $C$ (in terms of $A$) that makes this integral =1: $$\int_{-\infty}^{+\infty} C e^{-(Ax)^2} dx = 1.$$ You'll need to solve an integral. If you haven't used Mathematica that much, you can use the 'free-form input' option to type up the integral in some way. This is supposed to translate free-form input and then show you the results as well as showing you the precise Mathematica syntax that would give you those results.
- Now, that you've got $C$... Make a 'manipulatable' plot of the function $g(x)=C e^{-(Ax)^2} $,
where you have a slider that lets you vary the value of $A$ ranging from 0.1 to 15.0. (Your function should
*look*like the area underneath the curve is always the same, as you slide $A$ up and down...)

E-mail the resulting file to Paul, or else drop it in your Class folder on GCFile.