# Homework Help: Divergence what am I doing wrong

1. Mar 29, 2006

I don't understand what I am doing wrong here.

I'm supposed to show that this function is divergence free.

$$\vec v = \left( \frac{x}{x^2+y^2}, \frac{y}{x^2+y^2} \right)$$

I ran the divergence through with my TI-89 at it equals 0. But, I want to calculate it by hand, so it would be easier to do this in polar coordinates (and this is my problem).

$$\vec v(r,\theta) = \left ( \frac{\cos \theta}{r}, \frac{\sin \theta}{r} \left)$$

Standard divergence in cylindrical coordinates (dropping the z component)
$$div\,\, \vec u = \frac{1}{r} \left( \frac{\partial}{\partial r} (rF_r) +\frac{\partial}{\partial \theta} (F_\theta) \right)$$

$$div\,\, \vec v = \frac{1}{r}\left( \frac{\partial}{\partial r} (\cos \theta ) + \frac{\partial}{\partial \theta}\left (\frac{\sin \theta}{r} \right) \right)$$

Now this is obviously not 0, since the $\sin \theta$ is not going anywhere with the partials. So what am I doing wrong?

Thanks,

2. Mar 29, 2006

### Tom Mattson

Staff Emeritus
You made a subtle mistake here. Your vector above is still just $\vec{v}=(v_x,v_y)$. You just changed the expressions for the components. You do not have $\vec{v}=(v_r,v_{\theta})$ yet. To get that you have to transform the basis vectors from $\hat{e}_x$ and $\hat{e}_y$ to $\hat{e}_r$ and $\hat{e}_{\theta}$.

3. Mar 29, 2006

I'm pretty sure I follow what you are saying. Well, I at least understand it. I am unfortunatly too tired to tackle it, so I will do it in the morning... But I should be good with what you said :)

thanks man

4. Mar 29, 2006

### J77

...but I think he's pretty much there.

Since the $$\cos$$ and $$\sin$$ are bounded, and $$1/r\rightarrow 0$$ as $$r\rightarrow\infty$$

(with the exception at $$r=0$$)

5. Mar 29, 2006

### Tom Mattson

Staff Emeritus
No, he is not even close. This has nothing to do with taking a limit. The divergence should vanish identically in polar coordinates, just as it does in rectangular coordinates. His mistake is exactly what I said it was: He is plugging the rectangular components of $\vec{v}$ into the polar form of $\vec{\nabla}$.

$v_x=\frac{x}{x^2+y^2}=\frac{\cos(\theta)}{r}$
Note that this is still just $v_x$

$v_y=\frac{y}{x^2+y^2}=\frac{\sin(\theta)}{r}$
Note that this is still just $v_y$

He needs to find the components $v_r$ and $v_{\theta}$, which both contain contributions from $v_x$ and $v_y$. This is done by transforming the basis vectors, just like I said.

6. Mar 29, 2006

### J77

I'm having a very bad brain day