# Derive expression for gradient operator in spherical coordinates

1. Aug 31, 2007

### jlucas134

I need to derive the expression for the gradient operator in spherical coordinates.

I know the following
R =sqrt(x^2+y^2+z^2)
theta, call it %, = arctan sqrt(x^2+y^2)/z
phi, arctan (y/x)

Using dT/dx= dT/dR*dr/dx+dT/d%*d%/dx+dT/dphi*dphi/dx, do partial derivates...

dR/dx = x/(sqrt(x^2+y^2+z^2)
d%/dx = xz/[(sqrt(x^2+y^2)*(x^2+y^2+z^2)]
dphi/dx = -y/sqrt(x^2+y^2)

The place these values into the listed value dT/dx.

so its,
dT/dx = dT/dR*x/(sqrt(x^2+y^2+z^2)+
dT/d%*xz/[(sqrt(x^2+y^2)*(x^2+y^2+z^2)]+
dT/dphi*y/sqrt(x^2+y^2)

From here I don't know what to do or even if I am doing it right. Its been a while since i have taken calc. I know there is some relations for the trig functions, but can't seems to find them.

the final solution for del gradiant in spherical is

R^*d/dr+theta^/r*d/dtheta+phi^/r sin (phi) *d/dphi.

I'm really lost and need some help. Thanks in advance.

2. Aug 31, 2007

### dextercioby

Express all x,y,z in the RHS in terms of the spherical coordinates. And remember that the gradient of a scalar function is a vector.

3. Aug 31, 2007

### jlucas134

Correct so far?

First, thanks for responding...
Second, am I correct so far?
Third, I don't quite understand what you mean, could you expand on that?

Is it these values substitute into right hand side?

x=R sin theta cos phi
y=R sin theta sin phi
z=R cos theta

I am trying, but I don't see it...the book doesn't elaborate the procedure it used to do cartsian to cylindrical

4. Aug 31, 2007

### jlucas134

Do I have to do this for y and z?

dT/dy= dT/dR*dR/dy+dT/d(theta)*d(theta)/dy+dT/d(phi)*d(phi)/dy

dT/dz= dT/dR*dR/dz+dT/d(theta)*d(theta)/dz+dT/d(phi)*d(phi)/dz

Then after this, its gets ugly, but I think this is how you do it...

x^=R^(cos...)+theta^(cos...)-phi^(sin phi)
y^=R^(sin...)+theta^(cos...)+phi^(cos phi)
z^=R^cos(theta)-theta^sin(theta)

From here, solve
x^T/dx+y^T/dy+z^Tdz, where all of the values here were from above...
for x^T/dx its this..

x^T/dx=[R^(cos...)+theta^(cos...)-phi^(sin phi)]*
[dT/dR*x/(sqrt(x^2+y^2+z^2)+dT/d(theta)*xz/[(sqrt(x^2+y^2)*(x^2+y^2+z^2)]+
dT/d(phi)*y/sqrt(x^2+y^2)]

How do I get the radicals into values of sin and cos?

5. Aug 31, 2007

### wbclark

Hello jlucas134,

Are you familiar at all with tensor analysis? It may simplify this discussion considerably.

6. Aug 31, 2007

### jlucas134

No...I have not covered that in my studies...I can read a little about.

Any idea if I am even close with the way I am going?

7. Aug 31, 2007

### wbclark

Well, I have not studied this a whole lot, but I'll see if I can try to explain. This isn't at all necessary to help you get the correct answer, but if you understand this, you will have a much better understanding of the forces at play here, I think. Again, if you feel like this is too much or not what you're interested in, just ignore it.

The gradient is not actually a vector. It looks like a vector in certain coordinate systems but it does not behave the same way as a vector does when you change your coordinate system. Consider the following physical example:

A bug is walking on a flat surface at a rate of 1cm/sec. The temperature of the surface changes at a rate of 0.1º/cm. Therefore the temperature change experienced by the bug as it moves is 0.1º/sec. Let's say you want to look at this same problem in units of mm (this is like changing your coordinate grid). The bug's speed (which is a vector) is now 10mm/sec. But, surprise, the gradient (which physicists call a "covector" and mathematicians like to call a "one-form") is now 0.01º/mm. In other words, when we look at these two quantities in a new way, the speed increased by a factor of 10 whereas the temperature gradient decreased by a factor of 10. Note that the physical quantities aren't changing here, just how they look with respect to a certain coordinate systems. Most importantly, the temperature change as felt by the bug (a scalar) remains unchanged... 0.01º/mm * 10mm/sec = 0.1º/sec, just as before.

So what's going on here? Note that the gradient (a covector)is a function from vectors to scalars (in other words, you combine the gradient with a direction vector and the result is the directional derivative, scalar). Vectors can also be thought of as functions from Covectors to scalars (combine your direction vector with a gradient and the result is a scalar). So we say that vectors have "tensor character" (1,0) meaning they combine with 1 covector to form a scalar. Covectors, on the other hand, have "tensor character" (0,1) meaning they they combine with one vector to form a scalar. Scalars have tensor character (0,0). In general, a tensor can have character (n,k) where n and k are any natural numbers. If you think of vectors as column vectors and covectors as row vectors, then a matrix is a tensor of character (1,1). The dot product is a tensor of rank (0,2) as it takes two vectors to a scalar. Just like you sometimes use indices to represent vectors or their components, we can use indicial notation for the components of tensors. If V is a vector, we refer to its components by $$V^i$$ and if W is a covector, we refer to its components by $$W_j$$. In 3 dimensional space, the is and js each take on three different values (i = {1,2,3}). In cartesian coordinates, for example, i = {x,y,z} or in spherical coordinates i = {r, theta, phi}. Components of a (n,k) tensor have n lower and k upper indices. A single index can appear once in an upper and lower position on each side of an equation. An equation needs to have the same indices on each side (the exception is upper/lower pairs which are summed over and don't change the tensor character of the rest of the expression). If it appears on both the top and bottom, then it is summed over (this is called the Einstein summation convention). As an example, $$T^\mu_\nu$$ is a (1,1) tensor but $$T^\mu_\mu = T^x_x + T^y_y + T^z_z$$ (in $$\Re^3$$ with Cartesian coordinates) is a scalar (the x, y, z in the last expression are not indices but the values of indices... this needs a better notation imho).

So that was a nice little discussion (I hope) but let's get back to our problem at hand. As long as you're in Euclidean space, you can still use partial derivatives for this type of problem, so, for example, our gradient of some scalar field $$\lambda$$ is written $$\partial_i \lambda$$ (remember that this expression really represents three different quantities for the three different values of i: $$\frac{\partial \lambda}{\partial x}$$, $$\frac{\partial \lambda}{\partial y}$$, and $$\frac{\partial \lambda}{\partial z}$$ in the Cartesian coordinate system). So, using the tensor transformation law (read: chain rule) to convert from one coordinate system to another, $$\partial_{i'} \lambda = \frac{\partial x^i}{\partial x^{i'}} \partial_i \lambda$$. Some things to note here... i' represents spherical coordinates and i represents cartesian coordinates. $$\frac{\partial x^i}{\partial x^{i'}}$$ is just the good old Jacobian (another way to write this I believe is $$\frac{\partial (r, \theta, \phi)}{\partial (x, y, z)}$$. Lastly, the i' on the right side is actually a lower index... it's conventional for indices on the bottom of a derivative to be considered lower.

So let's look at a specific case. Let's say you wanted to know the r component of the gradient. According to the above equation, $$\frac{\partial \lambda}{\partial r} = \partial_r \lambda = \frac{\partial x^i}{\partial r} \partial_i \lambda = \frac{\partial x}{\partial r}\frac{\partial \lambda}{\partial x} + \frac{\partial y}{\partial r}\frac{\partial \lambda}{\partial y} + \frac{\partial z}{\partial r}\frac{\partial \lambda}{\partial z}$$. You can remove the lambda to convert the gradient operator itself.

And, unfortunately, I'm out of time for now, but I'll try to stop by and say some more words on this later. Is this helping?

8. Aug 31, 2007

### jlucas134

Sort of

I think I see what is going on...I have to take the partial derivative of each value with respect to the cooresponding value, r to x theta to x and phi to x, then r, theta, and phi to y and then to z...this in turn will provide the conversion, right?

Is this essentially what how you go about it?