Calculating New Basis Vectors

Let x,y,z denote the cartesian coordinates of a point and e⃗_x⃗, e⃗_y⃗, e⃗_z⃗ its basis.

Given a transformation (from new coordinates to old) we want to find out the unit vectors (basis) of the new coordinate system.

Then the square of the length of a differential element ds is:

ds²=dx²+dy²+dz²

Suppose we want to introduce a new coordinate system with orthogonal basis.

Let u^1, u^2, u^3 be the coordinates in this new coordinate system and e⃗_1⃗, e⃗_2⃗, e⃗_3⃗ be its basis vectors (which are to be calculated).

Then the same ds² is equal to:

ds²={h_1}^{II}⋅{du^1}^{II}+{h_2}^{II}⋅{du^2}^{II}+{h_3}^{II}⋅{du^3}^{II}

(From the above you can usually read off the values for h_1, h_2, h_3).

(by virtue of the coordinate system being orthogonal, the mixed terms do not show up).

Hence, the differential path element dx⃗ can be written as:

dx⃗=h_1⋅e⃗_1⃗⋅du^1+h_2⋅e⃗_2⃗⋅du^2+h_3⋅e⃗_3⃗⋅du^3

Which can be shown to hold by squaring.

Per total differential rule, the differential path element dx⃗ is:

dx⃗=÷{∂x⃗}{∂u^1}⋅du^1+÷{∂x⃗}{∂u^2}⋅du^2+÷{∂x⃗}{∂u^3}⋅du^3 [Equation I]

And so by comparing the coefficients:

÷{∂x⃗}{∂u^1}=h_1⋅e⃗_1⃗
÷{∂x⃗}{∂u^2}=h_2⋅e⃗_2⃗
÷{∂x⃗}{∂u^3}=h_3⋅e⃗_3⃗

Or the more common way it is written:

e⃗_1⃗=÷{1}{h_1}⋅÷{∂x⃗}{∂u^1}
e⃗_2⃗=÷{1}{h_2}⋅÷{∂x⃗}{∂u^2}
e⃗_3⃗=÷{1}{h_3}⋅÷{∂x⃗}{∂u^3}

h_1, h_2, h_3 are called scale factors.

Gradient

Definition of the Gradient

Let f be a scalar function of a position x⃗, i.e. f(x⃗).

Then the Gradient ∇f is defined to be:

df=(∇f)∙dx⃗

Equivalently,

df=(a⋅e⃗_x⃗+b⋅e⃗_y⃗+c⋅e⃗_z⃗)⋅(dx^1⋅e⃗_x⃗+dx^2⋅e⃗_y⃗+dx^3⋅e⃗_z⃗)

This is the only valid definition of the gradient.

All other "gradients" need to be somehow defined on top of this one.

For example if you want to have a "u-gradient" which takes a function f[u_1,u_2,u_3] and returns the gradient of the function, you have to connect it back to the original gradient.

Let's again make f a function of new coordinates.

f=f[u^1,u^2,u^3]

Then the total differential is:

df=÷{∂f}{∂u^1}⋅du^1+÷{∂f}{∂u^2}⋅du^2+÷{∂f}{∂u^3}⋅du^3

But these partial derivatives are NOT the gradient because the lengths would be wrong. The ONLY valid definition of the gradient is:

df=(∇f)∙dx⃗

(if it happens to be the partial derivative, fine. But it doesn't have to be).

By noting that the orthogonality of the basis vectors of the new coordinate system also holds in cartesian (!!!) coordinates, we get the following idea:

Let A, B, C be the components of the result of the gradient in the new coordinate system.

df=(A⋅e⃗_1⃗+B⋅e⃗_2⃗+C⋅e⃗_3⃗)⋅(dx^1⋅e⃗_x⃗+dx^2⋅e⃗_y⃗+dx^3⋅e⃗_z⃗)
df=(A⋅e⃗_1⃗+B⋅e⃗_2⃗+C⋅e⃗_3⃗)∙dx⃗
df=(A⋅e⃗_1⃗+B⋅e⃗_2⃗+C⋅e⃗_3⃗)⋅(÷{∂x⃗}{∂u^1}⋅du^1+÷{∂x⃗}{∂u^2}⋅du^2+÷{∂x⃗}{∂u^3}⋅du^3)
df=(A⋅e⃗_1⃗+B⋅e⃗_2⃗+C⋅e⃗_3⃗)⋅(h_1⋅e⃗_1⃗⋅du^1+h_2⋅e⃗_2⃗⋅du^2+h_3⋅e⃗_3⃗⋅du^3)
df=A⋅h_1⋅du^1+B⋅h_2⋅du^2+C⋅h_3⋅du^3

Compare:

df=÷{∂f}{∂u^1}⋅du^1+÷{∂f}{∂u^2}⋅du^2+÷{∂f}{∂u^3}⋅du^3
÷{∂f}{∂u^1}=A⋅h_1
÷{∂f}{∂u^2}=B⋅h_2
÷{∂f}{∂u^3}=C⋅h_3

Or how it is usually written:

÷{1}{h_1}⋅÷{∂f}{∂u^1}=A
÷{1}{h_2}⋅÷{∂f}{∂u^2}=B
÷{1}{h_3}⋅÷{∂f}{∂u^3}=C

A,B,C are the components of the resulting vector in the new coordinate system.