I am solving a pde and one of the terms in the pde is $$x\cdot \nabla u=x\partial_x u + y\partial_y u.$$ I would like to write this term in polar coordinates.
Setting $x=r\cos\theta, y=r\sin \theta$, I know that, $$\partial_x u = \cos\theta \partial_r u - \frac{\sin\theta}{r}\partial_\theta u $$ and $$\partial_y u = \sin\theta \partial_r u + \frac{\cos\theta}{r}\partial_\theta u $$
which implies that $$x\cdot \nabla u = r\partial_r u.$$
This seems wrong to me since it suggests that this term only depends on the radial component of the function $u.$ Did I make a mistake in my computation somewhere?
There are not mistakes in your calculations. Since $x\cdot \nabla$ is the directional derivative in the radial direction, the result is not too surprising.