# The Wikipedia article Divergence, in the section Application to

1. May 20, 2010

### Rasalhague

The Wikipedia article Divergence, in the section Application to

The Wikipedia article Divergence, in the section Application to Cartesian coordinates, says of the del-dot formula for divergence, "Although expressed in terms of coordinates, the result is invariant under orthogonal transformations, as the physical interpretation suggests" ( http://en.wikipedia.org/wiki/Divergence ).

Suppose I take a vector field with Cartesan coordinates (x,y,-2z).

$$\text{div} (\vec{v})=\sum_{i=1}^{n}\frac{\partial v_i}{\partial x_i} = 1+1-2=0.$$

But if I first apply the orthogonal transformation expressed by the matrix

$$A = \begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1 \end{bmatrix},$$

then

$$\text{div} (A \vec{v}) = 1 + 1 + 2 = 4.$$

So should the statement refer specifically to rotations (special/continuous orthogonal transformations)?

2. May 20, 2010

### eok20

Re: Divergence

Notice that under your interpretation, the statement isn't true for special orthogonal transformations either since you could take your example but with -1 in the middle instead of 1. Then A is in SO(3) but div(Av) is still not 0.

What is meant is that this definition of divergence is invariant under orthogonal coordinate transformations, and this is different then just multiplying the vector field by an orthogonal matrix since the tangent vectors and coordinates change. In your example with A = diag(1,1,-1), let the new coordinates be x',y',z'. Then A takes x -> x', y -> y', z -> -z' and (1,0,0) -> (1,0,0), (0,1,0) -> (0,1,0), and (0,0,1) -> (0,0,-1). Therefore in the primed coordinates, v actually looks the same: it is (x',y',-2z').

3. May 20, 2010

### jostpuur

Re: Divergence

Draw a picture of a one dimensional vector field so that the vectors point towards the origo. Like this:

... ---> --> -> o <- <-- <--- ...

Then look at the picture through a mirror. It going to look the same!

The arrows will change places in mirror, but they change directions too, so that's why it's not going to look like as if the arrows started to point away from the origo.

If $f(\boldsymbol{x})$ is a scalar function, and you want to transform it with transformation $A$, then the transformed scalar function is given by formula

$$\overline{f}(\boldsymbol{x}) = f(A^{-1}\boldsymbol{x})$$

But if $\boldsymbol{f}(\boldsymbol{x})$ is a vector function, then the transformed vector function is given by a formula

$$\overline{\boldsymbol{f}}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x}).$$

4. May 20, 2010

### Rasalhague

Re: Divergence

Ah, I see. Thanks to you both.

To take another example (a rotation this time, so that it's not the same as its inverse), if F(x,y)=(x,-y), whose divergence is 1-1=0, and we rotate the coordinates by 90 degrees, x' = -y, and y' = x.

$$\begin{bmatrix}0 & -1\\ 1 & 0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}-x\\y\end{bmatrix}$$

$$\textbf{F}'(x',y')=A(x',-y')=A((-y),-(x))=\begin{bmatrix}0 & 1\\ -1 & 0\end{bmatrix}\begin{bmatrix}-y\\-x\end{bmatrix}=\begin{bmatrix}-x\\y\end{bmatrix}$$

$$\frac{\partial (-x)}{\partial (-y)}+\frac{\partial y}{\partial x}=0+0=0$$

5. May 20, 2010

### jostpuur

Re: Divergence

Not everything in those calculations is ok.

$$F(x,y) = \left(\begin{array}{c} x \\ -y \\ \end{array}\right)$$

and rotate it 90 degrees counter clockwise, the result should be

$$F'(x',y') = \left(\begin{array}{c} -x' \\ y' \\ \end{array}\right)$$

The divergence is

$$\nabla\cdot F' = \frac{\partial}{\partial x'} (-x') + \frac{\partial}{\partial y'} y' = -1 +1 = 0$$

6. May 21, 2010

### Rasalhague

Re: Divergence

Hmm... I think it starts off right with x' = -y, and y' = x, but then I got it wrong when I wrote it in matrix form. That should have been

$$\begin{bmatrix}0 & -1 \\ 1 & 0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}-y\\x\end{bmatrix}$$

Next I apply the vector field function F.

$$F(x',y')=(x',-y')=(-y,-(x))=(-y,-x)$$

Then I apply to the value of the vector field the inverse of the coordinate transformation, as you suggested:

$$F'(x',y')=A^{-1}F(x',y')$$

$$=\begin{bmatrix}0 & 1 \\ -1 & 0\end{bmatrix}\begin{bmatrix}-y\\-x\end{bmatrix}=\begin{bmatrix}-x\\y\end{bmatrix}$$

so F'(x',y')=(-x,y)=(-y',-x'), and for the divergence, I get

$$\frac{\partial (-x)}{\partial x'}+\frac{\partial y}{\partial y'}=\frac{\partial (-x)}{\partial (-y)}+\frac{\partial y}{\partial x}=0+0=0$$

How did you get F'(x',y')=(-x',y')? Have I misunderstood your final formula in #3? I took it to mean that the result could be got by the following steps:

1. Apply coordinate transformation to position vector.
2. Apply vector field function F to the result of 1.
3. Apply the inverse of the coordinate transformation to the result of 2.

7. May 21, 2010

### Rasalhague

Re: Divergence

Take another example, $\boldsymbol{f}=(x,0)$.

$$\text{div} \boldsymbol{f}(\boldsymbol{x})=\frac{\partial f_1}{\partial x}+\frac{\partial f_2}{\partial y}=1+0=1.$$

Let $A^{-1}$ be a coordinate transformation corresponding to a rotation of the coordinate axes by 90 degrees counterclockwise.

$$A^{-1}\boldsymbol{x}=\begin{bmatrix}0 & -1\\ 1 & 0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}-y\\x\end{bmatrix}$$

So x' = -y, and y' = x, and

$$\boldsymbol{f}(A^{-1}\boldsymbol{x})=(-y,0)$$

Therefore

$$\overline{\boldsymbol{f}}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x})=\begin{bmatrix}0 & 1\\ -1 & 0\end{bmatrix}\begin{bmatrix}-y\\0\end{bmatrix}=\begin{bmatrix}0\\y\end{bmatrix}.$$

But

$$\text{div} \overline{\boldsymbol{f}}(\boldsymbol{x})=\frac{\partial f_1'}{\partial x'}+\frac{\partial f_2'}{\partial y'}=\frac{\partial f_1'}{\partial (-y)}+\frac{\partial f_2'}{\partial x}=0+0=0.$$

On the other hand, at least in this case, if we just transform the position vector and not the vector field, then sum the derivatives of each component with respect to the corresponding transformed coordinate, x', y', we get 1+0=1.

What am I doing wrong?

Last edited: May 21, 2010
8. May 21, 2010

### jostpuur

Re: Divergence

The primes are creating confusion. It is possible to carry out the transformation without any primed variables.

If you use my notation

$$\overline{\boldsymbol{f}}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x})$$

then compute divergences like this:

$$\nabla\cdot\boldsymbol{f} = \frac{\partial f_1}{\partial x_1} + \frac{\partial f_2}{\partial x_2}$$

$$\nabla\cdot\overline{\boldsymbol{f}} = \frac{\partial \overline{f_1}}{\partial x_1} + \frac{\partial \overline{f_2}}{\partial x_2}$$

9. May 21, 2010

### jostpuur

Re: Divergence

That's right. You can also check it by drawing a picture. A collection of arrows pointing left and right away from the y-axis, is transformed into a collection of arrows point up and down away from the x-axis.

The divergence should come from this expression:

$$\nabla\cdot\overline{\boldsymbol{f}} = \frac{\partial }{\partial x}0 + \frac{\partial}{\partial y} y = 1$$

10. May 21, 2010

### Rasalhague

Re: Divergence

Sorry, I just used primes in the same sense as your overlines to denote variables in the new coordinate system. In the second of these equations, why aren't the partials with respect to the new coordinates, like this:

$$\nabla\cdot\boldsymbol{f} = \frac{\partial f_1}{\partial x_1} + \frac{\partial f_2}{\partial x_2}$$

$$\nabla\cdot\overline{\boldsymbol{f}} = \frac{\partial \overline{f_1}}{\partial \overline{x}_1} + \frac{\partial \overline{f_2}}{\partial \overline{x}_2}$$

11. May 21, 2010

### jostpuur

Re: Divergence

Because I chose to denote the variables in $\overline{\boldsymbol{f}}$ with $\boldsymbol{x}$.

If you instead used a notation $$\overline{\boldsymbol{f}}(\overline{x}_1,\overline{x}_2)$$, then the divergence would be what you wrote.

My choice of notation is equivalent with this choise:

$$\overline{\boldsymbol{f}}(\overline{\boldsymbol{x}}) = A\boldsymbol{f}(\boldsymbol{x})$$

if $\overline{\boldsymbol{x}}=A\boldsymbol{x}$. But I don't think that this makes anything easier. You have different variables on the different sides of the equation, so it is more difficult to see what happens if you take a partial derivative with respect to something. The equation should be modified so that only $\overline{\boldsymbol{x}}$ or $\boldsymbol{x}$ is present, so that chances to make mistakes get reduced.

12. May 21, 2010

### Rasalhague

Re: Divergence

Is the following correct?

The vector field in the old coordinates:

$$\boldsymbol{f}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x})=A^{-1}\boldsymbol{f}(A\boldsymbol{x}).$$

The vector field in the new coordinates:

$$\overline{\boldsymbol{f}}(\overline{\boldsymbol{x}}) = A\boldsymbol{f}(\boldsymbol{x})=\boldsymbol{f}(A^{-1}\boldsymbol{x}).$$

Its divergence in the old coordinates:

$$\text{div}\boldsymbol{f}=\sum_{i=1}^{n}\frac{\partial }{\partial x_i}f_i(\mathbf{x}),$$

which can also be expressed as

$$\sum_{i=1}^{n}\frac{\partial }{\partial x_i}Af_i(A^{-1}\mathbf{x})=\sum_{i=1}^{n}\frac{\partial }{\partial x_i}A^{-1}f_i(A\mathbf{x}),$$

and is equal to its divergence in the new:

$$\sum_{i=1}^{n}\frac{\partial }{\partial \overline{x}_i}f_i(A^{-1}\mathbf{x})=\sum_{i=1}^{n}\frac{\partial }{\partial \overline{x}_i}Af_i(\mathbf{x}).$$

13. May 22, 2010

### Rasalhague

Re: Divergence

Well, I suppose not $A\mathbf{f}(\boldsymbol{x})$, as that's the sort of mistake I was making originally. But if we look at $$\mathbf{f}(A^{-1}\boldsymbol{x})$$ in terms of your one dimensional symmetric example, taking, say, $\mathbf{f}(\boldsymbol{x})=\mathbf{x}$, and the transformation $\mathbf{x}\mapsto-\mathbf{x}[/tex], we have: [itex]\mathbf{f}(A^{-1}\boldsymbol{x})=\mathbf{f}(-\boldsymbol{x})=-\mathbf{x}$ (right?), whereas $A\mathbf{f}(A^{-1}\boldsymbol{x})=-\mathbf{f}(-\boldsymbol{x})=\mathbf{x}$ (wrong?).

14. May 22, 2010

### jostpuur

Re: Divergence

Both of your equations are right. (The one with "(right?)" and with "(wrong?)").

In particular

$$\overline{f}(x) = Af(A^{-1}x) = -f(-x) = x$$

is right. That's what I explained originally when talking about looking the picture through a mirror.

(Actually in my original mirror explanation is used a function $f(x)=-x$ and not a function $f(x)=x$, but it's a small detail only.)

15. May 22, 2010

### Rasalhague

Re: Divergence

What if we take a function that doesn't have mirror symmetry, though? Then the reflection does change the coordinates. For example, sticking to one dimension:

$$f(x)=x^3;$$

$$A:\mathbb{R}\to\mathbb{R}\; | \; Ax=-x \enspace \text{and} \enspace A^{-1}=A;$$

$$(1) \enspace f(Ax)=f(\overline{x})=Af(x)=\overline{f}(x)=-x^3.$$

But

$$(2) \enspace Af(Ax)=\overline{f}(\overline{x})=-(-x^3)=x^3=f(x),$$

which is the original, untransformed function, so (2) is the identity transformation. The derivative is only invariant under transformation (1) if we take it with respect to the new coordinate,

$$\frac{\mathrm{d} \overline{f}}{\mathrm{d} \overline{x}}=3\overline{x}^2=-3x^2.$$

If we want to go back to using the old coordinate, we can reverse the transformation using (2), then

$$\frac{\mathrm{d} A\overline{f}}{\mathrm{d} x}=\frac{\mathrm{d} f}{\mathrm{d} x}=-3\overline{x}^2=3x^2.$$

But I don't understand how this last equation tells us whether the derivative is invariant under reflection. Doesn't it just tell us, trivially, that it's invariant under the identity transformation?

Last edited: May 22, 2010
16. May 22, 2010

### Rasalhague

Re: Divergence

On second thoughts, f(x) = x3 does make a 1d vector field with reflective symmetry about the origin, doesn't it? I was thinking of the graph. I'll try that again with

$$f(x)=x^2;$$

So the vectors on both sides of the origin are pointing right. In this case,

$$f(Ax)=f(-x)=(-x)^2=x^2=f(x)$$

$$\neq Af(x)=-x^2=Af(Ax)=-f(-x).$$

So, for this example, $Af(Ax)$ isn't the identify transformation.

$$\frac{\mathrm{d} f}{\mathrm{d} x}=2x,$$

whereas

$$\frac{\mathrm{d} \overline{f}}{\mathrm{d} x}=\frac{\mathrm{d} \overline{f}}{\mathrm{d} \overline{x}}=-2x.$$

Last edited: May 22, 2010
17. May 22, 2010

### Rasalhague

Re: Divergence

An illustrated example.

$$\textbf{p}=\begin{bmatrix}p_x\\p_y\end{bmatrix}$$

denotes a position vector in some Cartesian coordinate system. Take the not-particularly-symmetric vector field, $\textbf{v}(\textbf{p})$, with vectors including those shown in this picture.

Rotate the basis vectors by some angle $\theta$, eg. 90 degrees counterclockwise:

$$R=\begin{bmatrix}\cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta)\end{bmatrix} = \begin{bmatrix}0 & -1 \\ 1 & 0 \end{bmatrix}$$

The position vector in the new basis is

$$\overline{\textbf{p}}=R^{-1}\textbf{p}=\begin{bmatrix}0 & 1 \\ -1 & 0 \end{bmatrix}\begin{bmatrix}p_x\\ p_y\end{bmatrix}=\begin{bmatrix}p_y\\ -p_x\end{bmatrix}$$

Then, from the picture, it looks to me as if

$$\overline{\textbf{v}}(\overline{\textbf{p}})=R^{-1}v(R^{-1}p).$$

The coordinates of the point illustrated in the first quadrant (top left) have rotated 90 degrees clockwise relative to the axes, and the field vector at this point, $\overline{\textbf{v}}(\overline{\textbf{p}})$, has also turned 90 degrees clockwise; it was pointing right, in the positive x direction, but if you turn your head 90 degrees anticlockwise, it points "down" in the negative y-bar direction.

(Or, more simply, consider a nonzero field vector at the origin. If the basis vectors are rotated by some angle counterclockwise, then, relative to them, this field vector must rotate clockwise.)

#### Attached Files:

• ###### rotation.jpg
File size:
9.7 KB
Views:
70
Last edited: May 23, 2010
18. May 22, 2010

### Rasalhague

Re: Divergence

To test this, I looked at an example of a vector field from Davis & Snider's Vector Analysis:

$$\textbf{F}=x\textbf{i}+y^2z\textbf{j}+xz^3\textbf{k}.$$

I rotated the axes 90o about the z-axis so that

$$\begin{bmatrix}0 & 1 & 0\\ -1 & 0 & 0\\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}y\\-x\\z\end{bmatrix}.$$

$$\begin{bmatrix}x\\y^2z\\xz^3\end{bmatrix} \mapsto \begin{bmatrix}y\\(-x)^2z\\yz^3\end{bmatrix}$$

$$\begin{bmatrix}0 & 1 & 0\\ -1 & 0 & 0\\ 0 & 0 & 1\end{bmatrix} \begin{bmatrix}y\\(-x)^2z\\yz^3\end{bmatrix}=\begin{bmatrix}(-x)^2z\\-y\\yz^3\end{bmatrix}=\begin{bmatrix}x^2z\\-y\\yz^3\end{bmatrix}$$

And interpreting the divergence formula naturally, taking the derivatives with respect whichever coordinate system the components of the vector field are given in:

$$\text{div}\textbf{F}=1+2yz+3xz^2;$$

$$\text{div}\overline{\textbf{F}}=\frac{\partial x^2z}{\partial y}+\frac{\partial -y}{\partial (-x)}+\frac{\partial yz^3}{\partial z}=0+0+3yz^2,$$

(argh!) which are not, in general, the same. I think it also comes to $3yz^2$ if we use your formula from #3,

$$\text{div} \, R\mathbf{F}(R^{-1}\mathbf{p}),$$

instead of the one I suggested in #17,

$$\text{div} \, R^{-1}\mathbf{F}(R^{-1}\mathbf{p}).$$

Obviously I'm still deeply confused. Either I'm doing something backwards, or too many times, or not enough times, or in the wrong order, or am still misinterpreting the result, or...

19. May 22, 2010

### Rasalhague

Re: Divergence

The reason I think I must be doing something wrong, or still not understanding the concept, in posts such as #7 and the more recent ones is that some of these equations give different values for the divergence of the same vector field depending on which Cartesian coordinate system I use. This contradicts the statement that the value of the divergence "is invariant under orthogonal transformations". I'm thinking of invariant in the sense that the magnitude of a vector is invariant under orthogonal transformations, always having the same scalar value.

20. May 25, 2010

### Rasalhague

Re: Divergence

Aha, I think I might finally be getting there! Or rather, what jostpuur has said is finally sinking in. I drew these diagrams to help me see what's a function of what. The set at the top represents the set of points in a Euclidean space. Below that are the two copies of Rn where the coordinates of position vectors live, and below that (in the red vector space picture) the copies of Rn where the components of the field vectors live in the two different coordinate systems. C is the coordinate transformation. Then, just following the arrows we see that

$$\overline{V}=\overline{V}(\overline{p})=\overline{V}(Cp)=CV(p)=CV(C^{-1}p)$$

as jostpuur pointed out. The other diagram shows a scalar field.

Taking as an example V=(y2,x), and p=(3,2), and C a rotation of the basis by 90 degrees counterclockwise,

$$\overline{p}=Cp=(2,-3)=(\overline{x},\overline{y})$$

$$\overline{V}=CV=(x,-y^2)=(-\overline{y},-\overline{x}^2)=(3,-4)$$

$$\frac{\partial y^2}{\partial x}+\frac{\partial x}{\partial y}=0=\frac{\partial (-\overline{y})}{\partial \overline{x}}+\frac{\partial (-\overlinex{x}^2)}{\partial \overline{y}}$$

because

$$\overline{x}=y$$

$$\overline{y}=-x$$

so

$$\frac{\partial (-\overline{y})}{\partial \overline{x}}=\frac{\partial (-\overline{y})}{\partial \overline{y}}\frac{\partial \overline{y}}{\partial x}\frac{\partial x}{\partial \overline{x}}=(-1)(-1)\frac{\partial x}{\partial y}=0$$

and

$$\frac{\partial (-\overline{x})^2}{\partial \overline{y}}=\frac{\partial (-\overline{x})^2}{\partial \overline{x}}\frac{\partial \overline{x}}{\partial y}\frac{\partial y}{\partial \overline{y}}=-2\overline{x}\frac{\partial y}{\partial (-x)}=-2y(-1)0=0$$

File size:
16.2 KB
Views:
68
File size:
16.3 KB
Views:
91