# Homework Help: Gradient of a scalar field

1. Jan 31, 2012

### hover

1. The problem statement, all variables and given/known data

Consider the scalar field

$$V = r^n , n ≠ 0$$

expressed in spherical coordinates. Find it's gradient $\nabla V$ in
a.) cartesian coordinates
b.) spherical coordinates

2. Relevant equations

cartesian version:
$$\nabla V = \frac{\partial V}{\partial x}\hat{x} + \frac{\partial V}{\partial y}\hat{y} + \frac{\partial V}{\partial z}\hat{z}$$

spherical version:
$$\nabla V = \frac{\partial V}{\partial r}\hat{r} + \frac{1}{r}*\frac{\partial V}{\partial \phi}\hat{\phi} + \frac{1}{r*sin(\phi)}*\frac{\partial V}{\partial \theta}\hat{\theta}$$

conversion:
$$r = (x^2+y^2+z^2)^\frac{1}{2}$$

3. The attempt at a solution

a.) using the third equation...

$$V = r^n = (x^2+y^2+z^2)^\frac{n}{2}$$

using the first equation and skipping some steps involving the chain rule...
$$\nabla V = \frac{n(x\hat{x}+y\hat{y}+z\hat{z})}{(x^2+y^2+z^2)^\frac{n}{2}}$$

b.)Using the second equation
$$\nabla V = nr^m \hat{r}$$
$$m = n-1$$

Those are my two solutions to this problem. Are these right? Are they wrong? If so where did I go wrong?

Thanks!
hover

2. Jan 31, 2012

### Dick

How did the power n/2 wind up in the denominator?? You should be able to check that the solutions are the same pretty easily. What's $\hat r$ in cartesian coordinates?

3. Jan 31, 2012

### hover

Small mistake there... the denominator should be (n-2)/2 from the chain rule. I think that $\hat r$ in Cartesian coordinates is

$\hat r$ = sin($\phi$)*cos(θ)$\hat{x}$+sin($\phi$)*sin(θ)$\hat{y}$+cos($\phi$)$\hat{z}$

Is that right or am I completely off the mark?

4. Jan 31, 2012

### Dick

The power of r should be (n-2)/2=n/2-1 but it should be in the numerator. $\hat r=\frac{x \hat x + y \hat y + z \hat z}{r}$ is probably a more useful expression.

5. Jan 31, 2012

### hover

I plugged $\hat r *r={x \hat x + y \hat y + z \hat z}$ into my first equation(with r on top and to the power of n/2-1) and I got the value from part b so I guess that these answers are correct. I just have one question. Where exactly did your version of $\hat r=\frac{x \hat x + y \hat y + z \hat z}{r}$ come from? I know this is probably simple but I want to understand where you got that equation from or how you derived it.

6. Jan 31, 2012

### Dick

$\hat r$ is a unit vector that points away from the origin. I took the point $x \hat x + y \hat y + z \hat z$ and subtracted $0 \hat x + 0 \hat y + 0 \hat z$ to get a vector pointing away from the origin and divided by its length, $r=\sqrt(x^2+y^2+z^2)$.